Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DNumerical Class Reference

The U4DNumerical provides numerical robustness in floating point comparison, rounding errors and random number generation. More...

Public Member Functions

 U4DNumerical ()
 Default constructor for U4DNumerical.
 
 ~U4DNumerical ()
 Default destructor for U4DNumerical.
 
bool areEqualAbs (float uNumber1, float uNumber2, float uEpsilon)
 Method which compares if two floating value are equal using absolute comparison. More...
 
bool areEqualRel (float uNumber1, float uNumber2, float uEpsilon)
 Method which compares if two floating value are equal using relative comparison. More...
 
bool areEqual (float uNumber1, float uNumber2, float uEpsilon)
 Method which compares if two floating value are equal. More...
 
float getRandomNumberBetween (float uMinValue, float uMaxValue)
 Document this.
 
matrix_float4x4 convertToSIMD (U4DEngine::U4DMatrix4n &uMatrix)
 Converts 4x4 matrix to SIMD format. More...
 
matrix_float3x3 convertToSIMD (U4DEngine::U4DMatrix3n &uMatrix)
 Converts 3x3 matrix to SIMD format. More...
 
vector_float4 convertToSIMD (U4DEngine::U4DVector4n &uVector)
 Converts vector of 4 dimensions into SIMD format. More...
 
vector_float3 convertToSIMD (U4DEngine::U4DVector3n &uVector)
 Converts vector of 3 dimensions into SIMD format. More...
 
vector_float2 convertToSIMD (U4DEngine::U4DVector2n &uVector)
 Converts vector of 2 dimensions into SIMD format. More...
 
float remapValue (float uValue, U4DVector2n &uRangeFrom, U4DVector2n &uRangeTo)
 Sets property used to determine if entity is within frustum. More...
 

Detailed Description

The U4DNumerical provides numerical robustness in floating point comparison, rounding errors and random number generation.

Member Function Documentation

◆ areEqual()

bool U4DEngine::U4DNumerical::areEqual ( float  uNumber1,
float  uNumber2,
float  uEpsilon 
)

Method which compares if two floating value are equal.

Parameters
uNumber1Floating value to compare
uNumber2Floating value to compare
uEpsilonEpsilon used in comparison
Returns
Returns true if two floating value are equal

◆ areEqualAbs()

bool U4DEngine::U4DNumerical::areEqualAbs ( float  uNumber1,
float  uNumber2,
float  uEpsilon 
)

Method which compares if two floating value are equal using absolute comparison.

Parameters
uNumber1Floating value to compare
uNumber2Floating value to compare
uEpsilonEpsilon used in comparison
Returns
Returns true if two floating value are equal

◆ areEqualRel()

bool U4DEngine::U4DNumerical::areEqualRel ( float  uNumber1,
float  uNumber2,
float  uEpsilon 
)

Method which compares if two floating value are equal using relative comparison.

Parameters
uNumber1Floating value to compare
uNumber2Floating value to compare
uEpsilonEpsilon used in comparison
Returns
Returns true if two floating value are equal

◆ convertToSIMD() [1/5]

matrix_float3x3 U4DEngine::U4DNumerical::convertToSIMD ( U4DEngine::U4DMatrix3n uMatrix)

Converts 3x3 matrix to SIMD format.

Converts 3x3 matrix to SIMD format used by the GPU shaders

Parameters
uMatrix3x3 Matrix
Returns
Matrix in SIMD format

◆ convertToSIMD() [2/5]

matrix_float4x4 U4DEngine::U4DNumerical::convertToSIMD ( U4DEngine::U4DMatrix4n uMatrix)

Converts 4x4 matrix to SIMD format.

Converts 4x4 matrix to SIMD format used by the GPU shaders

Parameters
uMatrix3x3 Matrix
Returns
Matrix in SIMD format

◆ convertToSIMD() [3/5]

vector_float2 U4DEngine::U4DNumerical::convertToSIMD ( U4DEngine::U4DVector2n uVector)

Converts vector of 2 dimensions into SIMD format.

Converts vector of 2n dimentsions into SIMD format

Parameters
uVector2n vector dimension
Returns
vector in SIMD format

◆ convertToSIMD() [4/5]

vector_float3 U4DEngine::U4DNumerical::convertToSIMD ( U4DEngine::U4DVector3n uVector)

Converts vector of 3 dimensions into SIMD format.

Converts vector of 3n dimentsions into SIMD format

Parameters
uVector3n vector dimension
Returns
vector in SIMD format

◆ convertToSIMD() [5/5]

vector_float4 U4DEngine::U4DNumerical::convertToSIMD ( U4DEngine::U4DVector4n uVector)

Converts vector of 4 dimensions into SIMD format.

Converts vector of 4n dimentsions into SIMD format

Parameters
uVector4n vector dimension
Returns
vector in SIMD format

◆ remapValue()

float U4DEngine::U4DNumerical::remapValue ( float  uValue,
U4DVector2n uRangeFrom,
U4DVector2n uRangeTo 
)

Sets property used to determine if entity is within frustum.

If the property is set, the entity is rendered, else is ignored

Parameters
uValuetrue for is within the frustum, false if is not