Open 3D Engine EMotionFX Gem API Reference 24.09.2
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
MCore::Compare< T > Class Template Reference

#include <Compare.h>

Public Member Functions

MCORE_INLINE bool CheckIfIsClose (const float &a, const float &b, float threshold)
 
MCORE_INLINE bool CheckIfIsClose (const AZ::Vector2 &a, const AZ::Vector2 &b, float threshold)
 
MCORE_INLINE bool CheckIfIsClose (const AZ::Vector3 &a, const AZ::Vector3 &b, float threshold)
 
MCORE_INLINE bool CheckIfIsClose (const AZ::Vector4 &a, const AZ::Vector4 &b, float threshold)
 
MCORE_INLINE bool CheckIfIsClose (const AZ::Quaternion &a, const AZ::Quaternion &b, float threshold)
 

Static Public Member Functions

static MCORE_INLINE bool CheckIfIsClose (const T &a, const T &b, float threshold)
 

Detailed Description

template<class T>
class MCore::Compare< T >

The class used to check differences between given objects. The differences are all represented as floats. This class can be useful in some specific algorithms used for optimizing data sets. Partial template specialization is used to calculate differences between custom object types. There is already support provided for a number of types, such as floats, ints and vectors.

Member Function Documentation

◆ CheckIfIsClose()

template<class T >
static MCORE_INLINE bool MCore::Compare< T >::CheckIfIsClose ( const T & a,
const T & b,
float threshold )
static

Check if two given values are close to eachother or not.

Parameters
aThe first value.
bThe second value.
thresholdThe maximum error threshold value.
Note
Partial template specialization MUST be used to define behavior for the given type.

The documentation for this class was generated from the following file: