Roll, pitch, yaw

How could I get the Euler angles of an actor?

I did the following, but I’m concerned about signs. Is this correct?

const auto q = actor->getGlobalPose().q;
const auto roll = std::atan2(2.0f * (q.x * q.y + q.w * q.z), 1.0f - 2.0f * (q.y * q.y + q.z * q.z));
const auto pitch = std::asin(2.0f * (q.x * q.z - q.w * q.y));
const auto yaw = std::atan2(2.0f * (q.y * q.z + q.w * q.x), 1.0f - 2.0f * (q.w * q.w + q.z * q.z));
1 Like