I noticed that there appears to be a difference in the transform values (position, rotation) returned between PhysicsRigidBody.getPhysicsTransform and PhysicsRigidBody.getPhysicsLocation / Rotation.
There seems to be some kind of small lag of getPhyiscsTransform being behind the current simulation step.
// Init testBody = new PhysicsRigidBody( new SphereCollisionShape( 1.0f ), 1.0f ); physicsSpace.add( testBody ); // Update System.out.println( "---" ); System.out.println( "Transform:" + testBody.getPhysicsTransform( new Transform() ).getTranslation() ); System.out.println( "Location:" + testBody.getPhysicsLocation() );
I thought getPhysicsTransform should basically output the same data as individual calls to getPhysicsLocation, just in another data structure.
In my case I thought it would be a little bit more efficient to just pass the whole transform directly from rigid bodies to spatials, because these operate with transforms anyways.
As of now I have only tested this with @sgold’s Bullet Physics implementation in his Minie Library.
Is this a bug or expected behavior?