FxSceneObject2D::getPolarVelocity()
by John Vanderbeck · in Torque Game Builder · 04/01/2005 (6:49 am) · 4 replies
Just a suggestion. I think it would be a useful function. I know I could use it :p
Maybe someoen smarter than me in math just wrote thier own function but since T2D is all about making things easy, this seemed to be a good suggestion.
Maybe someoen smarter than me in math just wrote thier own function but since T2D is all about making things easy, this seemed to be a good suggestion.
#2
- Melv.
04/01/2005 (8:44 am)
There is a new "getLinearVelocityPolar()" function in the coming update. :)- Melv.
#4
- Melv.
04/01/2005 (9:21 am)
To save you waiting, add to "fxSceneObject2D.cc"...//-----------------------------------------------------------------------------
// Get Linear Velocity Polar.
//-----------------------------------------------------------------------------
ConsoleMethod(fxSceneObject2D, getLinearVelocityPolar, const char*, 2, 2, "Gets Objects Linear Velocity using Polar angle/speed.")
{
// Get Linear Velocity.
fxVector2D linearVelocity = object->getLinearVelocity();
// Create Returnable Buffer.
char* pBuffer = Con::getReturnBuffer(256);
// Format Buffer.
dSprintf(pBuffer, 256, "%f %f", mRadToDeg(mAtan(linearVelocity.mX, -linearVelocity.mY)), linearVelocity.len() );
// Return Velocity.
return pBuffer;
}- Melv.
Torque Owner Phillip "Renolc" Gibson