Closed TerryHibbert closed 6 years ago
Thanks a lot for reporting this.
I have fixed this in the documentation in branch "develop" (commit dfb4b811f9af79d1b53db448dcbfc57411abb52a). This will be integrated in the next release of the library.
Now you need to use the getTransform() method on a body to get the current transform. To avoid unpleasant visual effect, you also need to get the interpolated transform between the previous and the current frame as in the following code :
// Get the current transform of the rigid body
rp3d::Transform currentTransform = body->getTransform();
// Interpolate the transform between the previous one and the new one
rp3d::Transform interpolatedTransform = rp3d::Transform::interpolateTransforms(previousTransform, currentTransform, interpolationFactor);
You can see an example in the testbed application of the library.
This issue has been fixed in the version v0.7.0 of ReactPhysics3D that has just been released. Thanks a lot for reporting this.
In section "9.3 Updating a Rigid Body", the code sample provided calls a non-existent "getInterpolatedTransform" method on RigidBody.
Is it now RigidBody::getTransform()? This unexpectedly holds all zeros for me. But that could be some other mistake I'm making.