code-google-com / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

saveKinematicState calculates velocity incorrectly for multiple substeps #345

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using version 2.75 of Bullet (although this issue is still present in the r2019 
trunk).

File: src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
Line: 333

When performing a simulation step with simulation substeps, the 
saveKinematicState(fixedTimeStep) function calculates its velocity over the 
the substep duration but for the full transformation which results in an 
abnormally large velocity.

To remedy this, the velocity can be calculated over the duration of the 
full simulation step (not just the substep) by calling saveKinematicState 
as follows:

saveKinematicState( fixedTimeStep * clampedSimulationSteps );

I have attached a patch that was generated against the Bullet 2.75 source.

Original issue reported on code.google.com by nanoc...@gmail.com on 22 Feb 2010 at 9:00

Attachments:

GoogleCodeExporter commented 9 years ago

That looks reasonable at a first glance.

I'll try to apply it before the Bullet 2.76 release, later this week,
Thanks!
Erwin

Original comment by erwin.coumans on 22 Feb 2010 at 10:15

GoogleCodeExporter commented 9 years ago

Original comment by erwin.coumans on 23 Feb 2010 at 2:33

GoogleCodeExporter commented 9 years ago
No problem :).

I also have code for performing kinematic object interpolation, but I still 
have to
prep it.

Original comment by nanoc...@gmail.com on 23 Feb 2010 at 8:50