17#define DOUBLE_PRECISION 0
32typedef double decimalType;
46typedef float decimalType;
50 return glm::quat_identity<decimalType, glm::packed_highp>();
58static inline std::ostream& operator<<(std::ostream& os,
const vector3& vec){
59 os <<
"vector3(" << vec.x <<
", " << vec.y <<
", " << vec.z <<
")";
63static inline std::ostream& operator<<(std::ostream& os,
const glm::vec4& vec) {
64 os <<
"fvec4(" << vec.x <<
", " << vec.y <<
", " << vec.z <<
", " << vec.w <<
")";
69static inline std::ostream& operator<<(std::ostream& os,
const quaternion& quat){
70 os <<
"quat(" <<
quat.x <<
", " <<
quat.y <<
", " <<
quat.z <<
", " <<
quat.w <<
")";
74static inline std::ostream& operator<<(std::ostream& os,
const matrix4& mat){
76 for(uint8_t i = 0; i < 4; i++){
77 for(uint8_t j = 0; j < 4; j++){
78 os << mat[i][j] <<
" ";
86#define print_vec3(vec) "vector3(" << vec.x << ", " << vec.y << ", " << vec.z << ")"
87#define print_quat(quat) "quat(" << quat.x << ", " << quat.y << ", " << quat.z << ", " << quat.w << ")"
90 constexpr decimalType PI = 3.1415926535897932385;
92 typedef Array<decimalType, 3> RawVec3;
93 typedef Array<decimalType, 4> RawQuat;
95 static_assert(std::is_trivially_copyable_v<RawVec3>,
"RawVec3 is not trivially copyable!");
96 static_assert(!std::is_fundamental_v<RawVec3>,
"RawVec3 is fundamental!");
97 static_assert(!std::is_same_v<RawVec3,void>,
"RawVec3 is void!");
98 static_assert(is_eligible<RawVec3>,
"RawVec3 is not eligible for CTTI!");
102 return { vec.x, vec.y, vec.z };
106 return vector3(raw[0], raw[1], raw[2]);
114 return quaternion(raw[0], raw[1], raw[2], raw[3]);
123 float min[3]{ 0,0,0 };
124 float max[3]{ 0,0,0 };
129 T width = 0, height = 0;
137 auto orthoProjection(T left, T right, T bottom, T top, T zNear, T zFar) {
142 auto perspectiveProjection(T fovy, T aspect, T zNear, T zFar) {
149 static inline bool pointInAABB(
const vector3& point,
const vector3& boxHalfExts) {
150 return (point.x <= boxHalfExts.x && point.x >= -boxHalfExts.x) &&
151 (point.y <= boxHalfExts.y && point.y >= -boxHalfExts.y) &&
152 (point.z <= boxHalfExts.z && point.z >= -boxHalfExts.z);
160typedef SSIZE_T ssize_t;
Definition concurrentqueue.h:747
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveRH_ZO(T fovy, T aspect, T near, T far)
Definition matrix_clip_space.inl:233
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoRH_ZO(T left, T right, T bottom, T top, T zNear, T zFar)
Definition matrix_clip_space.inl:42
qua< float, defaultp > quat
Quaternion of single-precision floating-point numbers.
Definition quaternion_float.hpp:35
GLM_FUNC_DECL GLM_CONSTEXPR qua< T, Q > quat_identity()
Definition quaternion.inl:9
Definition Animation.hpp:6
Definition mathtypes.hpp:122
Definition mathtypes.hpp:128
Definition qualifier.hpp:36
Definition type_quat.hpp:20
Definition qualifier.hpp:35