Code: Select all
ePitch = pxBodyGetRotationPitch (sphereBody)
eYaw = pxBodyGetRotationYaw (sphereBody)
eRoll = pxBodyGetRotationRoll (sphereBody)
If eYaw =-180 And eRoll=180
ePitch = 180 - ePitch
EndIf
If eYaw =180 And eRoll=-180
ePitch = -180 - ePitch
EndIf
sphere_node.setRotation (_VECTOR3DF (ePitch, eYaw, eRoll))
But, this only solves the ball rotating on it's pitch and yaw, as soon as I mix a pitch and roll angle, the ball rotates very erratically, almost like it keeps wanting to re-set to 0.0 after every 90 degree.