I have an entity that is using the ROTATE and move commands to make a big loop.
As it's TILT angle crosses the +-90 degree mark, All angles change in odd ways for each frame, even though the object looks correctly oriented.
For example, my entity is doing a big loop starting with all angles at zero, and rotating by a positive tilt amount with each frame.
While everything looks fine all the time, if I display the angles that it is using, I see a smooth transition of tilt from 0 to 90 while pan and roll stay at zero. Then when 90 is hit, my pan flips by 180, my tilt values start decreasing, and my roll angles seem to alternate between positive and negative.
This happens until the entity completes half a circle, and then all the values seem normal again: Tilt is at -90 and counting up towards +90, while Pan and Roll are at zero again.
Question 1) Please explain what the engine is doing.
Question 2) If I use the normal code to point at something:
VEC_DIFF(temp,target.x, my.x)
vec_to_angle(my.pan,temp)
The entity that is trying to point at the target that is being ROTATED will flip upside-down when the targets angles start getting wierd.
Is there a way to point at an object, perhaps something using the ROTATE command that would fix this problem?
Question 3) Assuming that I have the 3 angles from before and after the rotate instruction, how can I find the **Apparent** change in all 3 angles. (In this case, I would expect pan and roll to always be zero, and the tilt value would come back with whatever my tilt constant was set to all through a complete revolution)
Please help!!
- (Still) Disoriented WildCat