Static variables

@:value(1e-10)staticinlineread onlyEPSILON:Float = 1e-10

staticread onlyNEGATIVE_INFINITY:Float

staticread onlyNaN:Float

@:value(3.14159265358979323)staticinlineread onlyPI:Float = 3.14159265358979323

staticread onlyPOSITIVE_INFINITY:Float

Static methods

staticinlineabs(f:Float):Float

staticinlineacos(f:Float):Float

staticinlineangle(da:Float):Float

staticinlineangleLerp(a:Float, b:Float, k:Float):Float

staticinlineangleMove(a:Float, b:Float, max:Float):Float

Move angle a towards angle b with a max increment. Return the new angle.

staticinlineasin(f:Float):Float

staticinlineatan(f:Float):Float

staticinlineatan2(dy:Float, dx:Float):Float

staticinlineb2f(v:Int):Float

takes an int , masks it and devide so that it safely maps 0...255 to 0...1.0 @paramv an int between 0 and 255 will be masked

Returns:

a float between( 0 and 1)

staticinlinebitCount(v:Int):Int

staticinlineceil(f:Float):Int

@:value({ max : 1., min : 0. })staticinlineclamp(f:Float, min:Float = 0., max:Float = 1.):Float

staticcolorLerp(c1:Int, c2:Int, k:Float):Int

Linear interpolation between two colors (ARGB).

staticinlinecos(f:Float):Float

staticinlinedegToRad(deg:Float):Float

Convert degrees to radians

@:value({ dz : 0. })staticinlinedistance(dx:Float, dy:Float, dz:Float = 0.):Float

@:value({ dz : 0. })staticinlinedistanceSq(dx:Float, dy:Float, dz:Float = 0.):Float

staticinlinef2b(v:Float):Int

takes a float , clamps it and multipy so that it safely maps 0...1 to 0...255.0

Parameters:

f

a float

Returns:

an int [0...255]

staticinlinefloor(f:Float):Int

staticfmt(v:Float):Float

staticinlineiabs(i:Int):Int

staticinlineiclamp(v:Int, min:Int, max:Int):Int

staticinlineimax(a:Int, b:Int):Int

staticinlineimin(a:Int, b:Int):Int

staticinlineinvSqrt(f:Float):Float

staticinlineisNaN(v:Float):Bool

staticinlineisPOT(v:Int):Bool

staticinlinelerp(a:Float, b:Float, k:Float):Float

Linear interpolation between two values. When k is 0 a is returned, when it's 1, b is returned.

staticinlinelerpTime(a:Float, b:Float, k:Float, dt:Float):Float

Same as lerp but is scaled based on current FPS, using current elapsed time in seconds.

staticinlinemax(a:Float, b:Float):Float

staticinlinemin(a:Float, b:Float):Float

staticinlinenextPOT(v:Int):Int

staticinlinepow(v:Float, p:Float):Float

staticinlineradToDeg(rad:Float):Float

Convert radians to degrees

@:value({ max : 1.0 })staticinlinerandom(max:Float = 1.0):Float

staticinlineround(f:Float):Int

staticinlineshuffle<T>(a:Array<T>):Void

staticinlinesin(f:Float):Float

staticinlinesqrt(f:Float):Float

@:value({ max : 1.0 })staticsrand(max:Float = 1.0):Float

Returns a signed random between -max and max (both included).

staticinlinetan(f:Float):Float

staticinlineufmod(value:Float, modulo:Float):Float

returns the modulo but always positive

staticinlineumod(value:Int, modulo:Int):Int

returns the modulo but always positive

staticinlinevalueMove(v:Float, target:Float, max:Float):Float

Move a value towards the given target using the max increment. Return the new value.