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

#include <Distance.h>

Public Types

enum  EUnitType : uint8 {
  UNITTYPE_INCHES = 0 , UNITTYPE_FEET = 1 , UNITTYPE_YARDS = 2 , UNITTYPE_MILES = 3 ,
  UNITTYPE_MILLIMETERS = 4 , UNITTYPE_CENTIMETERS = 5 , UNITTYPE_DECIMETERS = 6 , UNITTYPE_METERS = 7 ,
  UNITTYPE_KILOMETERS = 8
}
 

Public Member Functions

MCORE_INLINE Distance (double units, EUnitType unitType)
 
MCORE_INLINE Distance (float units, EUnitType unitType)
 
MCORE_INLINE Distance (const Distance &other)
 
const DistanceConvertTo (EUnitType targetUnitType)
 
MCORE_INLINE Distance ConvertedTo (EUnitType targetUnitType) const
 
MCORE_INLINE double GetDistance () const
 
MCORE_INLINE EUnitType GetUnitType () const
 
MCORE_INLINE void Set (double dist, EUnitType unitType)
 
MCORE_INLINE void SetDistance (double dist)
 
MCORE_INLINE void SetUnitType (EUnitType unitType)
 
MCORE_INLINE double CalcDistanceInUnitType (EUnitType targetUnitType) const
 
MCORE_INLINE double CalcNumMillimeters () const
 
MCORE_INLINE double CalcNumCentimeters () const
 
MCORE_INLINE double CalcNumDecimeters () const
 
MCORE_INLINE double CalcNumMeters () const
 
MCORE_INLINE double CalcNumKilometers () const
 
MCORE_INLINE double CalcNumInches () const
 
MCORE_INLINE double CalcNumFeet () const
 
MCORE_INLINE double CalcNumYards () const
 
MCORE_INLINE double CalcNumMiles () const
 
MCORE_INLINE Distance operator- () const
 
MCORE_INLINE const Distanceoperator= (const Distance &other)
 
MCORE_INLINE const Distanceoperator*= (double f)
 
MCORE_INLINE const Distanceoperator/= (double f)
 
MCORE_INLINE const Distanceoperator+= (double f)
 
MCORE_INLINE const Distanceoperator-= (double f)
 
MCORE_INLINE const Distanceoperator*= (float f)
 
MCORE_INLINE const Distanceoperator/= (float f)
 
MCORE_INLINE const Distanceoperator+= (float f)
 
MCORE_INLINE const Distanceoperator-= (float f)
 
MCORE_INLINE const Distanceoperator*= (const Distance &other)
 
MCORE_INLINE const Distanceoperator/= (const Distance &other)
 
MCORE_INLINE const Distanceoperator+= (const Distance &other)
 
MCORE_INLINE const Distanceoperator-= (const Distance &other)
 

Static Public Member Functions

static double GetConversionFactorToMeters (EUnitType unitType)
 
static double GetConversionFactorFromMeters (EUnitType unitType)
 
static double GetConversionFactor (EUnitType sourceType, EUnitType targetType)
 
static double ConvertValue (float value, EUnitType sourceType, EUnitType targetType)
 
static const char * UnitTypeToString (EUnitType unitType)
 
static bool StringToUnitType (const AZStd::string &str, EUnitType *outUnitType)
 

Detailed Description

The distance class, which can be used to convert between different unit types. A unit type being for example centimeters, inches, meters, etc. You can use the ConvertTo() and ConvertedTo() methods or the CalcNumCentimeters() and similar methods or the CalcDistanceInUnitType() function to get a conversion.


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