diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-03-19 16:10:49 +0100 |
|---|---|---|
| committer | Sébastien Crozet <sebastien@crozet.re> | 2022-03-20 21:49:16 +0100 |
| commit | db6a8c526d939a125485c89cfb6e540422fe6b4b (patch) | |
| tree | 32738172c6bd27e07ed9a4b8f90f5fbbfc07fd5e /src/dynamics/rigid_body_set.rs | |
| parent | e2e6fc787112ab35a3d4858aa2cf83fcf41c16a2 (diff) | |
| download | rapier-db6a8c526d939a125485c89cfb6e540422fe6b4b.tar.gz rapier-db6a8c526d939a125485c89cfb6e540422fe6b4b.tar.bz2 rapier-db6a8c526d939a125485c89cfb6e540422fe6b4b.zip | |
Fix warnings and add comments.
Diffstat (limited to 'src/dynamics/rigid_body_set.rs')
| -rw-r--r-- | src/dynamics/rigid_body_set.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dynamics/rigid_body_set.rs b/src/dynamics/rigid_body_set.rs index 8f5d8ef..a75d96d 100644 --- a/src/dynamics/rigid_body_set.rs +++ b/src/dynamics/rigid_body_set.rs @@ -168,7 +168,7 @@ impl RigidBodySet { * Remove impulse_joints attached to this rigid-body. */ impulse_joints.remove_joints_attached_to_rigid_body(handle, islands, self); - multibody_joints.remove_articulations_attached_to_rigid_body(handle, islands, self); + multibody_joints.remove_joints_attached_to_rigid_body(handle, islands, self); Some(rb) } @@ -260,6 +260,13 @@ impl RigidBodySet { }) } + /// Update colliders positions after rigid-bodies moved. + /// + /// When a rigid-body moves, the positions of the colliders attached to it need to be updated. + /// This update is generally automatically done at the beggining and the end of each simulation + /// step with `PhysicsPipeline::step`. If the positions need to be updated without running a + /// simulation step (for example when using the `QueryPipeline` alone), this method can be called + /// manually. pub fn propagate_modified_body_positions_to_colliders(&self, colliders: &mut ColliderSet) { for body in self.modified_bodies.iter().filter_map(|h| self.get(*h)) { if body.changes.contains(RigidBodyChanges::POSITION) { |
