Mathter
A configurable 3D math library for game developers.
Definitions.hpp
Go to the documentation of this file.
1 //==============================================================================
2 // This software is distributed under The Unlicense.
3 // For more information, please refer to <http://unlicense.org/>
4 //==============================================================================
5 //
6 #pragma once
7 
8 namespace mathter {
9 
10 //------------------------------------------------------------------------------
11 // Enums
12 //------------------------------------------------------------------------------
13 
22 enum class eMatrixOrder {
25 };
26 
36 enum class eMatrixLayout {
37  ROW_MAJOR,
39 };
40 
41 
42 
43 //------------------------------------------------------------------------------
44 // Constants
45 //------------------------------------------------------------------------------
46 
49 constexpr int DYNAMIC = -1;
50 
51 
52 //------------------------------------------------------------------------------
53 // Classes
54 //------------------------------------------------------------------------------
55 
56 template <class T, int Dim, bool Packed>
57 class Vector;
58 
59 template <class T, int... Indices>
60 class Swizzle;
61 
62 template <class T, int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
63 class Matrix;
64 
65 template <class MatrixT, int SRows, int SColumns>
67 
68 template <class T, bool Packed>
69 class Quaternion;
70 
71 
72 
73 //------------------------------------------------------------------------------
74 // Macro helpers
75 //------------------------------------------------------------------------------
76 
77 // To enable Empty Base Class Optimization (EBCO) in MSVC.
78 // Why the fuck do I even have to manually enable it??? Get you shit together Microsoft!
79 #ifdef _MSC_VER
80 #define MATHTER_EBCO __declspec(empty_bases)
81 #else
82 #define MATHTER_EBCO
83 #endif
84 
85 
86 } // namespace mathter
Allows you to do quaternion math and represent rotation in a compact way.
Definition: Definitions.hpp:69
Represents a vector in N-dimensional space.
Definition: Definitions.hpp:57
Enables element swizzling (reordering elements) for vectors.
Definition: Definitions.hpp:60
Definition: Approx.hpp:11
constexpr int DYNAMIC
Specify this as Vector or Matrix dimension template parameter to set size at runtime. PLEASE NOTE THAT DYNAMICALLY SIZED VECTORS AND MATRICES ARE NOT SUPPORTED YET.
Definition: Definitions.hpp:49
Definition: Definitions.hpp:66
Definition: Definitions.hpp:63
eMatrixOrder
Determines if you want to left- or right-multiply your matrices with vectors.
Definition: Definitions.hpp:22
eMatrixLayout
Determines the memory layout of matrices.
Definition: Definitions.hpp:36