Jump to content
  • Advertisement
Sign in to follow this  
7thAvatar

PhysX rotations

This topic is 3645 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.
	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);
		}

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!