Basically I'm stuck here on orientation using a quaternion. I start by defining a starting euler of 0,0,0. Then I convert that into a quat.
Then I take a thrust vector of 0,1,0 (so the thrust will go straight up from the aircraft local space). Now I multiply that thrust vector by the amount of thrust (say 100) which gives me a thrust vector of 0,100,0. Now I take this thrust vector and multiply it by the orientation quat. The object moves straight up...good. Now when I turn this quat on pitch and roll axis everything is still good. If I pitch forward the object moves forward and same with roll. The bad thing is when I yaw, the object continues to act like there was no yaw input and while even though the object is turned 90 degrees left, if i pitch it forward, it still moves forward in worldspace but sideways. For some reason the yawing of the quat isn't turning the thrust vector on the y-axis.
Here's some pseudo code:
vForces = (0,0,0)
vThrust = (0,100,0) ;apply 100 force straight up
vForces = vForces + vThrust ;add thrust to main force
qOrientation = qOrientation * vForcest
vEuler = QuatToEuler( qOrientation )
RotateEntity blah, vEuler\x, vEuler\y, vEuler\z
It's pretty straight forward but somewhere the yaw is getting ignored.
Something else I did that was pretty cool. I took the TFormNormal of the (0,1,0) and did a local to global space convert and used the TFormedXYZ as forces and it worked great...until I gave yaw input...then it went haywire.
So the main question is, how do you make a defined vector stick to the orientation of an object? I want my thrust vector to always be straight up from the object (local space) no matter what the orientation of the object is.
Then I take a thrust vector of 0,1,0 (so the thrust will go straight up from the aircraft local space). Now I multiply that thrust vector by the amount of thrust (say 100) which gives me a thrust vector of 0,100,0. Now I take this thrust vector and multiply it by the orientation quat. The object moves straight up...good. Now when I turn this quat on pitch and roll axis everything is still good. If I pitch forward the object moves forward and same with roll. The bad thing is when I yaw, the object continues to act like there was no yaw input and while even though the object is turned 90 degrees left, if i pitch it forward, it still moves forward in worldspace but sideways. For some reason the yawing of the quat isn't turning the thrust vector on the y-axis.
Here's some pseudo code:
vForces = (0,0,0)
vThrust = (0,100,0) ;apply 100 force straight up
vForces = vForces + vThrust ;add thrust to main force
qOrientation = qOrientation * vForcest
vEuler = QuatToEuler( qOrientation )
RotateEntity blah, vEuler\x, vEuler\y, vEuler\z
It's pretty straight forward but somewhere the yaw is getting ignored.
Something else I did that was pretty cool. I took the TFormNormal of the (0,1,0) and did a local to global space convert and used the TFormedXYZ as forces and it worked great...until I gave yaw input...then it went haywire.
So the main question is, how do you make a defined vector stick to the orientation of an object? I want my thrust vector to always be straight up from the object (local space) no matter what the orientation of the object is.