vec_to_ang problems - I cant get a Euler angle to an object!

Posted By: Sub_Game

vec_to_ang problems - I cant get a Euler angle to an object! - 06/25/10 11:38


I'm having a lot of trouble doing the simple calculation of a Euler angle from 2 3D locations. This is my attempt that should have turned my_unit to face force_ent. It has no effect at all.

Code:
vec_set(tempVector, force_ent.x);
vec_sub(tempVector, my_unit.x);
vec_to_angle(my_unit.pan, tempVector);



I have tried several other ways but vec_to_angle returns extreme results.

Help please!
Posted By: Superku

Re: vec_to_ang problems - I cant get a Euler angle to an object! - 06/25/10 14:12

This code looks fine to me. There must be something wrong with the rest of your code!

EDIT: The pointers are correct? Make sure you do not reset the angle somewhere else.
Posted By: Sub_Game

Re: vec_to_ang problems - I cant get a Euler angle to an object! - 06/25/10 21:45

Cool - I will dig through my code. I thought I was going mad!
Posted By: Sub_Game

Re: vec_to_ang problems - I cant get a Euler angle to an object! - 06/27/10 08:01

Thanks superku - you were correct. My pointers were suspect.
© 2024 lite-C Forums