class
Math
Utility class providing common scalar math operations.
Public
Methods
staticCos
staticCos
staticSin
staticSin
staticTan
staticTan
staticCeilToInt
Returns the nearest integer equal or higher to the provided value.
If you are sure the input is positive use ceilToPosInt() for a slightly faster operation.
staticCeilToPosInt
Returns the nearest integer equal or higher to the provided value.
Value must be non-negative. Slightly faster than ceilToInt().
staticRoundToI32
Returns the integer nearest to the provided value.
If you are sure the input is positive use roundToPosInt() for a slightly faster operation.
staticRoundToU32
Returns the integer nearest to the provided value.
Value must be non-negative. Slightly faster than roundToInt().
staticRoundToMultiple
Rounds to the nearest multiple of .
staticRoundToMultiple
Rounds to the nearest multiple of .
staticIsPrime
Check if the value is a prime number.
staticSmoothStep
Performs smooth Hermite interpolation between values.
staticQuintic
Performs quintic interpolation where is the value to map onto a quintic S-curve. should be in [0, 1] range.
staticCubic
Performs cubic interpolation between two values bound between two other values where is the alpha value.
It should range from 0.0f to 1.0f. If it is 0.0f the method returns . If it is 1.0f it returns .
staticApproxEquals
Compare two floats, using tolerance for inaccuracies.
staticApproxEquals
Compare two doubles, using tolerance for inaccuracies.
staticApproxEquals
Compare two 2D vectors, using tolerance for inaccuracies.
staticApproxEquals
Compare two 3D vectors, using tolerance for inaccuracies.
staticApproxEquals
Compare two 4D vectors, using tolerance for inaccuracies.
staticApproxEquals
Compare two quaternions, using tolerance for inaccuracies.
staticCalculateTriTangent
Calculates the tangent space vector for a given set of positions / texture coords.
staticFastSin0
Sine function approximation.
- val
- Angle in range [0, pi/2].
staticFastSin0
Sine function approximation.
- val
- Angle in range [0, pi/2].
staticFastSin1
Sine function approximation.
- val
- Angle in range [0, pi/2].
staticFastSin1
Sine function approximation.
- val
- Angle in range [0, pi/2].
staticFastCos0
Cosine function approximation.
- val
- Angle in range [0, pi/2].
staticFastCos0
Cosine function approximation.
- val
- Angle in range [0, pi/2].
staticFastCos1
Cosine function approximation.
- val
- Angle in range [0, pi/2].
staticFastCos1
Cosine function approximation.
- val
- Angle in range [0, pi/2].
staticFastTan0
Tangent function approximation.
- val
- Angle in range [0, pi/4].
staticFastTan0
Tangent function approximation.
- val
- Angle in range [0, pi/4].
staticFastTan1
Tangent function approximation.
- val
- Angle in range [0, pi/4].
staticFastTan1
Tangent function approximation.
- val
- Angle in range [0, pi/4].
staticFastASin0
Inverse sine function approximation.
- val
- Angle in range [0, 1].
staticFastASin0
Inverse sine function approximation.
- val
- Angle in range [0, 1].
staticFastASin1
Inverse sine function approximation.
- val
- Angle in range [0, 1].
staticFastASin1
Inverse sine function approximation.
- val
- Angle in range [0, 1].
staticFastACos0
Inverse cosine function approximation.
- val
- Angle in range [0, 1].
staticFastACos0
Inverse cosine function approximation.
- val
- Angle in range [0, 1].
staticFastACos1
Inverse cosine function approximation.
- val
- Angle in range [0, 1].
staticFastACos1
Inverse cosine function approximation.
- val
- Angle in range [0, 1].
staticFastATan0
Inverse tangent function approximation.
- val
- Angle in range [-1, 1].
staticFastATan0
Inverse tangent function approximation.
- val
- Angle in range [-1, 1].
staticFastATan1
Inverse tangent function approximation.
- val
- Angle in range [-1, 1].
staticFastATan1
Inverse tangent function approximation.
- val
- Angle in range [-1, 1].