mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
round utility functions
add mRoundF to return nearest floating value to stepsize
This commit is contained in:
parent
f0e7a27c16
commit
f7ed077d82
4 changed files with 27 additions and 24 deletions
|
|
@ -103,6 +103,14 @@ DefineEngineFunction( mRound, S32, ( F32 v ),,
|
|||
"@ingroup Math" )
|
||||
{
|
||||
return mRound(v);
|
||||
|
||||
DefineEngineFunction(mRoundF, F32, (F32 v, F32 step), ,
|
||||
"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 F32."
|
||||
"@ingroup Math")
|
||||
{
|
||||
return mRoundF(v, step);
|
||||
}
|
||||
|
||||
DefineEngineFunction(mRoundDelta, S32, (F32 v, S32 d), (0.0, 1),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue