nngn
Loading...
Searching...
No Matches
mat4.h
Go to the documentation of this file.
1
#ifndef NNGN_MATH_MAT4_H
2
#define NNGN_MATH_MAT4_H
3
4
#include <type_traits>
5
6
#include "
mat.h
"
7
#include "
vec4.h
"
8
9
namespace
nngn
{
10
11
template
<
typename
T>
12
struct
mat4_base
:
mat
<mat4_base, T, 4> {
13
constexpr
mat4_base
(
void
) =
default
;
14
explicit
constexpr
mat4_base
(
T
diag);
15
constexpr
mat4_base
(
vec4
col0,
vec4
col1,
vec4
col2,
vec4
col3);
16
constexpr
mat4_base
(
17
T
v0,
T
v1,
T
v2,
T
v3,
18
T
v4,
T
v5,
T
v6,
T
v7,
19
T
v8,
T
v9,
T
v10,
T
v11,
20
T
v12,
T
v13,
T
v14,
T
v15);
21
};
22
23
template
<
typename
T>
24
inline
constexpr
mat4_base<T>::mat4_base
(
T
diag) {
25
this->
m
= {
26
diag, 0, 0, 0,
27
0, diag, 0, 0,
28
0, 0, diag, 0,
29
0, 0, 0, diag,
30
};
31
}
32
33
template
<
typename
T>
34
inline
constexpr
mat4_base<T>::mat4_base
(
35
vec4
col0,
vec4
col1,
vec4
col2,
vec4
col3)
36
{
37
this->
m
= {
38
col0[0], col0[1], col0[2], col0[3],
39
col1[0], col1[1], col1[2], col1[3],
40
col2[0], col2[1], col2[2], col2[3],
41
col3[0], col3[1], col3[2], col3[3],
42
};
43
}
44
45
template
<
typename
T>
46
inline
constexpr
mat4_base<T>::mat4_base
(
47
T
v0,
T
v1,
T
v2,
T
v3,
48
T
v4,
T
v5,
T
v6,
T
v7,
49
T
v8,
T
v9,
T
v10,
T
v11,
50
T
v12,
T
v13,
T
v14,
T
v15)
51
{
52
this->
m
= {
53
v0, v1, v2, v3,
54
v4, v5, v6, v7,
55
v8, v9, v10, v11,
56
v12, v13, v14, v15,
57
};
58
}
59
60
using
imat4
=
mat4_base<int32_t>
;
61
using
umat4
=
mat4_base<uint32_t>
;
62
using
mat4
=
mat4_base<float>
;
63
using
dmat4
=
mat4_base<double>
;
64
65
}
66
67
#endif
T
#define T(f0, f1, f2)
mat.h
nngn
Definition
audio.cpp:7
m
local m
Definition
input.lua:28
nngn::mat4_base
Definition
mat4.h:12
nngn::mat4_base::mat4_base
constexpr mat4_base(void)=default
nngn::mat4_base::mat4_base
constexpr mat4_base(T diag)
Definition
mat4.h:24
nngn::mat4_base::mat4_base
constexpr mat4_base(vec4 col0, vec4 col1, vec4 col2, vec4 col3)
Definition
mat4.h:34
nngn::mat4_base::mat4_base
constexpr mat4_base(T v0, T v1, T v2, T v3, T v4, T v5, T v6, T v7, T v8, T v9, T v10, T v11, T v12, T v13, T v14, T v15)
Definition
mat4.h:46
nngn::mat
Definition
mat.h:11
nngn::vec4_base< float >
vec4.h
src
math
mat4.h
Generated by
1.11.0