Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
Matrix.h
Go to the documentation of this file.
1#pragma once
2#include <GL/gl.h>
3#include <QMatrix4x4>
4#include <math/Types.h>
5#include <xgl/Types.h>
6#include <xgl/global.h>
7
8namespace sf::xgl
9{
10
15{
16 static_assert(std::is_same_v<GLfloat, value_type>);
17
18 public:
19 // Same constructors as the base class.
20 using matrix4x4f::matrix4x4f;
21
26
30 explicit Matrix(const QMatrix4x4& matrix);
31
35 explicit Matrix(const Matrix44& matrix);
36
37 // ReSharper disable once CppNonExplicitConversionOperator
41 operator const float*() const;
42
43 // ReSharper disable once CppNonExplicitConversionOperator
47 operator float*();
48
53 bool isZero() const;
54
55 // ReSharper disable once CppNonExplicitConversionOperator
59 operator QMatrix4x4() const;
60
64 operator Matrix44() const;
65
69 Matrix& operator=(const QMatrix4x4& matrix);
70
74 Matrix& operator=(const Matrix44& matrix);
75};
76
77}// namespace sf::xgl
A 4x4 matrix class used in arrays and has layout of 16x GLfloat.
Definition Matrix.h:15
Matrix(const QMatrix4x4 &matrix)
Constructor for Qt QMatrix4x4.
Matrix & operator=(const QMatrix4x4 &matrix)
Assignment operator accepting a QMatrix4x4 instance.
Matrix(const Matrix44 &matrix)
Constructor for Qt QMatrix4x4.
bool isZero() const
Checks if the 'w' value is non-zero.
Matrix & operator=(const Matrix44 &matrix)
Assignment operator accepting a #Matrix44 instance.
Matrix()
Default constructor initializing with a black color.
Definition DemoRenderer.h:6
std::array< GLfloat, 16 > matrix4x4f
Type which correspond with a GLSL type and used to implement Vertex structures.
Definition Types.h:13
#define _XGL_CLASS
Definition xgl/global.h:35