virtual void SetRotation(vector3df rot)
{
m_Rotation = rot;
if (m_NxActor)
{
NxMat34 pose = m_NxActor->getGlobalPose();
pose.M.rotX(rot.X);
pose.M.rotY(rot.Y);
pose.M.rotZ(rot.Z);
m_NxActor->setGlobalPose(pose);
}
PhysX rotations
I know it seems a little odd, but I need to be able to override the Physx rotation on an object periodically (user interaction)
how can I set the rotation of a NxActor using 3 floats for x,y,z?
here is what I am using but it seems... irratic...probably the last rotation is the only affect I see, but i dont know what rows of the matrix to manipulate.
Hi, i use NxQuat for that:
NxReal Angle;
NxQuat q;
q.fromAngleAxis(Angle,NxVec3(0,1,0));
Actor->setGlobalOrientationQuat(q);
Note that Angle domain [0,360], and NxVec(0,1,0) its for Y axis.
NxReal Angle;
NxQuat q;
q.fromAngleAxis(Angle,NxVec3(0,1,0));
Actor->setGlobalOrientationQuat(q);
Note that Angle domain [0,360], and NxVec(0,1,0) its for Y axis.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement