mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
Moves the delta-based rounding function Verve used up into the engine so it wouldn't override the regular mRound function. Now is mRoundDelta.
This commit is contained in:
parent
b62ea8c701
commit
247c0eb34a
4 changed files with 14 additions and 14 deletions
|
|
@ -105,6 +105,17 @@ DefineEngineFunction( mRound, S32, ( F32 v ),,
|
|||
return mRound(v);
|
||||
}
|
||||
|
||||
DefineEngineFunction(mRoundDelta, S32, (F32 v, S32 d), (0.0, 1),
|
||||
"Round v to the nearest number based on the delta"
|
||||
"@param v Value to round"
|
||||
"@param d Delta use when rounding"
|
||||
"@return The rounded value as a S32."
|
||||
"@ingroup Math")
|
||||
{
|
||||
return (mFloor(v / d + 0.5) * d);
|
||||
}
|
||||
|
||||
|
||||
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"
|
||||
|
|
@ -412,4 +423,4 @@ DefineEngineFunction(mGetSignedAngleBetweenVectors, F32, (VectorF vecA, VectorF
|
|||
}
|
||||
|
||||
return MathUtils::getSignedAngleBetweenVectors(vecA, vecB, norm);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue