Math

Integer operations

1
native func Max(a: Int32, b: Int32) -> Int32
2
native func Min(a: Int32, b: Int32) -> Int32
3
native func Abs(a: Int32) -> Int32
4
native func Clamp(v: Int32, min: Int32, max: Int32) -> Int32
5
func IsInRange(value: Int32, a: Int32, b: Int32) -> Bool
Copied!

Float operations

1
native func MaxF(a: Float, b: Float) -> Float
2
native func MinF(a: Float, b: Float) -> Float
3
native func AbsF(a: Float) -> Float
4
native func ClampF(v: Float, min: Float, max: Float) -> Float
5
native func RoundF(a: Float) -> Int32
6
func RoundMath(f: Float) -> Int32
7
func RoundTo(f: Float, decimal: Int32) -> Float
8
func IsInRange(value: Float, a: Float, b: Float) -> Bool
9
10
native func PowF(a: Float, x: Float) -> Float
11
native func LogF(a: Float) -> Float
12
native func ExpF(a: Float) -> Float
13
native func SqrtF(a: Float) -> Float
14
native func CeilF(a: Float) -> Int32
15
native func FloorF(a: Float) -> Int32
16
native func SinF(a: Float) -> Float
17
native func AsinF(a: Float) -> Float
18
native func CosF(a: Float) -> Float
19
native func AcosF(a: Float) -> Float
20
native func TanF(a: Float) -> Float
21
native func AtanF(a: Float, b: Float) -> Float
22
native func SqrF(a: Float) -> Float
23
native func LerpF(alpha: Float, a: Float, b: Float, opt clamp: Bool) -> Float
24
25
func Pi() -> Float
26
native func AngleNormalize(a: Float) -> Float
27
native func AngleDistance(target: Float, current: Float) -> Float
28
native func AngleApproach(target: Float, cur: Float, step: Float) -> Float
29
func LerpAngleF(alpha: Float, a: Float, b: Float) -> Float
30
native func Deg2Rad(deg: Float) -> Float
31
native func Rad2Deg(rad: Float) -> Float
Copied!
Last modified 2mo ago