Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
Matrix3x3.hpp
Go to the documentation of this file.
1/*
2Copyright (C) 2015-2019,2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGAMES_MATRIX3X3_H
17#define AEONGAMES_MATRIX3X3_H
23
25#include <initializer_list>
26
27namespace AeonGames
28{
29 class Vector3;
30 class Transform;
33 {
34 public:
36 DLL Matrix3x3();
40 DLL Matrix3x3 ( const Transform& aTransform );
44 DLL Matrix3x3 ( const float* const aMatrix );
48 DLL Matrix3x3 ( const std::initializer_list<const float> aList );
52 DLL const float* const GetMatrix3x3() const;
60 DLL Matrix3x3& Invert();
68 DLL Matrix3x3& Rotate ( float angle, float x, float y, float z );
71
72 DLL Matrix3x3& operator*= ( const Matrix3x3& lhs );
74 DLL const float operator[] ( size_t aIndex ) const;
76
86 DLL static const Matrix3x3 GetRotationMatrix ( float angle, float x, float y, float z );
87 protected:
89 float mMatrix[9];
90 };
91
98 DLL const Matrix3x3 operator* ( const Matrix3x3& lhs, const Matrix3x3& rhs );
104 DLL const Vector3 operator* ( const Matrix3x3& lhs, const Vector3& rhs );
110 DLL const bool operator== ( const Matrix3x3& lhs, const Matrix3x3& rhs );
115 DLL const Matrix3x3 Abs ( const Matrix3x3& aMatrix3x3 );
116 static_assert ( sizeof ( Matrix3x3 ) == ( sizeof ( float ) * 9 ), "Matrix3x3 is not 9 floats wide." );
117}
118#endif
Platform-specific macros, includes, and DLL export/import definitions.
3 by 3 matrix in colum mayor order.
Definition Matrix3x3.hpp:33
DLL const Matrix3x3 GetInvertedMatrix3x3()
Get the inverted matrix.
Definition Matrix3x3.cpp:56
DLL Matrix3x3 & operator*=(const Matrix3x3 &lhs)
Multiply this matrix by another matrix.
Definition Matrix3x3.cpp:69
DLL Matrix3x3()
Default constructor.
Definition Matrix3x3.cpp:25
DLL const float *const GetMatrix3x3() const
Get a pointer to the internal matrix data.
Definition Matrix3x3.cpp:45
static DLL const Matrix3x3 GetRotationMatrix(float angle, float x, float y, float z)
Constructs the rotation matrix defined by the axis-angle provided.
DLL const float operator[](size_t aIndex) const
Access a matrix element by index.
Definition Matrix3x3.cpp:95
float mMatrix[9]
Lineal row mayor matrix.
Definition Matrix3x3.hpp:89
DLL Matrix3x3 & Invert()
Invert this matrix in place.
Definition Matrix3x3.cpp:50
DLL Matrix3x3 & Rotate(float angle, float x, float y, float z)
Apply a rotation to this matrix.
Definition Matrix3x3.cpp:61
Component class for any object that requires space transformations.
Definition Transform.hpp:34
3D vector class.
Definition Vector3.hpp:32
<- This is here just for the literals
Definition AABB.hpp:31
DLL const Matrix3x3 operator*(const Matrix3x3 &lhs, const Matrix3x3 &rhs)
Multiplies two 3x3 matrices. Multiplies two 3x3 matrices.
DLL const Matrix3x3 Abs(const Matrix3x3 &aMatrix3x3)
Compute the element-wise absolute value of a matrix.
DLL const bool operator==(const Matrix3x3 &lhs, const Matrix3x3 &rhs)
Compare two 3x3 matrices for equality.