Rotation problems

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Slaine
Posts: 120
Joined: Fri May 04, 2007 12:28 pm

Rotation problems

Post by Slaine »

Hi I'm having a few issues with rotations, it seems when I rotate on the pitch it gets to a certain angle, say 180 and then it bounces back 180 then forward again, I have from what I can tell solved it partially with this code.

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))
I'm using Agia PhysX so thats that function.
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.
Warren
Posts: 60
Joined: Fri Jul 07, 2006 11:41 pm
Location: Santiago De Compostela, Spain

Post by Warren »

take a look to this topic and the use about quaternions

http://irrlicht.sourceforge.net/phpBB2/ ... ingle+ball
------------------------------------------------
Irrlicht Ussers Map
Join now!!
http://www.frappr.com/irrlichtusers
Post Reply