Code: Select all
body.applyTorque(new Vector3(0, 0, -10));
float rotationZ = body.getWorldTransform().getRotation(new Quaternion()).getAngleAround(0, 0, 1);
Is there any way to obtain correct angle from the body?
Code: Select all
body.applyTorque(new Vector3(0, 0, -10));
float rotationZ = body.getWorldTransform().getRotation(new Quaternion()).getAngleAround(0, 0, 1);
Code: Select all
float rotation = body.getWorldTransform().getRotation(new Quaternion()).getRoll();
Code: Select all
body.getWorldTransform().getRotation(mRotation);
float roll = mRotation.getRoll();
float angle = mRotation.getAngleAround(0, 0, 1);
int gimbalPole = mRotation.getGimbalPole();
float rotation = (gimbalPole == 0) ? roll : angle * gimbalPole;