Static methods

staticclamp(f:Float, min:Float, max:Float):Float

Clamps a float within some limits.

Returns:

same float, min or max if exceeded limits.

staticclampInt(f:Int, min:Int, max:Int):Int

Clamps an integer within some limits.

Returns:

same integer, min or max if exceeded limits.

staticinlinedegToRad(degrees:Float):Float

Converts an angle in degrees to radians.

Returns:

angle in radians

staticgetAngle(va:Vec4, vb:Vec4):Float

Returns angle in radians between 2 vectors perpendicular to the z axis.

staticinlinelog2(v:Float):Float

Return the base-2 logarithm of a number.

staticinlinemap(value:Float, leftMin:Float, leftMax:Float, rightMin:Float, rightMax:Float):Float

Convenience function to map a variable from one coordinate space to another. Equivalent to unlerp() followed by lerp().

Parameters:

value
leftMin

The lower bound of the input coordinate space

leftMax

The higher bound of the input coordinate space

rightMin

The lower bound of the output coordinate space

rightMax

The higher bound of the output coordinate space

Returns:

Float

staticinlinemapClamped(value:Float, leftMin:Float, leftMax:Float, rightMin:Float, rightMax:Float):Float

staticinlinemapInt(value:Int, leftMin:Int, leftMax:Int, rightMin:Int, rightMax:Int):Int

staticmoveTowards(current:Vec4, target:Vec4, delta:FastFloat):Vec4

Returns a copy of the current vector summed by delta towards the target vector without passing it.

staticinlineradToDeg(radians:Float):Float

Converts an angle in radians to degrees.

Returns:

angle in degrees

@:value({ precision : 2 })staticroundfp(f:Float, precision:Int = 2):Float

Rounds the precision of a float (default 2).

Returns:

float with rounded precision

staticinlinesign(value:Float):Float

Return the sign of the given value represented as 1.0 (positive value) or -1.0 (negative value). The sign of 0 is 0.