diff options
| author | Sébastien Crozet <developer@crozet.re> | 2021-09-12 09:53:50 +0200 |
|---|---|---|
| committer | Sébastien Crozet <sebastien@crozet.re> | 2021-09-12 01:49:09 -0700 |
| commit | b364a2b052f6a846e0d040a756c13ee6a7f5ced8 (patch) | |
| tree | b89bc84716f0cf7a920af4f12d7557e8a872474d /src/pipeline | |
| parent | 291be142a51a57351f2e4e00a889ac059597bbad (diff) | |
| download | rapier-b364a2b052f6a846e0d040a756c13ee6a7f5ced8.tar.gz rapier-b364a2b052f6a846e0d040a756c13ee6a7f5ced8.tar.bz2 rapier-b364a2b052f6a846e0d040a756c13ee6a7f5ced8.zip | |
Fix velocity computation for position-based kinematic bodies
Diffstat (limited to 'src/pipeline')
| -rw-r--r-- | src/pipeline/physics_pipeline.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pipeline/physics_pipeline.rs b/src/pipeline/physics_pipeline.rs index 80d75eb..4ba8bfa 100644 --- a/src/pipeline/physics_pipeline.rs +++ b/src/pipeline/physics_pipeline.rs @@ -450,7 +450,10 @@ impl PhysicsPipeline { match rb_type { RigidBodyType::KinematicPositionBased => { let rb_pos: &RigidBodyPosition = bodies.index(handle.0); - let new_vel = rb_pos.interpolate_velocity(integration_parameters.inv_dt()); + let new_vel = rb_pos.interpolate_velocity( + integration_parameters.inv_dt(), + &rb_mprops.local_mprops.local_com, + ); bodies.set_internal(handle.0, new_vel); } RigidBodyType::KinematicVelocityBased => { |
