Game Development Community

A built in function for finding the rotation between two points?

by Josias Gibbs · in Torque Game Engine · 09/06/2008 (1:11 pm) · 2 replies

Is there a built in function for TGB that takes two sets of x,y coordinates, and returns the rotation from the first one to the second one? (ie: I have a ship that needs to fly toward a planet, and I need to have the ship rotate toward the planet.)

I could write the function myself - but it seems like the sort of function that would already be implemented - is it?

#1
09/06/2008 (2:10 pm)
There is a behavior on the TDN, something like face-target, you should take a look at its code.
#2
09/07/2008 (4:15 pm)
Perfect - I now have the rotation working.