phent_get(local)velocity?

Posted By: ventilator

phent_get(local)velocity? - 06/08/03 03:50

phent_getvelocity seems to retrieve a global velocity vector. for my airplane i need the velocity component of the entity's x-axis only. what would be the best way to convert the global velocity vector to a local one? could phent_makelocal be used for this purpose?
Posted By: ventilator

Re: phent_get(local)velocity? - 06/08/03 04:54

i rotated it like that:

phent_getvelocity(my,vel,nullvector);
vec_rotate(vel,vector(-my.pan,-my.tilt,-my.roll));

i think vel.x is what i want then but i am not completely sure?
Posted By: James Snydstrup

Re: phent_get(local)velocity? - 06/10/03 02:19

@ventilator - I am in a similar situation. I need to know the local velocity vector for my vehicle. Using 'phent_getvelocity' I can tell where the vehicle is moving to but I can't determine if it is moving forward or backward.
Posted By: James Snydstrup

Re: phent_get(local)velocity? - 06/10/03 02:55

@ventilator - Hey, that seems to work. I could have swore I tried looking at a physics entities pan, tilt, roll before and it wasn't reading anything. I must have done something wrong though highly unlikely....lol. [Razz]
© 2024 lite-C Forums