can anyone show me how to get the position (translation) of a RigidBody given its handle?
I’m assuming you use a version of nphysics >= 0.12.
body_set your set of bodies of type
DefaultBodySet, you can do:
// Get reference to the rigid body. let rigid_body = body_set.rigid_body(handle).expect("This rigid body does not exist."); // Get the position (containing both translation and rotation). let position = rigid_body.position(); // Read the translation vector itself. let translation = position.translation.vector;
Thanks, this is exactly what I needed!