rigz.math: | Functions | Modinfo | Source |
AngleDifference | Get the difference between 2 angles. |
GetDirection | get the direction from 1 point to another. |
GetDistance | The distance between 1 point and another. |
GetNearestPowerOf2 | Round up to the nearest power of 2. |
GetTexSize | Gets the texture size needed for an animation with a given size and number of frames. |
Round | rounds a number to the nearest int. |
TweenValues | Interpolate between 2 values. |
Function AngleDifference:Float(Angle1:Float, Angle2:Float) | |
Description | Get the difference between 2 angles. |
Function GetDirection:Float(fromx:Float, fromy:Float, tox:Float, toy:Float) | |
Returns | Angle of difference. |
Description | get the direction from 1 point to another. |
Information | Thanks to "Snarkbait" for this little code snippit. |
Function GetDistance:Float(fromx:Float, fromy:Float, tox:Float, toy:Float, fast:Int = False) | |
Returns | The distance between the 2 points. |
Description | The distance between 1 point and another. |
Function GetNearestPowerOf2:Int(n:Int) | |
Description | Round up to the nearest power of 2. |
Function GetTexSize(w:Int, h:Int, frames:Int, powersof2:Int = True, texwidth:Int Var, texheight:Int Var, Cols:Int Var, rows:Int Var) | |
Returns | the texture width and height, along with the number of columns and rows of animation frames. |
Description | Gets the texture size needed for an animation with a given size and number of frames. |
Information | this function will ensure that the texture width and height remain in powers of 2. |
Function Round:Int(v:Double) | |
Returns | Rounded Int. |
Description | rounds a number to the nearest int. |
Function TweenValues:Float(oldValue:Float, value:Float, tween:Float) | |
Description | Interpolate between 2 values. |
Information | This is the function used to achieve render tweening by taking the old and new values and interpolating between the 2. |
Author | Peter J. Rigby |
---|---|
Copyright | Peter J. Rigby 2009 |
Purpose | A General Math Module |
Version | v1 |