Move Vectormath
main
C++20 game and graphics mathematics
Loading...
Searching...
No Matches
Matrices.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstddef>
4
#include <cstdint>
5
#include <type_traits>
6
7
#include <
mv/math/gpu/Vectors.hpp
>
8
#include <
mv/math/packed/Vectors.hpp
>
9
10
namespace
mv::math::gpu
11
{
12
enum class
MatrixMajor
: std::uint8_t
13
{
14
Row
,
15
Column
16
};
17
18
template
<MatrixMajor Major>
19
struct
alignas
(16)
Mat3f16
20
{
21
Float3Slot16
Vectors
[3]{};
22
};
23
24
template
<MatrixMajor Major>
25
struct
alignas
(16)
Mat4f16
26
{
27
PackedVec4f
Vectors
[4]{};
28
};
29
30
using
RowMajorMat3f16
=
Mat3f16<MatrixMajor::Row>
;
31
using
ColumnMajorMat3f16
=
Mat3f16<MatrixMajor::Column>
;
32
using
RowMajorMat4f16
=
Mat4f16<MatrixMajor::Row>
;
33
using
ColumnMajorMat4f16
=
Mat4f16<MatrixMajor::Column>
;
34
}
// namespace mv::math::gpu
35
36
static_assert
(
sizeof
(
mv::math::gpu::RowMajorMat3f16
) == 48);
37
static_assert
(
alignof
(
mv::math::gpu::RowMajorMat3f16
) == 16);
38
static_assert
(
sizeof
(
mv::math::gpu::ColumnMajorMat3f16
) == 48);
39
static_assert
(
alignof
(
mv::math::gpu::ColumnMajorMat3f16
) == 16);
40
static_assert
(
sizeof
(
mv::math::gpu::RowMajorMat4f16
) == 64);
41
static_assert
(
alignof
(
mv::math::gpu::RowMajorMat4f16
) == 16);
42
static_assert
(
sizeof
(
mv::math::gpu::ColumnMajorMat4f16
) == 64);
43
static_assert
(
alignof
(
mv::math::gpu::ColumnMajorMat4f16
) == 16);
44
static_assert
(std::is_trivially_copyable_v<mv::math::gpu::RowMajorMat3f16>);
45
static_assert
(std::is_trivially_copyable_v<mv::math::gpu::RowMajorMat4f16>);
mv::math::Radians
Definition
Angles.hpp:12
Vectors.hpp
mv::math::gpu
Definition
Matrices.hpp:11
mv::math::gpu::RowMajorMat3f16
Mat3f16< MatrixMajor::Row > RowMajorMat3f16
Definition
Matrices.hpp:30
mv::math::gpu::ColumnMajorMat3f16
Mat3f16< MatrixMajor::Column > ColumnMajorMat3f16
Definition
Matrices.hpp:31
mv::math::gpu::RowMajorMat4f16
Mat4f16< MatrixMajor::Row > RowMajorMat4f16
Definition
Matrices.hpp:32
mv::math::gpu::MatrixMajor
MatrixMajor
Definition
Matrices.hpp:13
mv::math::gpu::MatrixMajor::Column
@ Column
mv::math::gpu::MatrixMajor::Row
@ Row
mv::math::gpu::ColumnMajorMat4f16
Mat4f16< MatrixMajor::Column > ColumnMajorMat4f16
Definition
Matrices.hpp:33
Vectors.hpp
mv::math::PackedVec4f
Definition
Vectors.hpp:32
mv::math::gpu::Float3Slot16
Definition
Vectors.hpp:15
mv::math::gpu::Mat3f16
Definition
Matrices.hpp:20
mv::math::gpu::Mat3f16::Vectors
Float3Slot16 Vectors[3]
Definition
Matrices.hpp:21
mv::math::gpu::Mat4f16
Definition
Matrices.hpp:26
mv::math::gpu::Mat4f16::Vectors
PackedVec4f Vectors[4]
Definition
Matrices.hpp:27
packages
move
math
include
mv
math
gpu
Matrices.hpp
Generated by
1.9.8