Convert value to be next higher multiple of base value.
API ulong Snap(ulong value, uint base);
n: Value.
base: Base value. Must be a power of 2.
returns: Power of 2 number.
Get next power of 2 shift value above value.
API uint P2(ulong value);
value: Value.
returns: Shift value.
Restrict float to range, inclusive.
API float FClamp(float n, float low, float high);
n: Float value.
low: Low limit.
high: High limit.
returns: Clamped float.
Restrict integer to range inclusive.
API int IClamp(int n, int low, int high);
n: Integer value.
low: Low limit.
high: High limit.
returns: Clamped integer.
Reflect float off end of range.
API float FBounce(float n, float low, float high);
n: Float value.
low: Low limit.
high: High limit.
returns: Bounced float.
Reflect integer off end of range.
API int IBounce(int n, int low, int high);
n: Integer value.
low: Low limit.
high: High limit.
returns: Bounced integer.
Wrap float around range.
API float FWrap(float n, float low, float high);
n: Float value.
low: Low limit.
high: High limit.
returns: Wrapped float.
Wrap integer around range.
API int IWrap(int n, int low, int high);
n: Integer value.
low: Low limit.
high: High limit.
returns: Wrapped integer.
Convert float value to normalized value using range.
API float Normalize(float n, float low, float high);
n: Float value.
low: Low limit.
high: High limit.
returns: Normalized Float value.
Ensures angle is within 0..1.
API float NormAngle(float angle);
angle: .
returns: Renormalized angle.
Get angular difference between input angles.
API float AngleDelta(float a, float b);
a: First angle.
b: Second angle.
returns: Angular difference.
Convert radian angle to normalized angle.
API float RadToNA(float radians);
radians: Angle in radians.
returns: Normalized angle.
Convert normalized angle to radian angle
API float NAToRad(float angle);
angle: Normalized angle.
returns: Angle in radians.
Get the minimum value of input floats.
API float FMin(float a, float b);
a: First float.
b: Second float.
returns: Minimum float value.
Get the minimum value of input integers.
API int IMin(int a, int b);
a: First integer.
b: Second integer.
returns: Minimum integer value.
Get the maximum value of input floats.
API float FMax(float a, float b);
a: First float.
b: Second float.
returns: Maximum float value.
Get the maximum value of input integers.
API int IMax(int a, int b);
a: First integer.
b: Second integer.
returns: Maximum integer value.
Get sign of float.
API int FSign(float n);
n: Float Value.
returns: Sign.
Get sign of integer.
API int ISign(int n);
n: Integer Value.
returns: Sign.
Get absolute value of float.
API float FAbs(float n);
n: Float Value.
returns: Absolute value.
Get absolute value of double.
API double DAbs(double n);
n: Float Value.
returns: Absolute value.
Get absolute value of integer.
API int IAbs(int n);
n: Integer Value.
returns: Absolute value.
Compare floats.
API float FComp(float a, float b, float e);
a: First float.
b: Second float.
b: Epsilon.
returns: -1: a < b 0: a == b. 1: a > b.
Compare doubles.
API double DComp(double a, double b, double e);
a: First double.
b: Second double.
b: Epsilon.
returns: -1: a < b 0: a == b. 1: a > b.
Swap floats.
API void FSwap(float *a, float *b);
a: Pointer to first float value.
b: Pointer to second float value.
Swap integers.
API void ISwap(int *a, int *b);
a: Pointer to first integer value.
b: Pointer to second integer value.
Get random float between min and max inclusive.
API float FRand(float min, float max);
min: Mininum random float value.
max: Maximum random float value.
returns: Random float value.
Get random integer between min and max inclusive.
API int IRand(int min, int max);
min: Mininum random integer value.
max: Maximum random integervalue.
returns: Random integer value.