Game Development Community

Math Question on rotation.

by CdnGater · in Torque Game Engine · 09/16/2004 (8:26 pm) · 3 replies

I am drawing a blank, must be the lack of sleep.

Anyway, how do I get a vector rotation for what direction a vehicle is facing?

Please, I'm not a math wiz, so don't tell me to go look up vectors or quats. I know it has something to do with that. But I can't figure it out..

btw, this is in C++ not CS script.

Thanks

#1
09/16/2004 (10:47 pm)
@Simon - I think what you're asking for is a little different from rotation? If you want a vector representing the vehicle's current pointing direction, you can just pull the vehicles' forward vector. Here is snippet of code torn directly from the getForwardVector consoleMethod code in sceneObject.cc

const MatrixF& mat = object->getTransform();
   Point3F dir;
   mat.getColumn(1,&dir);

Your vector will be:

Please post again if this is NOT what you needed. I'll check back then.

[HOW]EdM|EGTGE
#2
09/16/2004 (10:56 pm)
.....
#3
09/17/2004 (4:05 am)
Thank you Edward, that was what I was looking for. Told you I was pulling a blank. Thanks again.