Polyphase Game Engine
Loading...
Searching...
No Matches
Maths Class Reference

#include <Maths.h>

Static Public Member Functions

template<typename T >
static T RandRange (T min, T max)
 
static int32_t RandIndexWeighted (const std::vector< float > &weights)
 
static void SeedRand (uint32_t seed)
 
static float Damp (float source, float target, float smoothing, float deltaTime)
 
static glm::vec3 Damp (glm::vec3 source, glm::vec3 target, float smoothing, float deltaTime)
 
static glm::vec4 Damp (glm::vec4 source, glm::vec4 target, float smoothing, float deltaTime)
 
static float DampAngle (float source, float target, float smoothing, float deltaTime)
 
static float Approach (float source, float target, float speed, float deltaTime)
 
static glm::vec3 Approach (glm::vec3 source, glm::vec3 target, float speed, float deltaTime)
 
static glm::vec4 Approach (glm::vec4 source, glm::vec4 target, float speed, float deltaTime)
 
static float ApproachAngle (float source, float target, float speed, float deltaTime)
 
static float NormalizeRange (float value, float start, float end)
 
static float Map (float inX, float inMin, float inMax, float outMin, float outMax)
 
static float MapClamped (float inX, float inMin, float inMax, float outMin, float outMax)
 
static float WindRelativeAngle (float angle0, float angle1)
 
static glm::vec3 SafeNormalize (glm::vec3 vector)
 
static bool IsPowerOfTwo (uint32_t number)
 
static uint64_t GenerateAssetUuid ()
 
static glm::vec3 ExtractPosition (const glm::mat4 &mat)
 
static glm::quat ExtractRotation (const glm::mat4 &mat)
 
static glm::vec3 ExtractScale (const glm::mat4 &mat)
 
static float RotateYawTowardDirection (float srcYaw, glm::vec3 dir, float speed, float deltaTime)
 
static glm::vec3 VectorToRotation (glm::vec3 direction)
 
static glm::quat VectorToQuat (glm::vec3 direction)
 
static glm::vec3 QuatToVector (glm::quat quat)
 
static glm::vec3 RotationToVector (glm::vec3 rotation)
 
static glm::vec4 LinearToSrgb (const glm::vec4 &linearColor)
 
static glm::vec4 SrgbToLinear (glm::vec4 srgbColor)
 
template<>
float RandRange (float min, float max)
 
template<>
float RandRange (float min, float max)
 

Static Public Attributes

static constexpr uint64_t ENGINE_UUID_BASE = 0x0001000000000000ULL
 

Member Function Documentation

◆ Approach() [1/3]

float Maths::Approach ( float  source,
float  target,
float  speed,
float  deltaTime 
)
static

◆ Approach() [2/3]

glm::vec3 Maths::Approach ( glm::vec3  source,
glm::vec3  target,
float  speed,
float  deltaTime 
)
static

◆ Approach() [3/3]

glm::vec4 Maths::Approach ( glm::vec4  source,
glm::vec4  target,
float  speed,
float  deltaTime 
)
static

◆ ApproachAngle()

float Maths::ApproachAngle ( float  source,
float  target,
float  speed,
float  deltaTime 
)
static

◆ Damp() [1/3]

float Maths::Damp ( float  source,
float  target,
float  smoothing,
float  deltaTime 
)
static

◆ Damp() [2/3]

glm::vec3 Maths::Damp ( glm::vec3  source,
glm::vec3  target,
float  smoothing,
float  deltaTime 
)
static

◆ Damp() [3/3]

glm::vec4 Maths::Damp ( glm::vec4  source,
glm::vec4  target,
float  smoothing,
float  deltaTime 
)
static

◆ DampAngle()

float Maths::DampAngle ( float  source,
float  target,
float  smoothing,
float  deltaTime 
)
static

◆ ExtractPosition()

glm::vec3 Maths::ExtractPosition ( const glm::mat4 &  mat)
static

◆ ExtractRotation()

glm::quat Maths::ExtractRotation ( const glm::mat4 &  mat)
static

◆ ExtractScale()

glm::vec3 Maths::ExtractScale ( const glm::mat4 &  mat)
static

◆ GenerateAssetUuid()

uint64_t Maths::GenerateAssetUuid ( )
static

◆ IsPowerOfTwo()

bool Maths::IsPowerOfTwo ( uint32_t  number)
static

◆ LinearToSrgb()

glm::vec4 Maths::LinearToSrgb ( const glm::vec4 &  linearColor)
static

◆ Map()

float Maths::Map ( float  inX,
float  inMin,
float  inMax,
float  outMin,
float  outMax 
)
static

◆ MapClamped()

float Maths::MapClamped ( float  inX,
float  inMin,
float  inMax,
float  outMin,
float  outMax 
)
static

◆ NormalizeRange()

float Maths::NormalizeRange ( float  value,
float  start,
float  end 
)
static

◆ QuatToVector()

glm::vec3 Maths::QuatToVector ( glm::quat  quat)
static

◆ RandIndexWeighted()

int32_t Maths::RandIndexWeighted ( const std::vector< float > &  weights)
static

◆ RandRange() [1/3]

template<>
float Maths::RandRange ( float  min,
float  max 
)
static

◆ RandRange() [2/3]

template<>
float Maths::RandRange ( float  min,
float  max 
)
static

◆ RandRange() [3/3]

template<typename T >
static T Maths::RandRange ( min,
max 
)
inlinestatic

◆ RotateYawTowardDirection()

float Maths::RotateYawTowardDirection ( float  srcYaw,
glm::vec3  dir,
float  speed,
float  deltaTime 
)
static

◆ RotationToVector()

glm::vec3 Maths::RotationToVector ( glm::vec3  rotation)
static

◆ SafeNormalize()

glm::vec3 Maths::SafeNormalize ( glm::vec3  vector)
static

◆ SeedRand()

void Maths::SeedRand ( uint32_t  seed)
static

◆ SrgbToLinear()

glm::vec4 Maths::SrgbToLinear ( glm::vec4  srgbColor)
static

◆ VectorToQuat()

glm::quat Maths::VectorToQuat ( glm::vec3  direction)
static

◆ VectorToRotation()

glm::vec3 Maths::VectorToRotation ( glm::vec3  direction)
static

◆ WindRelativeAngle()

float Maths::WindRelativeAngle ( float  angle0,
float  angle1 
)
static

Member Data Documentation

◆ ENGINE_UUID_BASE

constexpr uint64_t Maths::ENGINE_UUID_BASE = 0x0001000000000000ULL
staticconstexpr

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