mConsoleFunctions.cpp
Engine/source/math/mConsoleFunctions.cpp
Public Functions
DefineEngineFunction(getMax , F32 , (F32 v1, F32 v2) , "Calculate the greater of two specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">numbers.\n</a>" "@param v1 <a href="/coding/class/classinput/">Input</a> value." "@param v2 <a href="/coding/class/classinput/">Input</a> value." "@returns The greater <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of the two specified values." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(getMin , F32 , (F32 v1, F32 v2) , "Calculate the lesser of two specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">numbers.\n</a>" "@param v1 <a href="/coding/class/classinput/">Input</a> value." "@param v2 <a href="/coding/class/classinput/">Input</a> value." "@returns The lesser <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of the two specified values." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(m2Pi , F32 , () , "Return the <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of 2*PI (full-circle in radians).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@returns The <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of 2*PI." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mAbs , F32 , (F32 v) , "Calculate absolute <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">value.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> Value." "@returns Absolute <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of specified value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mAcos , F32 , (F32 v) , "Calculate the arc-cosine of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">v.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> (in radians)." "@returns The arc-cosine of the input value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mAsin , F32 , (F32 v) , "Calculate the arc-sine of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">v.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> (in radians)." "@returns The arc-sine of the input value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mAtan , F32 , (F32 rise, F32 run) , "Calculate the arc-tangent (slope) of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> line defined by rise and <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">run.\n</a>" "@param rise of line." "@param run of line." "@returns The arc-tangent (slope) of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> line defined by rise and run." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mCeil , S32 , (F32 v) , "Round v up <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the nearest <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">integer.\n</a>" "@param v Number <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/colladautils_8h/#colladautils_8h_1a24cd315eae41894b5bbf77c8c0b097d4">convert</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> integer." "@returns Number converted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> integer." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mClamp , F32 , (F32 v, F32 min, F32 max) , "Clamp the specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> between two <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">bounds.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> value." "@param min Minimum Bound." "@param max Maximum Bound." "@returns The specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> clamped <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the specified bounds." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mCos , F32 , (F32 v) , "Calculate the cosine of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">v.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> (in radians)." "@returns The cosine of the input value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mDegToRad , F32 , (F32 degrees) , "Convert specified degrees into <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">radians.\n</a>" "@param degrees <a href="/coding/class/classinput/">Input</a> <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> (in degrees)." "@returns The specified degrees <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> converted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> radians." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mFloatLength , const char * , (F32 v, U32 precision) , "Formats the specified number <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the given number of decimal <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">places.\n</a>" "@param v Number <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> format." "@param precision Number of decimal places <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> format <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> (1-9)." "@returns Number formatted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the specified number of decimal places." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mFloor , S32 , (F32 v) , "Round v down <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the nearest <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">integer.\n</a>" "@param v Number <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/colladautils_8h/#colladautils_8h_1a24cd315eae41894b5bbf77c8c0b097d4">convert</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> integer." "@returns Number converted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> integer." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mFMod , F32 , (F32 v, F32 d) , "Calculate the remainder of v/<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">d.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> Value." "@param d Divisor Value." "@returns The remainder of v/d." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mGetAngleBetweenVectors , F32 , (VectorF vecA, VectorF vecB) , "Returns angle between two <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vectors.\n</a>" "@param vecA First input vector." "@param vecB Second input vector." "@returns Angle between both vectors in radians." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mGetSignedAngleBetweenVectors , F32 , (VectorF vecA, VectorF vecB, VectorF norm) , (VectorF::Zero, VectorF::Zero, VectorF::Zero) , "Returns signed angle between two vectors, using <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> normal <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">orientation.\n</a>" " @param vecA First input vector." " @param vecB Second input vector." " @param norm Normal/Cross Product vector." " @returns Angle between both vectors in radians." " @ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mIsPow2 , bool , (S32 v) , "Returns whether the <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> is an exact power of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">two.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> value." "@returns Whether the specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> is an exact power of two." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mLerp , F32 , (F32 v1, F32 v2, F32 time) , "Calculate linearly interpolated <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> between two specified numbers using specified normalized <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">time.\n</a>" "@param v1 Interpolate From <a href="/coding/class/classinput/">Input</a> value." "@param v2 Interpolate To <a href="/coding/class/classinput/">Input</a> value." "@param time Normalized time used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> interpolate values (0-1)." "@returns The interpolated <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> between the two specified values at normalized time t." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mLog , F32 , (F32 v) , "Calculate the natural logarithm of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">v.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> Value." "@returns The natural logarithm of the input value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mPi , F32 , () , "Return the <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of PI (half-circle in radians).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@returns The <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of PI." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mPow , F32 , (F32 v, F32 p) , "Calculate <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a91b64995742fd30063314f12340b4b5a">b</a> raised <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the p-th <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">power.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> Value." "@param p Power <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> raise <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> by." "@returns v raised <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the p-th power." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mRadToDeg , F32 , (F32 radians) , "Convert specified radians into <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">degrees.\n</a>" "@param radians <a href="/coding/class/classinput/">Input</a> <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> (in radians)." "@returns The specified radians <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> converted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> degrees." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mRandomDir , Point3F , (Point3F axis, F32 angleMin, F32 angleMax) , "Returns <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> randomized direction based on <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> starting axis and the min/max <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">angles.\n</a>" "@param axis Main axis <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> deviate the direction from." "@param angleMin minimum amount of deviation from the axis." "@param angleMax maximum amount of deviation from the axis." "@returns Randomized direction vector." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mRandomPointInSphere , Point3F , (F32 radius) , "Returns <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> randomized point inside <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> sphere of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> given <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">radius.\n</a>" "@param radius The radius of the sphere <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> find <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> point in." "@returns Randomized point inside <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> sphere." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mRound , S32 , (F32 v) , "Round v <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the nth decimal place or the nearest whole number by default." "@param v <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> roundn" "@return The rounded <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> S32." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mRoundColour , F32 , (F32 v, S32 n) , (0) , "Round v <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the nth decimal place or the nearest whole number by default." "@param v <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> roundn" "@param <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a> Number of decimal places <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> round to, 0 by defaultn" " @return The rounded <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> S32." " @ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mRoundDelta , S32 , (F32 v, S32 d) , (0.0, 1) , "Round v <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the nearest number based on the delta" "@param v <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> round" "@param d Delta use when rounding" "@return The rounded <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> S32." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mSaturate , F32 , (F32 v) , "Clamp the specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> between 0 and 1 (inclusive).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param v <a href="/coding/class/classinput/">Input</a> value." "@returns The specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> clamped between 0 and 1 (inclusive)." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mSin , F32 , (F32 v) , "Calculate the sine of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">v.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> (in radians)." "@returns The sine of the input value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mSolveCubic , const char * , (F32 a, F32 b, F32 c, F32 d) , "Solve <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> cubic equation (3rd degree polynomial) of form <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a>*x^3 + <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a91b64995742fd30063314f12340b4b5a">b</a>*x^2 + c*x + d, containing:(sol x0 x1 x2).(sol) is the number of solutions" "(being 0, 1, 2 or 3) , and(x0) , (x1) and(x2) are the solutions, <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any." " @ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mSolveQuadratic , const char * , (F32 a, F32 b, F32 c) , "Solve <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> quadratic equation (2nd degree polynomial) of form <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a>*x^2 + <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a91b64995742fd30063314f12340b4b5a">b</a>*x + c, containing:(sol x0 x1).(sol) is the number of solutions" "(being 0, 1, or 2) , and(x0) and(x1) are the solutions, <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any." " @ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mSolveQuartic , const char * , (F32 a, F32 b, F32 c, F32 d, F32 e) , "Solve <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> quartic equation (4th degree polynomial) of form <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a>*x^4 + <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a91b64995742fd30063314f12340b4b5a">b</a>*x^3 + c*x^2 + d*x + e, containing:(sol x0 x1 x2 c3).(sol) is the number of solutions" "(being 0, 1, 2, 3 or 4) , and(x0) , (x1) , (x2) and(x3) are the solutions, <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any." " @ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mSqrt , F32 , (F32 v) , "Calculate the square-root of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">v.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> Value." "@returns The square-root of the input value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mTan , F32 , (F32 v) , "Calculate the tangent of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">v.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> (in radians)." "@returns The tangent of the input value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mWrap , S32 , (S32 v, S32 min, S32 max) , "Wrap the specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> between two <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">bounds.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> value." "@param min Minimum Bound." "@param max Maximum Bound." "@returns The specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> wrapped <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the specified bounds." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mWrapF , F32 , (F32 v, F32 min, F32 max) , "Wrap the specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> between two <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">bounds.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> value." "@param min Minimum Bound." "@param max Maximum Bound." "@returns The specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> wrapped <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the specified bounds." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
Detailed Description
Public Functions
DefineEngineFunction(getMax , F32 , (F32 v1, F32 v2) , "Calculate the greater of two specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">numbers.\n</a>" "@param v1 <a href="/coding/class/classinput/">Input</a> value." "@param v2 <a href="/coding/class/classinput/">Input</a> value." "@returns The greater <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of the two specified values." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(getMin , F32 , (F32 v1, F32 v2) , "Calculate the lesser of two specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">numbers.\n</a>" "@param v1 <a href="/coding/class/classinput/">Input</a> value." "@param v2 <a href="/coding/class/classinput/">Input</a> value." "@returns The lesser <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of the two specified values." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(m2Pi , F32 , () , "Return the <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of 2*PI (full-circle in radians).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@returns The <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of 2*PI." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mAbs , F32 , (F32 v) , "Calculate absolute <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">value.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> Value." "@returns Absolute <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of specified value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mAcos , F32 , (F32 v) , "Calculate the arc-cosine of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">v.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> (in radians)." "@returns The arc-cosine of the input value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mAsin , F32 , (F32 v) , "Calculate the arc-sine of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">v.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> (in radians)." "@returns The arc-sine of the input value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mAtan , F32 , (F32 rise, F32 run) , "Calculate the arc-tangent (slope) of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> line defined by rise and <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">run.\n</a>" "@param rise of line." "@param run of line." "@returns The arc-tangent (slope) of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> line defined by rise and run." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mCeil , S32 , (F32 v) , "Round v up <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the nearest <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">integer.\n</a>" "@param v Number <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/colladautils_8h/#colladautils_8h_1a24cd315eae41894b5bbf77c8c0b097d4">convert</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> integer." "@returns Number converted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> integer." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mClamp , F32 , (F32 v, F32 min, F32 max) , "Clamp the specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> between two <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">bounds.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> value." "@param min Minimum Bound." "@param max Maximum Bound." "@returns The specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> clamped <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the specified bounds." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mCos , F32 , (F32 v) , "Calculate the cosine of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">v.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> (in radians)." "@returns The cosine of the input value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mDegToRad , F32 , (F32 degrees) , "Convert specified degrees into <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">radians.\n</a>" "@param degrees <a href="/coding/class/classinput/">Input</a> <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> (in degrees)." "@returns The specified degrees <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> converted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> radians." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mFloatLength , const char * , (F32 v, U32 precision) , "Formats the specified number <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the given number of decimal <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">places.\n</a>" "@param v Number <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> format." "@param precision Number of decimal places <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> format <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> (1-9)." "@returns Number formatted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the specified number of decimal places." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mFloor , S32 , (F32 v) , "Round v down <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the nearest <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">integer.\n</a>" "@param v Number <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/colladautils_8h/#colladautils_8h_1a24cd315eae41894b5bbf77c8c0b097d4">convert</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> integer." "@returns Number converted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> integer." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mFMod , F32 , (F32 v, F32 d) , "Calculate the remainder of v/<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">d.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> Value." "@param d Divisor Value." "@returns The remainder of v/d." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mGetAngleBetweenVectors , F32 , (VectorF vecA, VectorF vecB) , "Returns angle between two <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">vectors.\n</a>" "@param vecA First input vector." "@param vecB Second input vector." "@returns Angle between both vectors in radians." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mGetSignedAngleBetweenVectors , F32 , (VectorF vecA, VectorF vecB, VectorF norm) , (VectorF::Zero, VectorF::Zero, VectorF::Zero) , "Returns signed angle between two vectors, using <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> normal <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">orientation.\n</a>" " @param vecA First input vector." " @param vecB Second input vector." " @param norm Normal/Cross Product vector." " @returns Angle between both vectors in radians." " @ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mIsPow2 , bool , (S32 v) , "Returns whether the <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> is an exact power of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">two.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> value." "@returns Whether the specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> is an exact power of two." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mLerp , F32 , (F32 v1, F32 v2, F32 time) , "Calculate linearly interpolated <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> between two specified numbers using specified normalized <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">time.\n</a>" "@param v1 Interpolate From <a href="/coding/class/classinput/">Input</a> value." "@param v2 Interpolate To <a href="/coding/class/classinput/">Input</a> value." "@param time Normalized time used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> interpolate values (0-1)." "@returns The interpolated <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> between the two specified values at normalized time t." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mLog , F32 , (F32 v) , "Calculate the natural logarithm of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">v.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> Value." "@returns The natural logarithm of the input value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mPi , F32 , () , "Return the <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of PI (half-circle in radians).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@returns The <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of PI." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mPow , F32 , (F32 v, F32 p) , "Calculate <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a91b64995742fd30063314f12340b4b5a">b</a> raised <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the p-th <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">power.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> Value." "@param p Power <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> raise <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> by." "@returns v raised <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the p-th power." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mRadToDeg , F32 , (F32 radians) , "Convert specified radians into <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">degrees.\n</a>" "@param radians <a href="/coding/class/classinput/">Input</a> <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> (in radians)." "@returns The specified radians <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> converted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> degrees." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mRandomDir , Point3F , (Point3F axis, F32 angleMin, F32 angleMax) , "Returns <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> randomized direction based on <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> starting axis and the min/max <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">angles.\n</a>" "@param axis Main axis <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> deviate the direction from." "@param angleMin minimum amount of deviation from the axis." "@param angleMax maximum amount of deviation from the axis." "@returns Randomized direction vector." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mRandomPointInSphere , Point3F , (F32 radius) , "Returns <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> randomized point inside <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> sphere of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> given <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">radius.\n</a>" "@param radius The radius of the sphere <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> find <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> point in." "@returns Randomized point inside <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> sphere." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mRound , S32 , (F32 v) , "Round v <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the nth decimal place or the nearest whole number by default." "@param v <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> roundn" "@return The rounded <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> S32." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mRoundColour , F32 , (F32 v, S32 n) , (0) , "Round v <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the nth decimal place or the nearest whole number by default." "@param v <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> roundn" "@param <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a> Number of decimal places <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> round to, 0 by defaultn" " @return The rounded <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> S32." " @ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mRoundDelta , S32 , (F32 v, S32 d) , (0.0, 1) , "Round v <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the nearest number based on the delta" "@param v <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> round" "@param d Delta use when rounding" "@return The rounded <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> S32." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mSaturate , F32 , (F32 v) , "Clamp the specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> between 0 and 1 (inclusive).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param v <a href="/coding/class/classinput/">Input</a> value." "@returns The specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> clamped between 0 and 1 (inclusive)." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mSin , F32 , (F32 v) , "Calculate the sine of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">v.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> (in radians)." "@returns The sine of the input value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mSolveCubic , const char * , (F32 a, F32 b, F32 c, F32 d) , "Solve <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> cubic equation (3rd degree polynomial) of form <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a>*x^3 + <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a91b64995742fd30063314f12340b4b5a">b</a>*x^2 + c*x + d, containing:(sol x0 x1 x2).(sol) is the number of solutions" "(being 0, 1, 2 or 3) , and(x0) , (x1) and(x2) are the solutions, <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any." " @ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mSolveQuadratic , const char * , (F32 a, F32 b, F32 c) , "Solve <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> quadratic equation (2nd degree polynomial) of form <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a>*x^2 + <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a91b64995742fd30063314f12340b4b5a">b</a>*x + c, containing:(sol x0 x1).(sol) is the number of solutions" "(being 0, 1, or 2) , and(x0) and(x1) are the solutions, <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any." " @ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mSolveQuartic , const char * , (F32 a, F32 b, F32 c, F32 d, F32 e) , "Solve <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> quartic equation (4th degree polynomial) of form <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a>*x^4 + <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a91b64995742fd30063314f12340b4b5a">b</a>*x^3 + c*x^2 + d*x + e, containing:(sol x0 x1 x2 c3).(sol) is the number of solutions" "(being 0, 1, 2, 3 or 4) , and(x0) , (x1) , (x2) and(x3) are the solutions, <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any." " @ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mSqrt , F32 , (F32 v) , "Calculate the square-root of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">v.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> Value." "@returns The square-root of the input value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mTan , F32 , (F32 v) , "Calculate the tangent of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">v.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> <a href="/coding/file/document_8h/#document_8h_1a071cf97155ba72ac9a1fc4ad7e63d481">Value</a> (in radians)." "@returns The tangent of the input value." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mWrap , S32 , (S32 v, S32 min, S32 max) , "Wrap the specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> between two <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">bounds.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> value." "@param min Minimum Bound." "@param max Maximum Bound." "@returns The specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> wrapped <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the specified bounds." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
DefineEngineFunction(mWrapF , F32 , (F32 v, F32 min, F32 max) , "Wrap the specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> between two <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">bounds.\n</a>" "@param v <a href="/coding/class/classinput/">Input</a> value." "@param min Minimum Bound." "@param max Maximum Bound." "@returns The specified <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> wrapped <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the specified bounds." "@ingroup <a href="/coding/class/structmath/">Math</a>" )
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#include "core/strings/stringFunctions.h" 25 26#include "console/console.h" 27#include "math/mMathFn.h" 28#include "math/mRandom.h" 29#include "math/mMath.h" 30#include "math/mathUtils.h" 31 32#include "console/engineAPI.h" 33 34 35DefineEngineFunction( mSolveQuadratic, const char*, ( F32 a, F32 b, F32 c ),, 36 "Solve a quadratic equation (2nd degree polynomial) of form a*x^2 + b*x + c = 0.\n" 37 "@param a First Coefficient." 38 "@param b Second Coefficient." 39 "@param c Third Coefficient." 40 "@returns A triple, containing: (sol x0 x1). (sol) is the number of solutions" 41 "(being 0, 1, or 2), and (x0) and (x1) are the solutions, if any." 42 "@ingroup Math" ) 43{ 44 F32 x[2]; 45 U32 sol = mSolveQuadratic( a, b, c, x ); 46 47 static const U32 bufSize = 256; 48 char * retBuffer = Con::getReturnBuffer(bufSize); 49 dSprintf(retBuffer, bufSize, "%d %g %g", sol, x[0], x[1]); 50 return retBuffer; 51} 52 53DefineEngineFunction( mSolveCubic, const char*, ( F32 a, F32 b, F32 c, F32 d ),, 54 "Solve a cubic equation (3rd degree polynomial) of form a*x^3 + b*x^2 + c*x + d = 0.\n" 55 "@param a First Coefficient." 56 "@param b Second Coefficient." 57 "@param c Third Coefficient." 58 "@param d Fourth Coefficient." 59 "@returns A 4-tuple, containing: (sol x0 x1 x2). (sol) is the number of solutions" 60 "(being 0, 1, 2 or 3), and (x0), (x1) and (x2) are the solutions, if any." 61 "@ingroup Math" ) 62{ 63 F32 x[3]; 64 U32 sol = mSolveCubic( a, b, c, d, x ); 65 66 static const U32 bufSize = 256; 67 char * retBuffer = Con::getReturnBuffer(bufSize); 68 dSprintf(retBuffer, bufSize, "%d %g %g %g", sol, x[0], x[1], x[2]); 69 return retBuffer; 70} 71 72DefineEngineFunction( mSolveQuartic, const char*, ( F32 a, F32 b, F32 c, F32 d, F32 e ),, 73 "Solve a quartic equation (4th degree polynomial) of form a*x^4 + b*x^3 + c*x^2 + d*x + e = 0.\n" 74 "@param a First Coefficient." 75 "@param b Second Coefficient." 76 "@param c Third Coefficient." 77 "@param d Fourth Coefficient." 78 "@param e Fifth Coefficient." 79 "@returns A 5-tuple, containing: (sol x0 x1 x2 c3). (sol) is the number of solutions" 80 "(being 0, 1, 2, 3 or 4), and (x0), (x1), (x2) and (x3) are the solutions, if any." 81 "@ingroup Math" ) 82{ 83 F32 x[4]; 84 static const U32 bufSize = 256; 85 char * retBuffer = Con::getReturnBuffer(bufSize); 86 U32 sol = mSolveQuartic(a, b, c, d, e, x); 87 dSprintf(retBuffer, bufSize, "%d %g %g %g %g", sol, x[0], x[1], x[2], x[3]); 88 return retBuffer; 89} 90 91DefineEngineFunction( mFloor, S32, ( F32 v ),, 92 "Round v down to the nearest integer.\n" 93 "@param v Number to convert to integer." 94 "@returns Number converted to integer." 95 "@ingroup Math" ) 96{ 97 return (S32)mFloor( v ); 98} 99 100DefineEngineFunction( mRound, S32, ( F32 v ),, 101 "Round v to the nth decimal place or the nearest whole number by default." 102 "@param v Value to roundn" 103 "@return The rounded value as a S32." 104 "@ingroup Math" ) 105{ 106 return mRound(v); 107} 108 109DefineEngineFunction(mRoundDelta, S32, (F32 v, S32 d), (0.0, 1), 110 "Round v to the nearest number based on the delta" 111 "@param v Value to round" 112 "@param d Delta use when rounding" 113 "@return The rounded value as a S32." 114 "@ingroup Math") 115{ 116 return (mFloor(v / d + 0.5) * d); 117} 118 119 120DefineEngineFunction( mRoundColour, F32, ( F32 v, S32 n ), (0), 121 "Round v to the nth decimal place or the nearest whole number by default." 122 "@param v Value to roundn" 123 "@param n Number of decimal places to round to, 0 by defaultn" 124 "@return The rounded value as a S32." 125 "@ingroup Math") 126{ 127 if (n <= 0) 128 return mRound(v); 129 else 130 return mRound(v, n); 131} 132 133DefineEngineFunction( mCeil, S32, ( F32 v ),, 134 "Round v up to the nearest integer.\n" 135 "@param v Number to convert to integer." 136 "@returns Number converted to integer." 137 "@ingroup Math" ) 138{ 139 return (S32)mCeil( v ); 140} 141 142DefineEngineFunction( mFloatLength, const char*, ( F32 v, U32 precision ),, 143 "Formats the specified number to the given number of decimal places.\n" 144 "@param v Number to format." 145 "@param precision Number of decimal places to format to (1-9)." 146 "@returns Number formatted to the specified number of decimal places." 147 "@ingroup Math" ) 148{ 149 char fmtString[8] = "%.9f"; 150 151 if (precision >= 9) 152 precision = 9; 153 fmtString[2] = '0' + precision; 154 155 static const U32 bufSize = 256; 156 char * outBuffer = Con::getReturnBuffer(bufSize); 157 dSprintf(outBuffer, bufSize, fmtString, v); 158 return outBuffer; 159} 160 161//------------------------------------------------------------------------------ 162 163DefineEngineFunction( mAbs, F32, ( F32 v ),, 164 "Calculate absolute value of specified value.\n" 165 "@param v Input Value." 166 "@returns Absolute value of specified value." 167 "@ingroup Math" ) 168{ 169 return mFabs( v ); 170} 171 172DefineEngineFunction( mFMod, F32, ( F32 v, F32 d ),, 173 "Calculate the remainder of v/d.\n" 174 "@param v Input Value." 175 "@param d Divisor Value." 176 "@returns The remainder of v/d." 177 "@ingroup Math" ) 178{ 179 return mFmod( v, d ); 180} 181 182DefineEngineFunction( mSqrt, F32, ( F32 v ),, 183 "Calculate the square-root of v.\n" 184 "@param v Input Value." 185 "@returns The square-root of the input value." 186 "@ingroup Math" ) 187{ 188 return mSqrt (v ); 189} 190 191DefineEngineFunction( mPow, F32, ( F32 v, F32 p ),, 192 "Calculate b raised to the p-th power.\n" 193 "@param v Input Value." 194 "@param p Power to raise value by." 195 "@returns v raised to the p-th power." 196 "@ingroup Math" ) 197{ 198 return mPow( v, p ); 199} 200 201DefineEngineFunction( mLog, F32, ( F32 v ),, 202 "Calculate the natural logarithm of v.\n" 203 "@param v Input Value." 204 "@returns The natural logarithm of the input value." 205 "@ingroup Math" ) 206{ 207 return mLog( v ); 208} 209 210DefineEngineFunction( mSin, F32, ( F32 v ),, 211 "Calculate the sine of v.\n" 212 "@param v Input Value (in radians)." 213 "@returns The sine of the input value." 214 "@ingroup Math" ) 215{ 216 return mSin( v ); 217} 218 219DefineEngineFunction( mCos, F32, ( F32 v ),, 220 "Calculate the cosine of v.\n" 221 "@param v Input Value (in radians)." 222 "@returns The cosine of the input value." 223 "@ingroup Math" ) 224{ 225 return mCos( v ); 226} 227 228DefineEngineFunction( mTan, F32, ( F32 v ),, 229 "Calculate the tangent of v.\n" 230 "@param v Input Value (in radians)." 231 "@returns The tangent of the input value." 232 "@ingroup Math" ) 233{ 234 return mTan( v ); 235} 236 237DefineEngineFunction( mAsin, F32, ( F32 v ),, 238 "Calculate the arc-sine of v.\n" 239 "@param v Input Value (in radians)." 240 "@returns The arc-sine of the input value." 241 "@ingroup Math" ) 242{ 243 return mAsin( v ); 244} 245 246DefineEngineFunction( mAcos, F32, ( F32 v ),, 247 "Calculate the arc-cosine of v.\n" 248 "@param v Input Value (in radians)." 249 "@returns The arc-cosine of the input value." 250 "@ingroup Math" ) 251{ 252 return mAcos( v ); 253} 254 255DefineEngineFunction( mAtan, F32, ( F32 rise, F32 run ),, 256 "Calculate the arc-tangent (slope) of a line defined by rise and run.\n" 257 "@param rise of line." 258 "@param run of line." 259 "@returns The arc-tangent (slope) of a line defined by rise and run." 260 "@ingroup Math" ) 261{ 262 return mAtan2( rise, run ); 263} 264 265DefineEngineFunction( mRadToDeg, F32, ( F32 radians ),, 266 "Convert specified radians into degrees.\n" 267 "@param radians Input Value (in radians)." 268 "@returns The specified radians value converted to degrees." 269 "@ingroup Math" ) 270{ 271 return mRadToDeg( radians ); 272} 273 274DefineEngineFunction( mDegToRad, F32, ( F32 degrees ),, 275 "Convert specified degrees into radians.\n" 276 "@param degrees Input Value (in degrees)." 277 "@returns The specified degrees value converted to radians." 278 "@ingroup Math" ) 279{ 280 return mDegToRad( degrees ); 281} 282 283DefineEngineFunction( mClamp, F32, ( F32 v, F32 min, F32 max ),, 284 "Clamp the specified value between two bounds.\n" 285 "@param v Input value." 286 "@param min Minimum Bound." 287 "@param max Maximum Bound." 288 "@returns The specified value clamped to the specified bounds." 289 "@ingroup Math" ) 290{ 291 return mClampF( v, min, max ); 292} 293 294DefineEngineFunction( mSaturate, F32, ( F32 v ),, 295 "Clamp the specified value between 0 and 1 (inclusive).\n" 296 "@param v Input value." 297 "@returns The specified value clamped between 0 and 1 (inclusive)." 298 "@ingroup Math" ) 299{ 300 return mClampF( v, 0.0f, 1.0f ); 301} 302 303DefineEngineFunction(mWrapF, F32, (F32 v, F32 min, F32 max), , 304 "Wrap the specified value between two bounds.\n" 305 "@param v Input value." 306 "@param min Minimum Bound." 307 "@param max Maximum Bound." 308 "@returns The specified value wrapped to the specified bounds." 309 "@ingroup Math") 310{ 311 return mWrapF(v, min, max); 312} 313 314DefineEngineFunction(mWrap, S32, (S32 v, S32 min, S32 max), , 315 "Wrap the specified value between two bounds.\n" 316 "@param v Input value." 317 "@param min Minimum Bound." 318 "@param max Maximum Bound." 319 "@returns The specified value wrapped to the specified bounds." 320 "@ingroup Math") 321{ 322 return mWrap(v, min, max); 323} 324 325 326DefineEngineFunction( getMax, F32, ( F32 v1, F32 v2 ),, 327 "Calculate the greater of two specified numbers.\n" 328 "@param v1 Input value." 329 "@param v2 Input value." 330 "@returns The greater value of the two specified values." 331 "@ingroup Math" ) 332{ 333 return getMax( v1, v2 ); 334} 335 336DefineEngineFunction( getMin, F32, ( F32 v1, F32 v2 ),, 337 "Calculate the lesser of two specified numbers.\n" 338 "@param v1 Input value." 339 "@param v2 Input value." 340 "@returns The lesser value of the two specified values." 341 "@ingroup Math" ) 342{ 343 return getMin( v1, v2 ); 344} 345 346DefineEngineFunction( mLerp, F32, ( F32 v1, F32 v2, F32 time ),, 347 "Calculate linearly interpolated value between two specified numbers using specified normalized time.\n" 348 "@param v1 Interpolate From Input value." 349 "@param v2 Interpolate To Input value." 350 "@param time Normalized time used to interpolate values (0-1)." 351 "@returns The interpolated value between the two specified values at normalized time t." 352 "@ingroup Math" ) 353{ 354 return mLerp( v1, v2, time ); 355} 356 357DefineEngineFunction( mPi, F32, (),, 358 "Return the value of PI (half-circle in radians).\n" 359 "@returns The value of PI." 360 "@ingroup Math" ) 361{ 362 return M_PI_F; 363} 364 365DefineEngineFunction( m2Pi, F32, (),, 366 "Return the value of 2*PI (full-circle in radians).\n" 367 "@returns The value of 2*PI." 368 "@ingroup Math" ) 369{ 370 return M_2PI_F; 371} 372 373DefineEngineFunction( mIsPow2, bool, ( S32 v ),, 374 "Returns whether the value is an exact power of two.\n" 375 "@param v Input value." 376 "@returns Whether the specified value is an exact power of two." 377 "@ingroup Math" ) 378{ 379 return isPow2( v ); 380} 381 382DefineEngineFunction( mRandomDir, Point3F, (Point3F axis, F32 angleMin, F32 angleMax),, 383 "Returns a randomized direction based on a starting axis and the min/max angles.\n" 384 "@param axis Main axis to deviate the direction from." 385 "@param angleMin minimum amount of deviation from the axis." 386 "@param angleMax maximum amount of deviation from the axis." 387 "@returns Randomized direction vector." 388 "@ingroup Math") 389{ 390 return MathUtils::randomDir(axis, angleMin, angleMax); 391} 392 393DefineEngineFunction( mRandomPointInSphere, Point3F, (F32 radius), , 394 "Returns a randomized point inside a sphere of a given radius.\n" 395 "@param radius The radius of the sphere to find a point in." 396 "@returns Randomized point inside a sphere." 397 "@ingroup Math") 398{ 399 return MathUtils::randomPointInSphere(radius); 400} 401 402DefineEngineFunction( mGetAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB), , 403 "Returns angle between two vectors.\n" 404 "@param vecA First input vector." 405 "@param vecB Second input vector." 406 "@returns Angle between both vectors in radians." 407 "@ingroup Math") 408{ 409 return MathUtils::getAngleBetweenVectors(vecA, vecB); 410} 411 412DefineEngineFunction(mGetSignedAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB, VectorF norm), (VectorF::Zero, VectorF::Zero, VectorF::Zero), 413 "Returns signed angle between two vectors, using a normal for orientation.\n" 414 "@param vecA First input vector." 415 "@param vecB Second input vector." 416 "@param norm Normal/Cross Product vector." 417 "@returns Angle between both vectors in radians." 418 "@ingroup Math") 419{ 420 if (vecA.isZero() || vecB.isZero() || norm.isZero()) 421 { 422 Con::errorf("mGetSignedAngleBetweenVectors - Error! Requires all 3 vectors used to be non-zero!"); 423 return 0; 424 } 425 426 return MathUtils::getSignedAngleBetweenVectors(vecA, vecB, norm); 427} 428