TheAtlasEngine
 
Loading...
Searching...
No Matches
types.hpp
1#pragma once
2#include <type_traits>
3#include <Jolt/Jolt.h>
4#include <core/math/types.hpp>
5#include <glm/gtc/quaternion.hpp>
6#include <glm/fwd.hpp>
7
8namespace atlas {
9 template<>
10 struct vector3<JPH::Vec3> {
11 vector3() = default;
12
13 vector3(const JPH::Vec3& p_other) {
14 m_value = { p_other.GetX(), p_other.GetY(), p_other.GetZ() };
15 }
16
17 operator glm::vec3() { return m_value; }
18
19 glm::vec3 operator=(const JPH::Vec3& p_other) {
20 return { p_other.GetX(), p_other.GetY(), p_other.GetZ() };
21 }
22
23 bool operator==(const glm::vec3& p_other) {
24 return (m_value.x == p_other.x and m_value.y == p_other.y and
25 m_value.z == p_other.z);
26 }
27
28 private:
29 glm::vec3 m_value;
30 };
31
32 namespace jolt {
33 JPH::RVec3 to_rvec3(const glm::vec3& p_value);
34
35 JPH::Vec3 to_vec3(const glm::vec3& p_value);
36
37 JPH::Quat to_quat(const glm::vec4& q);
38
39 JPH::Quat to_quat(glm::quat& p_value);
40 };
41
42 glm::vec3 to_vec3(const JPH::Vec3& p_value);
43
44 glm::quat to_quat(const JPH::Quat& p_value);
45
46 glm::vec4 to_vec4(const JPH::Quat& p_value);
47};
vector3<T> is to define a centralized wrapper as a mathematical representaiton for communicating vect...
Definition types.hpp:38