player axis problem
by JJ62(#0005) · in Torque Game Engine · 02/24/2009 (7:36 am) · 1 replies
I recently implemented the resource that allowed free player rotation with quaterions by Dan Buckmaster. This allows me to rotate around all the axis which is great. My problem is that when I rotate the player for example by 90 degress around y axis the players axis also rotates. So now the players z axis is now pointing in what was the x direction and the x axis is pointing in what was the z direction. I want a way of keeping the players axis static and to not rotate with the model. Anyone who has implemented this quaterion resource can see clearly what Im talking about if they go to there world editor and rotate the player. To to be clear I want the players model to be capable of rotating around a fixed player axis.
I was thinking of rotating around some fixed world axis? Any suggestions on how to address this?
I was thinking of rotating around some fixed world axis? Any suggestions on how to address this?
About the author
Torque Owner Daniel Buckmaster
T3D Steering Committee
See how we use rotatedUp to rotate around? Just replace rotatedUp with the vector you want to rotate around. If you want your Player to rotate around the world up axis, for example, then instead of using the rotatedUP vector to build the rot quaternion, use the regular up vector.