nngn
Loading...
Searching...
No Matches
mat3.h
Go to the documentation of this file.
1
#ifndef NNGN_MATH_MAT3_H
2
#define NNGN_MATH_MAT3_H
3
4
#include <type_traits>
5
6
#include "
mat.h
"
7
#include "
vec3.h
"
8
9
namespace
nngn
{
10
11
template
<
typename
T>
12
struct
mat3_base
:
mat
<mat3_base, T, 3> {
13
constexpr
mat3_base
(
void
) =
default
;
14
explicit
constexpr
mat3_base
(
T
diag);
15
constexpr
mat3_base
(
vec3
col0,
vec3
col1,
vec3
col2);
16
constexpr
mat3_base
(
17
T
v0,
T
v1,
T
v2,
18
T
v3,
T
v4,
T
v5,
19
T
v6,
T
v7,
T
v8);
20
};
21
22
template
<
typename
T>
23
inline
constexpr
mat3_base<T>::mat3_base
(
T
diag) {
24
this->
m
= {
25
diag, 0, 0,
26
0, diag, 0,
27
0, 0, diag,
28
};
29
}
30
31
template
<
typename
T>
32
inline
constexpr
mat3_base<T>::mat3_base
(
vec3
col0,
vec3
col1,
vec3
col2) {
33
this->
m
= {
34
col0[0], col0[1], col0[2],
35
col1[0], col1[1], col1[2],
36
col2[0], col2[1], col2[2],
37
};
38
}
39
40
template
<
typename
T>
41
inline
constexpr
mat3_base<T>::mat3_base
(
42
T
v0,
T
v1,
T
v2,
43
T
v3,
T
v4,
T
v5,
44
T
v6,
T
v7,
T
v8)
45
{
46
this->
m
= {v0, v1, v2, v3, v4, v5, v6, v7, v8};
47
}
48
49
using
imat3
=
mat3_base<int32_t>
;
50
using
umat3
=
mat3_base<uint32_t>
;
51
using
mat3
=
mat3_base<float>
;
52
using
dmat3
=
mat3_base<double>
;
53
54
}
55
56
#endif
T
#define T(f0, f1, f2)
mat.h
nngn
Definition
audio.cpp:7
m
local m
Definition
input.lua:28
nngn::mat3_base
Definition
mat3.h:12
nngn::mat3_base::mat3_base
constexpr mat3_base(void)=default
nngn::mat
Definition
mat.h:11
nngn::vec3_base< float >
vec3.h
src
math
mat3.h
Generated by
1.11.0