Snapshotting Physics Simulation

dkfdkf
Posts: 8
Joined: Mon Jul 16, 2007 10:25 pm

Snapshotting Physics Simulation

Post by dkfdkf »

Hi!

I'm want to be able to snapshot a particular instance in time of a physics simulation (and then restore it at a later moment in time.) A practical use of this is:

I want to test controllers A & B; I snapshot my simulation, I run controller A, see how it works; I restore my simulation, I run controller B, see how it works; etc ...

Looking at BulletDynamics/Dynamics/btRigidBody.h, I want to save:
m_linearVelocity, m_angularVelocity, of the Rigid Body; and m_worldTransform of the btCollisionObject

The presence of all the other variables (contacts, motionstate) however ... worries me alot.

Insights?

Thanks!