..alright, I've had this problem as well, but I don't think I ever fixed it

Basically, what you have to do is convert the angles from world space to object space (we already knew this). You do that by rotating the angle by the inverse of the objects angle...

With vectors, this is really easy. But with angles... not so much. Here's as example using a vector:

Code:

Function iRotate(&_vec, &_ang)
{
vec_set(temp, _ang); // Store the angle in temp
vec_inverse(temp); // Invert the angle
vec_rotate(_vec, temp); // Rotate the vector
}



You can either try rotating the offset vector for the target before getting the direction, or, apply the same concept to the direction after you've found it. Hope I explained this well


xXxGuitar511
- Programmer