This is an old problem that I've had for quite a while. I suspect the solution is somehow related to the new Chase Cam Code and the ANG_ROTATE or the ROTATE command, but I just can't figure it out. (maybe even vec_dot)

Imagine a space ship under users control, and a drone ship that will follow it. Both ships fly at very nearly the same speed.

If my player ship does a loop, (Tilt values pass thru 90 degrees) my drone flips upside down relative to the user ship when climbing and hitting the 90 degree mark and then corrects itself when passing thru the 90 degree tilt on the way down.

I've tried lots of variations for coding but most are much worse than this simple one with the problem listed above:

code:
 
WHILE(YOU)
{
VEC_DIFF(TEMP,YOUR.POS,MY.POS);
VEC_TO_ANGLE(BODY_ANG,TEMP);
BODY_ANG.ROLL = 0;

VEC_SET(MY.PAN,BODY_ANG);

ENT_MOVE(MY.SPEED,NULLVECTOR);


Does anyone know the correct way to give chase in 3D?

-WildCat



Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!