Raito 0.1
Loading...
Searching...
No Matches
MathTypes.h
Go to the documentation of this file.
1/*
2MIT License
3
4Copyright (c) 2023 Víctor Falcón Zaro
5
6Permission is hereby granted, free of charge, to any person obtaining a copy
7of this software and associated documentation files (the "Software"), to deal
8in the Software without restriction, including without limitation the rights
9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in all
14copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22SOFTWARE.
23*/
24
25#pragma once
27
28#include <glm/glm.hpp>
29#define GLM_ENABLE_EXPERIMENTAL
30#include <glm/gtx/quaternion.hpp>
31
32namespace Raito
33{
34 namespace Math
35 {
36 constexpr f32 c_Pi = 3.14159265359f;
37 constexpr f32 c_Epsilon = 1e-5f;
38 }
39
41 using V2 = glm::vec2;
42
44 using Iv2 = glm::ivec2;
45
47 using V3 = glm::vec3;
48
50 using Iv3 = glm::ivec3;
51
53 using V4 = glm::vec4;
54
56 using Iv4 = glm::ivec4;
57
59 using U32V2 = glm::u32vec2;
60
62 using U32V3 = glm::u32vec3;
63
65 using U32V4 = glm::u32vec4;
66
68 using S32V2 = glm::i32vec2;
69
71 using S32V3 = glm::i32vec3;
72
74 using S32V4 = glm::i32vec4;
75
77 using Mat3 = glm::mat3x3;
78
79 // 4x4 Matrix (assumes right-handed coordinates)
80 using Mat4 = glm::mat4x4;
81
83 typedef glm::quat Quaternion;
84
86 using Color = glm::vec4;
87}
float f32
Singed floating pointer 32 bit type.
Definition BasicTypes.h:67
constexpr f32 c_Epsilon
Definition MathTypes.h:37
constexpr f32 c_Pi
Definition MathTypes.h:36
Definition AssetImport.cpp:47
glm::ivec4 Iv4
4D Vector; 32 bit integer components
Definition MathTypes.h:56
glm::vec4 V4
4D Vector; 32 bit floating point components
Definition MathTypes.h:53
glm::mat4x4 Mat4
Definition MathTypes.h:80
glm::ivec2 Iv2
2D Vector; 32 bit integer components
Definition MathTypes.h:44
glm::ivec3 Iv3
3D Vector; 32 bit integer components
Definition MathTypes.h:50
glm::mat3x3 Mat3
3x3 Matrix: 32 bit floating point components
Definition MathTypes.h:77
glm::u32vec2 U32V2
2D Vector; 32 bit unsigned integer components
Definition MathTypes.h:59
glm::vec2 V2
2D Vector; 32 bit floating point components
Definition MathTypes.h:41
glm::u32vec3 U32V3
3D Vector; 32 bit unsigned integer components
Definition MathTypes.h:62
glm::vec4 Color
Color structure.
Definition MathTypes.h:86
glm::i32vec2 S32V2
2D Vector; 32 bit signed integer components
Definition MathTypes.h:68
glm::quat Quaternion
Quaternion structure.
Definition MathTypes.h:83
glm::i32vec3 S32V3
3D Vector; 32 bit signed integer components
Definition MathTypes.h:71
glm::i32vec4 S32V4
4D Vector; 32 bit signed integer components
Definition MathTypes.h:74
glm::vec3 V3
3D Vector; 32 bit floating point components
Definition MathTypes.h:47
glm::u32vec4 U32V4
4D Vector; 32 bit unsigned integer components
Definition MathTypes.h:65