Fireworks Engine  v2.0
Lightweight Sandbox Game Engine using OpenGL for additional Customisation and Quick Prototyping
mat4.h
Go to the documentation of this file.
1  #pragma once
2 
3 #define _USE_MATH_DEFINES
4 #include <math.h>
5 #include "maths.h"
6 
7 namespace fireworks { namespace maths {
8 
9  struct mat4
10  {
11  union
12  {
13  float elements[4 * 4];
15  };
16 
17  DEPRECATED mat4();
18  DEPRECATED mat4(float diagonal);
19 
20  // 4X4 Identity Matrix
21  DEPRECATED static mat4 identity();
22 
23  // Mat 4 to Mat4 multiplication
24  DEPRECATED mat4& multiply(const mat4& other);
25  DEPRECATED friend mat4 operator*(mat4 left, const mat4& right);
26  DEPRECATED mat4& operator*=(const mat4& other);
27 
28  // Mat4 and Vec3 multiplication
29  DEPRECATED vec3 multiply(const vec3& other) const;
30  DEPRECATED friend vec3 operator*(const mat4& left, const vec3& right);
31 
32  // Mat4 and Vec4 multiplication
33  DEPRECATED vec4 multiply(const vec4& other) const;
34  DEPRECATED friend vec4 operator*(const mat4& left, const vec4& right);
35 
36  // TODO: Add matrix transpose
37 
38  // Inverting Matrix
40 
41  // Projection Matrices
42  DEPRECATED static mat4 orthographic(float left, float right, float bottom, float top, float near, float far);
43  DEPRECATED static mat4 perspective(float fov, float aspectRatio, float near, float far);
44 
45  // View Transformation Matrices
47  DEPRECATED static mat4 rotation(float angle, const vec3& axis);
48  DEPRECATED static mat4 scale(const vec3& scale);
49 
50  // LookAt Matrix
51  DEPRECATED static mat4 lookAt(const vec3& eye, const vec3& target, const vec3& worldUp = vec3(0, 1, 0));
52 
53  // Right Shift operator overload to print the matrix to the (character output : cout) or any output stream
54  DEPRECATED friend std::ostream& operator<<(std::ostream& stream, const mat4& matrix);
55  };
56 
57 } }
float elements[4 *4]
Definition: mat4.h:13
static DEPRECATED mat4 identity()
Definition: mat4.cpp:22
DEPRECATED mat4 & multiply(const mat4 &other)
Definition: mat4.cpp:32
DEPRECATED mat4 & operator*=(const mat4 &other)
Definition: mat4.cpp:61
static DEPRECATED mat4 scale(const vec3 &scale)
Definition: mat4.cpp:298
Definition: audioclip.cpp:3
static DEPRECATED mat4 perspective(float fov, float aspectRatio, float near, float far)
Definition: mat4.cpp:238
DEPRECATED friend std::ostream & operator<<(std::ostream &stream, const mat4 &matrix)
Definition: mat4.cpp:336
#define DEPRECATED
Definition: maths.h:9
static DEPRECATED mat4 orthographic(float left, float right, float bottom, float top, float near, float far)
Definition: mat4.cpp:221
Definition: vec3.h:9
Definition: mat4.h:9
DEPRECATED mat4()
Definition: mat4.cpp:5
DEPRECATED friend mat4 operator*(mat4 left, const mat4 &right)
Definition: mat4.cpp:56
Definition: vec4.h:7
DEPRECATED mat4 & invert()
Definition: mat4.cpp:95
static DEPRECATED mat4 rotation(float angle, const vec3 &axis)
Definition: mat4.cpp:270
static DEPRECATED mat4 translation(const vec3 &translation)
Definition: mat4.cpp:259
vec4 columns[4]
Definition: mat4.h:14
static DEPRECATED mat4 lookAt(const vec3 &eye, const vec3 &target, const vec3 &worldUp=vec3(0, 1, 0))
Definition: mat4.cpp:309