Skip to content

Commit

Permalink
feature: Add DisableJoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
shanecelis committed Sep 22, 2024
1 parent 7d79ca1 commit 81f336e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/dynamics/solver/joints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,3 +338,7 @@ impl AngleLimit {
None
}
}

/// Disables the joint of the entity it is placed on.
#[derive(Component, Debug)]
pub struct DisableJoint;
2 changes: 1 addition & 1 deletion src/dynamics/solver/xpbd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ pub trait XpbdConstraint<const ENTITY_COUNT: usize>: MapEntities {
pub fn solve_constraint<C: XpbdConstraint<ENTITY_COUNT> + Component, const ENTITY_COUNT: usize>(
mut commands: Commands,
mut bodies: Query<RigidBodyQuery>,
mut constraints: Query<&mut C, Without<RigidBody>>,
mut constraints: Query<&mut C, (Without<RigidBody>, Without<DisableJoint>)>,
time: Res<Time>,
) {
let delta_secs = time.delta_seconds_adjusted();
Expand Down

0 comments on commit 81f336e

Please sign in to comment.