Eliminate DefineConsoleFunction

This commit is contained in:
Lukas Joergensen 2018-04-17 16:33:56 +02:00
parent 037d089c4d
commit 5bde18143f
55 changed files with 314 additions and 332 deletions

View file

@ -31,7 +31,7 @@
#include "console/engineAPI.h"
DefineConsoleFunction( mSolveQuadratic, const char*, ( F32 a, F32 b, F32 c ),,
DefineEngineFunction( mSolveQuadratic, const char*, ( F32 a, F32 b, F32 c ),,
"Solve a quadratic equation (2nd degree polynomial) of form a*x^2 + b*x + c = 0.\n"
"@param a First Coefficient."
"@param b Second Coefficient."
@ -49,7 +49,7 @@ DefineConsoleFunction( mSolveQuadratic, const char*, ( F32 a, F32 b, F32 c ),,
return retBuffer;
}
DefineConsoleFunction( mSolveCubic, const char*, ( F32 a, F32 b, F32 c, F32 d ),,
DefineEngineFunction( mSolveCubic, const char*, ( F32 a, F32 b, F32 c, F32 d ),,
"Solve a cubic equation (3rd degree polynomial) of form a*x^3 + b*x^2 + c*x + d = 0.\n"
"@param a First Coefficient."
"@param b Second Coefficient."
@ -68,7 +68,7 @@ DefineConsoleFunction( mSolveCubic, const char*, ( F32 a, F32 b, F32 c, F32 d ),
return retBuffer;
}
DefineConsoleFunction( mSolveQuartic, const char*, ( F32 a, F32 b, F32 c, F32 d, F32 e ),,
DefineEngineFunction( mSolveQuartic, const char*, ( F32 a, F32 b, F32 c, F32 d, F32 e ),,
"Solve a quartic equation (4th degree polynomial) of form a*x^4 + b*x^3 + c*x^2 + d*x + e = 0.\n"
"@param a First Coefficient."
"@param b Second Coefficient."
@ -87,7 +87,7 @@ DefineConsoleFunction( mSolveQuartic, const char*, ( F32 a, F32 b, F32 c, F32 d,
return retBuffer;
}
DefineConsoleFunction( mFloor, S32, ( F32 v ),,
DefineEngineFunction( mFloor, S32, ( F32 v ),,
"Round v down to the nearest integer.\n"
"@param v Number to convert to integer."
"@returns Number converted to integer."
@ -96,7 +96,7 @@ DefineConsoleFunction( mFloor, S32, ( F32 v ),,
return (S32)mFloor( v );
}
DefineConsoleFunction( mRound, S32, ( F32 v ),,
DefineEngineFunction( mRound, S32, ( F32 v ),,
"Round v to the nth decimal place or the nearest whole number by default."
"@param v Value to roundn"
"@return The rounded value as a S32."
@ -105,7 +105,7 @@ DefineConsoleFunction( mRound, S32, ( F32 v ),,
return mRound(v);
}
DefineConsoleFunction( mRoundColour, F32, ( F32 v, S32 n ), (0),
DefineEngineFunction( mRoundColour, F32, ( F32 v, S32 n ), (0),
"Round v to the nth decimal place or the nearest whole number by default."
"@param v Value to roundn"
"@param n Number of decimal places to round to, 0 by defaultn"
@ -118,7 +118,7 @@ DefineConsoleFunction( mRoundColour, F32, ( F32 v, S32 n ), (0),
return mRound(v, n);
}
DefineConsoleFunction( mCeil, S32, ( F32 v ),,
DefineEngineFunction( mCeil, S32, ( F32 v ),,
"Round v up to the nearest integer.\n"
"@param v Number to convert to integer."
"@returns Number converted to integer."
@ -127,7 +127,7 @@ DefineConsoleFunction( mCeil, S32, ( F32 v ),,
return (S32)mCeil( v );
}
DefineConsoleFunction( mFloatLength, const char*, ( F32 v, U32 precision ),,
DefineEngineFunction( mFloatLength, const char*, ( F32 v, U32 precision ),,
"Formats the specified number to the given number of decimal places.\n"
"@param v Number to format."
"@param precision Number of decimal places to format to (1-9)."
@ -148,7 +148,7 @@ DefineConsoleFunction( mFloatLength, const char*, ( F32 v, U32 precision ),,
//------------------------------------------------------------------------------
DefineConsoleFunction( mAbs, F32, ( F32 v ),,
DefineEngineFunction( mAbs, F32, ( F32 v ),,
"Calculate absolute value of specified value.\n"
"@param v Input Value."
"@returns Absolute value of specified value."
@ -157,7 +157,7 @@ DefineConsoleFunction( mAbs, F32, ( F32 v ),,
return mFabs( v );
}
DefineConsoleFunction( mFMod, F32, ( F32 v, F32 d ),,
DefineEngineFunction( mFMod, F32, ( F32 v, F32 d ),,
"Calculate the remainder of v/d.\n"
"@param v Input Value."
"@param d Divisor Value."
@ -167,7 +167,7 @@ DefineConsoleFunction( mFMod, F32, ( F32 v, F32 d ),,
return mFmod( v, d );
}
DefineConsoleFunction( mSqrt, F32, ( F32 v ),,
DefineEngineFunction( mSqrt, F32, ( F32 v ),,
"Calculate the square-root of v.\n"
"@param v Input Value."
"@returns The square-root of the input value."
@ -176,7 +176,7 @@ DefineConsoleFunction( mSqrt, F32, ( F32 v ),,
return mSqrt (v );
}
DefineConsoleFunction( mPow, F32, ( F32 v, F32 p ),,
DefineEngineFunction( mPow, F32, ( F32 v, F32 p ),,
"Calculate b raised to the p-th power.\n"
"@param v Input Value."
"@param p Power to raise value by."
@ -186,7 +186,7 @@ DefineConsoleFunction( mPow, F32, ( F32 v, F32 p ),,
return mPow( v, p );
}
DefineConsoleFunction( mLog, F32, ( F32 v ),,
DefineEngineFunction( mLog, F32, ( F32 v ),,
"Calculate the natural logarithm of v.\n"
"@param v Input Value."
"@returns The natural logarithm of the input value."
@ -195,7 +195,7 @@ DefineConsoleFunction( mLog, F32, ( F32 v ),,
return mLog( v );
}
DefineConsoleFunction( mSin, F32, ( F32 v ),,
DefineEngineFunction( mSin, F32, ( F32 v ),,
"Calculate the sine of v.\n"
"@param v Input Value (in radians)."
"@returns The sine of the input value."
@ -204,7 +204,7 @@ DefineConsoleFunction( mSin, F32, ( F32 v ),,
return mSin( v );
}
DefineConsoleFunction( mCos, F32, ( F32 v ),,
DefineEngineFunction( mCos, F32, ( F32 v ),,
"Calculate the cosine of v.\n"
"@param v Input Value (in radians)."
"@returns The cosine of the input value."
@ -213,7 +213,7 @@ DefineConsoleFunction( mCos, F32, ( F32 v ),,
return mCos( v );
}
DefineConsoleFunction( mTan, F32, ( F32 v ),,
DefineEngineFunction( mTan, F32, ( F32 v ),,
"Calculate the tangent of v.\n"
"@param v Input Value (in radians)."
"@returns The tangent of the input value."
@ -222,7 +222,7 @@ DefineConsoleFunction( mTan, F32, ( F32 v ),,
return mTan( v );
}
DefineConsoleFunction( mAsin, F32, ( F32 v ),,
DefineEngineFunction( mAsin, F32, ( F32 v ),,
"Calculate the arc-sine of v.\n"
"@param v Input Value (in radians)."
"@returns The arc-sine of the input value."
@ -231,7 +231,7 @@ DefineConsoleFunction( mAsin, F32, ( F32 v ),,
return mAsin( v );
}
DefineConsoleFunction( mAcos, F32, ( F32 v ),,
DefineEngineFunction( mAcos, F32, ( F32 v ),,
"Calculate the arc-cosine of v.\n"
"@param v Input Value (in radians)."
"@returns The arc-cosine of the input value."
@ -240,7 +240,7 @@ DefineConsoleFunction( mAcos, F32, ( F32 v ),,
return mAcos( v );
}
DefineConsoleFunction( mAtan, F32, ( F32 rise, F32 run ),,
DefineEngineFunction( mAtan, F32, ( F32 rise, F32 run ),,
"Calculate the arc-tangent (slope) of a line defined by rise and run.\n"
"@param rise of line."
"@param run of line."
@ -250,7 +250,7 @@ DefineConsoleFunction( mAtan, F32, ( F32 rise, F32 run ),,
return mAtan2( rise, run );
}
DefineConsoleFunction( mRadToDeg, F32, ( F32 radians ),,
DefineEngineFunction( mRadToDeg, F32, ( F32 radians ),,
"Convert specified radians into degrees.\n"
"@param radians Input Value (in radians)."
"@returns The specified radians value converted to degrees."
@ -259,7 +259,7 @@ DefineConsoleFunction( mRadToDeg, F32, ( F32 radians ),,
return mRadToDeg( radians );
}
DefineConsoleFunction( mDegToRad, F32, ( F32 degrees ),,
DefineEngineFunction( mDegToRad, F32, ( F32 degrees ),,
"Convert specified degrees into radians.\n"
"@param degrees Input Value (in degrees)."
"@returns The specified degrees value converted to radians."
@ -268,7 +268,7 @@ DefineConsoleFunction( mDegToRad, F32, ( F32 degrees ),,
return mDegToRad( degrees );
}
DefineConsoleFunction( mClamp, F32, ( F32 v, F32 min, F32 max ),,
DefineEngineFunction( mClamp, F32, ( F32 v, F32 min, F32 max ),,
"Clamp the specified value between two bounds.\n"
"@param v Input value."
"@param min Minimum Bound."
@ -279,7 +279,7 @@ DefineConsoleFunction( mClamp, F32, ( F32 v, F32 min, F32 max ),,
return mClampF( v, min, max );
}
DefineConsoleFunction( mSaturate, F32, ( F32 v ),,
DefineEngineFunction( mSaturate, F32, ( F32 v ),,
"Clamp the specified value between 0 and 1 (inclusive).\n"
"@param v Input value."
"@returns The specified value clamped between 0 and 1 (inclusive)."
@ -288,7 +288,7 @@ DefineConsoleFunction( mSaturate, F32, ( F32 v ),,
return mClampF( v, 0.0f, 1.0f );
}
DefineConsoleFunction(mWrapF, F32, (F32 v, F32 min, F32 max), ,
DefineEngineFunction(mWrapF, F32, (F32 v, F32 min, F32 max), ,
"Wrap the specified value between two bounds.\n"
"@param v Input value."
"@param min Minimum Bound."
@ -299,7 +299,7 @@ DefineConsoleFunction(mWrapF, F32, (F32 v, F32 min, F32 max), ,
return mWrapF(v, min, max);
}
DefineConsoleFunction(mWrap, S32, (S32 v, S32 min, S32 max), ,
DefineEngineFunction(mWrap, S32, (S32 v, S32 min, S32 max), ,
"Wrap the specified value between two bounds.\n"
"@param v Input value."
"@param min Minimum Bound."
@ -311,7 +311,7 @@ DefineConsoleFunction(mWrap, S32, (S32 v, S32 min, S32 max), ,
}
DefineConsoleFunction( getMax, F32, ( F32 v1, F32 v2 ),,
DefineEngineFunction( getMax, F32, ( F32 v1, F32 v2 ),,
"Calculate the greater of two specified numbers.\n"
"@param v1 Input value."
"@param v2 Input value."
@ -321,7 +321,7 @@ DefineConsoleFunction( getMax, F32, ( F32 v1, F32 v2 ),,
return getMax( v1, v2 );
}
DefineConsoleFunction( getMin, F32, ( F32 v1, F32 v2 ),,
DefineEngineFunction( getMin, F32, ( F32 v1, F32 v2 ),,
"Calculate the lesser of two specified numbers.\n"
"@param v1 Input value."
"@param v2 Input value."
@ -331,7 +331,7 @@ DefineConsoleFunction( getMin, F32, ( F32 v1, F32 v2 ),,
return getMin( v1, v2 );
}
DefineConsoleFunction( mLerp, F32, ( F32 v1, F32 v2, F32 time ),,
DefineEngineFunction( mLerp, F32, ( F32 v1, F32 v2, F32 time ),,
"Calculate linearly interpolated value between two specified numbers using specified normalized time.\n"
"@param v1 Interpolate From Input value."
"@param v2 Interpolate To Input value."
@ -342,7 +342,7 @@ DefineConsoleFunction( mLerp, F32, ( F32 v1, F32 v2, F32 time ),,
return mLerp( v1, v2, time );
}
DefineConsoleFunction( mPi, F32, (),,
DefineEngineFunction( mPi, F32, (),,
"Return the value of PI (half-circle in radians).\n"
"@returns The value of PI."
"@ingroup Math" )
@ -350,7 +350,7 @@ DefineConsoleFunction( mPi, F32, (),,
return M_PI_F;
}
DefineConsoleFunction( m2Pi, F32, (),,
DefineEngineFunction( m2Pi, F32, (),,
"Return the value of 2*PI (full-circle in radians).\n"
"@returns The value of 2*PI."
"@ingroup Math" )
@ -358,7 +358,7 @@ DefineConsoleFunction( m2Pi, F32, (),,
return M_2PI_F;
}
DefineConsoleFunction( mIsPow2, bool, ( S32 v ),,
DefineEngineFunction( mIsPow2, bool, ( S32 v ),,
"Returns whether the value is an exact power of two.\n"
"@param v Input value."
"@returns Whether the specified value is an exact power of two."
@ -367,7 +367,7 @@ DefineConsoleFunction( mIsPow2, bool, ( S32 v ),,
return isPow2( v );
}
DefineConsoleFunction( mRandomDir, Point3F, (Point3F axis, F32 angleMin, F32 angleMax),,
DefineEngineFunction( mRandomDir, Point3F, (Point3F axis, F32 angleMin, F32 angleMax),,
"Returns a randomized direction based on a starting axis and the min/max angles.\n"
"@param axis Main axis to deviate the direction from."
"@param angleMin minimum amount of deviation from the axis."
@ -378,7 +378,7 @@ DefineConsoleFunction( mRandomDir, Point3F, (Point3F axis, F32 angleMin, F32 ang
return MathUtils::randomDir(axis, angleMin, angleMax);
}
DefineConsoleFunction( mRandomPointInSphere, Point3F, (F32 radius), ,
DefineEngineFunction( mRandomPointInSphere, Point3F, (F32 radius), ,
"Returns a randomized point inside a sphere of a given radius.\n"
"@param radius The radius of the sphere to find a point in."
"@returns Randomized point inside a sphere."
@ -387,7 +387,7 @@ DefineConsoleFunction( mRandomPointInSphere, Point3F, (F32 radius), ,
return MathUtils::randomPointInSphere(radius);
}
DefineConsoleFunction( mGetAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB), ,
DefineEngineFunction( mGetAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB), ,
"Returns angle between two vectors.\n"
"@param vecA First input vector."
"@param vecB Second input vector."
@ -397,7 +397,7 @@ DefineConsoleFunction( mGetAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB
return MathUtils::getAngleBetweenVectors(vecA, vecB);
}
DefineConsoleFunction(mGetSignedAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB, VectorF norm), (VectorF::Zero, VectorF::Zero, VectorF::Zero),
DefineEngineFunction(mGetSignedAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB, VectorF norm), (VectorF::Zero, VectorF::Zero, VectorF::Zero),
"Returns signed angle between two vectors, using a normal for orientation.\n"
"@param vecA First input vector."
"@param vecB Second input vector."

View file

@ -325,7 +325,7 @@ TEST(Maths, RotationF_Calculations)
};
#endif
DefineConsoleFunction(AddRotation, RotationF, (RotationF a, RotationF b), ,
DefineEngineFunction(AddRotation, RotationF, (RotationF a, RotationF b), ,
"Adds two rotations together.\n"
"@param a Rotation one."
"@param b Rotation two."
@ -335,7 +335,7 @@ DefineConsoleFunction(AddRotation, RotationF, (RotationF a, RotationF b), ,
return a + b;
}
DefineConsoleFunction(SubtractRotation, RotationF, (RotationF a, RotationF b), ,
DefineEngineFunction(SubtractRotation, RotationF, (RotationF a, RotationF b), ,
"Subtracts two rotations.\n"
"@param a Rotation one."
"@param b Rotation two."
@ -345,7 +345,7 @@ DefineConsoleFunction(SubtractRotation, RotationF, (RotationF a, RotationF b), ,
return a - b;
}
DefineConsoleFunction(InterpolateRotation, RotationF, (RotationF a, RotationF b, F32 factor), ,
DefineEngineFunction(InterpolateRotation, RotationF, (RotationF a, RotationF b, F32 factor), ,
"Interpolates between two rotations.\n"
"@param a Rotation one."
"@param b Rotation two."
@ -358,7 +358,7 @@ DefineConsoleFunction(InterpolateRotation, RotationF, (RotationF a, RotationF b,
return result;
}
DefineConsoleFunction(RotationLookAt, RotationF, (Point3F origin, Point3F target, Point3F up),
DefineEngineFunction(RotationLookAt, RotationF, (Point3F origin, Point3F target, Point3F up),
(Point3F(0, 0, 0), Point3F(0, 0, 0), Point3F(0, 0, 1)),
"Provides a rotation orientation to look at a target from a given position.\n"
"@param origin Position of the object doing the looking."
@ -372,7 +372,7 @@ DefineConsoleFunction(RotationLookAt, RotationF, (Point3F origin, Point3F target
return result;
}
DefineConsoleFunction(setRotationRightVector, RotationF, (RotationF rot, VectorF rightVec), ,
DefineEngineFunction(setRotationRightVector, RotationF, (RotationF rot, VectorF rightVec), ,
"Sets the right vector of the rotation.\n"
"@param Starting rotation."
"@param New up vector."
@ -383,7 +383,7 @@ DefineConsoleFunction(setRotationRightVector, RotationF, (RotationF rot, VectorF
return rot;
}
DefineConsoleFunction(setRotationUpVector, RotationF, (RotationF rot, VectorF upVec), ,
DefineEngineFunction(setRotationUpVector, RotationF, (RotationF rot, VectorF upVec), ,
"Sets the up vector of the rotation.\n"
"@param Starting rotation."
"@param New up vector."
@ -394,14 +394,14 @@ DefineConsoleFunction(setRotationUpVector, RotationF, (RotationF rot, VectorF up
return rot;
}
DefineConsoleFunction(getRotationForwardVector, VectorF, (RotationF rot), ,
DefineEngineFunction(getRotationForwardVector, VectorF, (RotationF rot), ,
"Get the forward vector of a rotation.\n"
"@ingroup Math")
{
return rot.asMatrixF().getForwardVector();
}
DefineConsoleFunction(getRotationRightVector, VectorF, (RotationF rot), ,
DefineEngineFunction(getRotationRightVector, VectorF, (RotationF rot), ,
"Gets the right vector of a rotation.\n"
"@param Our rotation."
"@ingroup Math")
@ -409,7 +409,7 @@ DefineConsoleFunction(getRotationRightVector, VectorF, (RotationF rot), ,
return rot.asMatrixF().getRightVector();
}
DefineConsoleFunction(getRotationUpVector, VectorF, (RotationF rot), ,
DefineEngineFunction(getRotationUpVector, VectorF, (RotationF rot), ,
"Gets the up vector of a rotation.\n"
"@param Our rotation."
"@ingroup Math")
@ -417,7 +417,7 @@ DefineConsoleFunction(getRotationUpVector, VectorF, (RotationF rot), ,
return rot.asMatrixF().getUpVector();
}
DefineConsoleFunction(getRotationDirection, Point3F, (RotationF rot),,
DefineEngineFunction(getRotationDirection, Point3F, (RotationF rot),,
"Gets the direction from the rotation's angles.\n"
"@param Our rotation."
"@ingroup Math")

View file

@ -631,7 +631,7 @@ ConsoleSetType(TypeRotationF)
//-----------------------------------------------------------------------------
DefineConsoleFunction( VectorAdd, VectorF, ( VectorF a, VectorF b ),,
DefineEngineFunction( VectorAdd, VectorF, ( VectorF a, VectorF b ),,
"Add two vectors.\n"
"@param a The first vector.\n"
"@param b The second vector.\n"
@ -659,7 +659,7 @@ DefineConsoleFunction( VectorAdd, VectorF, ( VectorF a, VectorF b ),,
//-----------------------------------------------------------------------------
DefineConsoleFunction( VectorSub, VectorF, ( VectorF a, VectorF b ),,
DefineEngineFunction( VectorSub, VectorF, ( VectorF a, VectorF b ),,
"Subtract two vectors.\n"
"@param a The first vector.\n"
"@param b The second vector.\n"
@ -689,7 +689,7 @@ DefineConsoleFunction( VectorSub, VectorF, ( VectorF a, VectorF b ),,
//-----------------------------------------------------------------------------
DefineConsoleFunction( VectorScale, VectorF, ( VectorF a, F32 scalar ),,
DefineEngineFunction( VectorScale, VectorF, ( VectorF a, F32 scalar ),,
"Scales a vector by a scalar.\n"
"@param a The vector to scale.\n"
"@param scalar The scale factor.\n"
@ -716,7 +716,7 @@ DefineConsoleFunction( VectorScale, VectorF, ( VectorF a, F32 scalar ),,
{
return a * scalar;
}
DefineConsoleFunction( VectorMul, VectorF, ( VectorF a, VectorF b ),,
DefineEngineFunction( VectorMul, VectorF, ( VectorF a, VectorF b ),,
"Multiplies two vectors.\n"
"@param a The first vector.\n"
"@param b The second vector.\n"
@ -744,7 +744,7 @@ DefineConsoleFunction( VectorMul, VectorF, ( VectorF a, VectorF b ),,
return a * b;
}
DefineConsoleFunction( VectorDiv, VectorF, ( VectorF a, VectorF b ),,
DefineEngineFunction( VectorDiv, VectorF, ( VectorF a, VectorF b ),,
"Divide two vectors.\n"
"@param a The first vector.\n"
"@param b The second vector.\n"
@ -779,7 +779,7 @@ DefineConsoleFunction( VectorDiv, VectorF, ( VectorF a, VectorF b ),,
//-----------------------------------------------------------------------------
DefineConsoleFunction( VectorNormalize, VectorF, ( VectorF v ),,
DefineEngineFunction( VectorNormalize, VectorF, ( VectorF v ),,
"Brings a vector into its unit form, i.e. such that it has the magnitute 1.\n"
"@param v The vector to normalize.\n"
"@return The vector @a v scaled to length 1.\n\n"
@ -811,7 +811,7 @@ DefineConsoleFunction( VectorNormalize, VectorF, ( VectorF v ),,
//-----------------------------------------------------------------------------
DefineConsoleFunction( VectorDot, F32, ( VectorF a, VectorF b ),,
DefineEngineFunction( VectorDot, F32, ( VectorF a, VectorF b ),,
"Compute the dot product of two vectors.\n"
"@param a The first vector.\n"
"@param b The second vector.\n"
@ -841,7 +841,7 @@ DefineConsoleFunction( VectorDot, F32, ( VectorF a, VectorF b ),,
//-----------------------------------------------------------------------------
DefineConsoleFunction( VectorCross, VectorF, ( VectorF a, VectorF b ),,
DefineEngineFunction( VectorCross, VectorF, ( VectorF a, VectorF b ),,
"Calculcate the cross product of two vectors.\n"
"@param a The first vector.\n"
"@param b The second vector.\n"
@ -873,7 +873,7 @@ DefineConsoleFunction( VectorCross, VectorF, ( VectorF a, VectorF b ),,
//-----------------------------------------------------------------------------
DefineConsoleFunction( VectorDist, F32, ( VectorF a, VectorF b ),,
DefineEngineFunction( VectorDist, F32, ( VectorF a, VectorF b ),,
"Compute the distance between two vectors.\n"
"@param a The first vector.\n"
"@param b The second vector.\n"
@ -906,7 +906,7 @@ DefineConsoleFunction( VectorDist, F32, ( VectorF a, VectorF b ),,
//-----------------------------------------------------------------------------
DefineConsoleFunction( VectorMidPoint, VectorF, ( VectorF a, VectorF b ),,
DefineEngineFunction( VectorMidPoint, VectorF, ( VectorF a, VectorF b ),,
"Gets the midpoint between the two vectors.\n"
"@param a The first vector.\n"
"@param b The second vector.\n"
@ -934,7 +934,7 @@ DefineConsoleFunction( VectorMidPoint, VectorF, ( VectorF a, VectorF b ),,
//-----------------------------------------------------------------------------
DefineConsoleFunction( VectorLen, F32, ( VectorF v ),,
DefineEngineFunction( VectorLen, F32, ( VectorF v ),,
"Calculate the magnitude of the given vector.\n"
"@param v A vector.\n"
"@return The length of vector @a v.\n\n"
@ -963,7 +963,7 @@ DefineConsoleFunction( VectorLen, F32, ( VectorF v ),,
//-----------------------------------------------------------------------------
DefineConsoleFunction( VectorOrthoBasis, MatrixF, ( AngAxisF aa ),,
DefineEngineFunction( VectorOrthoBasis, MatrixF, ( AngAxisF aa ),,
"Create an orthogonal basis from the given vector.\n"
"@param aaf The vector to create the orthogonal basis from.\n"
"@return A matrix representing the orthogonal basis.\n"
@ -977,7 +977,7 @@ DefineConsoleFunction( VectorOrthoBasis, MatrixF, ( AngAxisF aa ),,
//-----------------------------------------------------------------------------
//ConsoleFunction(VectorRot, const char*, 3, 3, "(Vector3F, float) rotate a vector in 2d")
DefineConsoleFunction( VectorRot, const char*, (Point3F v, F32 angle), , "(Vector3F, float) rotate a vector in 2d")
DefineEngineFunction( VectorRot, const char*, (Point3F v, F32 angle), , "(Vector3F, float) rotate a vector in 2d")
{
//VectorF v(0,0,0);
//dSscanf(argv[1],"%g %g %g",&v.x,&v.y,&v.z);
@ -996,7 +996,7 @@ DefineConsoleFunction( VectorRot, const char*, (Point3F v, F32 angle), , "(Vecto
return returnBuffer;
}
DefineConsoleFunction( VectorLerp, VectorF, ( VectorF a, VectorF b, F32 t ),,
DefineEngineFunction( VectorLerp, VectorF, ( VectorF a, VectorF b, F32 t ),,
"Linearly interpolate between two vectors by @a t.\n"
"@param a Vector to start interpolation from.\n"
"@param b Vector to interpolate to.\n"
@ -1032,7 +1032,7 @@ DefineConsoleFunction( VectorLerp, VectorF, ( VectorF a, VectorF b, F32 t ),,
return c;
}
DefineConsoleFunction(VectorReflect, VectorF, (VectorF vec, VectorF normal), ,
DefineEngineFunction(VectorReflect, VectorF, (VectorF vec, VectorF normal), ,
"Compute the reflection of a vector based on a normal.\n"
"@param a The vector.\n"
"@param b The normal.\n"
@ -1046,7 +1046,7 @@ DefineConsoleFunction(VectorReflect, VectorF, (VectorF vec, VectorF normal), ,
//-----------------------------------------------------------------------------
DefineConsoleFunction( MatrixCreate, TransformF, ( VectorF position, AngAxisF orientation ),,
DefineEngineFunction( MatrixCreate, TransformF, ( VectorF position, AngAxisF orientation ),,
"Create a transform from the given translation and orientation.\n"
"@param position The translation vector for the transform.\n"
"@param orientation The axis and rotation that orients the transform.\n"
@ -1059,7 +1059,7 @@ DefineConsoleFunction( MatrixCreate, TransformF, ( VectorF position, AngAxisF or
//-----------------------------------------------------------------------------
DefineConsoleFunction( MatrixCreateFromEuler, TransformF, ( Point3F angles ),,
DefineEngineFunction( MatrixCreateFromEuler, TransformF, ( Point3F angles ),,
"@Create a matrix from the given rotations.\n\n"
"@param Vector3F X, Y, and Z rotation in *radians*.\n"
"@return A transform based on the given orientation.\n"
@ -1074,7 +1074,7 @@ DefineConsoleFunction( MatrixCreateFromEuler, TransformF, ( Point3F angles ),,
//-----------------------------------------------------------------------------
DefineConsoleFunction( MatrixMultiply, TransformF, ( TransformF left, TransformF right ),,
DefineEngineFunction( MatrixMultiply, TransformF, ( TransformF left, TransformF right ),,
"@brief Multiply the two matrices.\n\n"
"@param left First transform.\n"
"@param right Right transform.\n"
@ -1091,7 +1091,7 @@ DefineConsoleFunction( MatrixMultiply, TransformF, ( TransformF left, TransformF
//-----------------------------------------------------------------------------
DefineConsoleFunction( MatrixMulVector, VectorF, ( TransformF transform, VectorF vector ),,
DefineEngineFunction( MatrixMulVector, VectorF, ( TransformF transform, VectorF vector ),,
"@brief Multiply the vector by the transform assuming that w=0.\n\n"
"This function will multiply the given vector by the given transform such that translation will "
"not affect the vector.\n\n"
@ -1107,7 +1107,7 @@ DefineConsoleFunction( MatrixMulVector, VectorF, ( TransformF transform, VectorF
//-----------------------------------------------------------------------------
DefineConsoleFunction( MatrixMulPoint, Point3F, ( TransformF transform, Point3F point ),,
DefineEngineFunction( MatrixMulPoint, Point3F, ( TransformF transform, Point3F point ),,
"@brief Multiply the given point by the given transform assuming that w=1.\n\n"
"This function will multiply the given vector such that translation with take effect.\n"
"@param transform A transform.\n"
@ -1124,7 +1124,7 @@ ConsoleFunctionGroupEnd(MatrixMath);
//------------------------------------------------------------------------------
DefineConsoleFunction( getBoxCenter, Point3F, ( Box3F box ),,
DefineEngineFunction( getBoxCenter, Point3F, ( Box3F box ),,
"Get the center point of an axis-aligned box.\n\n"
"@param b A Box3F, in string format using \"minExtentX minExtentY minExtentZ maxExtentX maxExtentY maxExtentZ\"\n"
"@return Center of the box.\n"
@ -1176,7 +1176,7 @@ F32 mRandF()
return gRandGen.randF();
}
DefineConsoleFunction(getRandom, F32, (S32 a, S32 b), (S32_MAX, S32_MAX),
DefineEngineFunction(getRandom, F32, (S32 a, S32 b), (S32_MAX, S32_MAX),
"( int a, int b ) "
"@brief Returns a random number based on parameters passed in..\n\n"
"If no parameters are passed in, getRandom() will return a float between 0.0 and 1.0. If one "