Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
Math.hpp
1#pragma once
2
3#include <glm/glm.hpp>
4#include <glm/gtx/quaternion.hpp>
5
6namespace Grindstone::Math {
7 using Int = int;
8 using Int2 = glm::tvec2<int, glm::highp>;
9 using Int3 = glm::tvec3<int, glm::highp>;
10 using Int4 = glm::tvec4<int, glm::highp>;
11
12 using Uint = unsigned int;
13 using Uint2 = glm::tvec2<unsigned int, glm::highp>;
14 using Uint3 = glm::tvec3<unsigned int, glm::highp>;
15 using Uint4 = glm::tvec4<unsigned int, glm::highp>;
16
17 using Double = double;
18 using Double2 = glm::tvec2<double, glm::highp>;
19 using Double3 = glm::tvec3<double, glm::highp>;
20 using Double4 = glm::tvec4<double, glm::highp>;
21
22 using Float = float;
23 using Float2 = glm::vec2;
24 using Float3 = glm::vec3;
25 using Float4 = glm::vec4;
26
27 using Matrix3 = glm::mat3;
28 using Matrix4 = glm::mat4;
29
30 using Quaternion = glm::quat;
31
32 typedef struct ExportableVector {
33 float x;
34 float y;
35 float z;
37
38 typedef struct ExportableQuaternion {
39 float x;
40 float y;
41 float z;
42 float w;
44
45 glm::vec3 ImportVector(const ExportableVector inVec);
46 glm::quat ImportQuaternion(const ExportableQuaternion inQuat);
47 ExportableVector ExportVector(const glm::vec3 inVec);
48 ExportableQuaternion ExportQuaternion(const glm::quat inQuat);
49}