5#if PLATFORM_WINDOWS && _DEBUG
6#define GLM_FORCE_INLINE
9#ifndef GLM_FORCE_DEPTH_ZERO_TO_ONE
10#define GLM_FORCE_DEPTH_ZERO_TO_ONE 1
14#include <glm/gtx/transform.hpp>
15#include <glm/gtx/quaternion.hpp>
16#include <glm/gtx/rotate_vector.hpp>
17#include <glm/gtx/matrix_decompose.hpp>
18#include <glm/gtx/matrix_transform_2d.hpp>
19#include <glm/gtx/vector_angle.hpp>
20#include <glm/gtx/euler_angles.hpp>
21#include <glm/gtc/matrix_transform.hpp>
22#include <glm/gtc/type_ptr.hpp>
26#define PI 3.14159265359f
27#define DEGREES_TO_RADIANS (PI / 180)
28#define RADIANS_TO_DEGREES (180 / PI)
37 int32_t retRand = min;
40 retRand = min + rand() % (max + 1 - min);
49 static float Damp(
float source,
float target,
float smoothing,
float deltaTime);
50 static glm::vec3
Damp(glm::vec3 source, glm::vec3 target,
float smoothing,
float deltaTime);
51 static glm::vec4
Damp(glm::vec4 source, glm::vec4 target,
float smoothing,
float deltaTime);
52 static float DampAngle(
float source,
float target,
float smoothing,
float deltaTime);
54 static float Approach(
float source,
float target,
float speed,
float deltaTime);
55 static glm::vec3
Approach(glm::vec3 source, glm::vec3 target,
float speed,
float deltaTime);
56 static glm::vec4
Approach(glm::vec4 source, glm::vec4 target,
float speed,
float deltaTime);
57 static float ApproachAngle(
float source,
float target,
float speed,
float deltaTime);
59 static float Map(
float inX,
float inMin,
float inMax,
float outMin,
float outMax);
60 static float MapClamped(
float inX,
float inMin,
float inMax,
float outMin,
float outMax);
83 static glm::vec4
LinearToSrgb(
const glm::vec4& linearColor);
89 static bool mRandSeeded;
93float Maths::RandRange<float>(
float min,
float max);
96glm::vec2 Maths::RandRange<glm::vec2>(glm::vec2 min, glm::vec2 max);
99glm::vec3 Maths::RandRange<glm::vec3>(glm::vec3 min, glm::vec3 max);
102glm::vec4 Maths::RandRange<glm::vec4>(glm::vec4 min, glm::vec4 max);
static glm::vec3 QuatToVector(glm::quat quat)
Definition Maths.cpp:411
static glm::vec4 SrgbToLinear(glm::vec4 srgbColor)
Definition Maths.cpp:440
static float Approach(float source, float target, float speed, float deltaTime)
Definition Maths.cpp:104
static glm::vec4 LinearToSrgb(const glm::vec4 &linearColor)
Definition Maths.cpp:432
static T RandRange(T min, T max)
Definition Maths.h:35
static glm::vec3 ExtractPosition(const glm::mat4 &mat)
Definition Maths.cpp:260
static glm::quat VectorToQuat(glm::vec3 direction)
Definition Maths.cpp:401
static glm::vec3 VectorToRotation(glm::vec3 direction)
Definition Maths.cpp:389
static glm::vec3 RotationToVector(glm::vec3 rotation)
Definition Maths.cpp:417
static float NormalizeRange(float value, float start, float end)
Definition Maths.cpp:199
static float WindRelativeAngle(float angle0, float angle1)
Definition Maths.cpp:229
static float MapClamped(float inX, float inMin, float inMax, float outMin, float outMax)
Definition Maths.cpp:215
static float Damp(float source, float target, float smoothing, float deltaTime)
Definition Maths.cpp:49
static float Map(float inX, float inMin, float inMax, float outMin, float outMax)
Definition Maths.cpp:207
static void SeedRand(uint32_t seed)
Definition Maths.cpp:378
static int32_t RandIndexWeighted(const std::vector< float > &weights)
Definition Maths.cpp:346
static glm::vec3 SafeNormalize(glm::vec3 vector)
Definition Maths.cpp:242
static uint64_t GenerateAssetUuid()
Definition Maths.cpp:448
static float ApproachAngle(float source, float target, float speed, float deltaTime)
Definition Maths.cpp:166
static constexpr uint64_t ENGINE_UUID_BASE
Definition Maths.h:69
static bool IsPowerOfTwo(uint32_t number)
Definition Maths.cpp:255
static float RotateYawTowardDirection(float srcYaw, glm::vec3 dir, float speed, float deltaTime)
Definition Maths.cpp:383
static glm::vec3 ExtractScale(const glm::mat4 &mat)
Definition Maths.cpp:326
static glm::quat ExtractRotation(const glm::mat4 &mat)
Definition Maths.cpp:280
static float DampAngle(float source, float target, float smoothing, float deltaTime)
Definition Maths.cpp:73