Hi,
Im trying to rotate an entity following another one using this function:
vec_diff(temp,vtemp.x,my.x);
vec_to_angle(my.ang_pan,temp);
temp_ang.pan = ang(my.ang_pan - my.pan);
if(temp_ang.pan > 0)
{
my.pan += minv(5 * time_step,abs(temp_ang.pan));
}
if(temp_ang.pan < 0)
{
my.pan -= minv(5 * time_step,abs(temp_ang.pan));
}
Where "vtemp" are a entity snapped to the mouse using mouse_dir3d.
The camera.pan rotate whit the "my.entity".
So my problem is when i reach a pan angle of 90 degree my entity reverse is rotation.Probably cause the 180,-180...
Anyone know a way too fix that?
Thx.
Last edited by Altarius; 03/06/13 16:08.