Move Vectormath
main
C++20 game and graphics mathematics
Loading...
Searching...
No Matches
Vectors.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/Vec3.hpp
>
8
#include <
mv/math/packed/Vectors.hpp
>
9
10
namespace
mv::math::gpu
11
{
12
using
Float3Packed
=
PackedVec3f
;
13
14
struct
alignas
(16)
Float3Slot16
15
{
16
float
X
{};
17
float
Y
{};
18
float
Z
{};
19
std::uint32_t
Padding
{};
20
};
21
22
[[
nodiscard
]]
inline
Vec3f
Load
(
const
Float3Slot16
&
value
)
noexcept
23
{
24
return
Vec3f
(
value
.X,
value
.Y,
value
.Z);
25
}
26
27
inline
void
Store
(
Float3Slot16
&
destination
,
Vec3f
value
)
noexcept
28
{
29
destination
= {
value
.X(),
value
.Y(),
value
.Z(), 0
U
};
30
}
31
32
[[
nodiscard
]]
inline
Float3Slot16
Store
(
Vec3f
value
)
noexcept
33
{
34
return
{
value
.X(),
value
.Y(),
value
.Z(), 0
U
};
35
}
36
}
// namespace mv::math::gpu
37
38
static_assert
(
sizeof
(
mv::math::gpu::Float3Slot16
) == 16);
39
static_assert
(
alignof
(
mv::math::gpu::Float3Slot16
) == 16);
40
static_assert
(offsetof(
mv::math::gpu::Float3Slot16
, X) == 0);
41
static_assert
(offsetof(
mv::math::gpu::Float3Slot16
, Y) == 4);
42
static_assert
(offsetof(
mv::math::gpu::Float3Slot16
, Z) == 8);
43
static_assert
(offsetof(
mv::math::gpu::Float3Slot16
, Padding) == 12);
44
static_assert
(std::is_trivially_copyable_v<mv::math::gpu::Float3Slot16>);
45
static_assert
(std::is_standard_layout_v<mv::math::gpu::Float3Slot16>);
Vec3.hpp
mv::math::Radians
Definition
Angles.hpp:12
mv::math::gpu
Definition
Matrices.hpp:11
mv::math::gpu::Store
void Store(Float3Slot16 &destination, Vec3f value) noexcept
Definition
Vectors.hpp:27
mv::math::gpu::Load
Vec3f Load(const Float3Slot16 &value) noexcept
Definition
Vectors.hpp:22
mv::math::Vec3f
Vec3< float > Vec3f
Definition
Vec3.hpp:344
Vectors.hpp
mv::math::PackedVec3f
Definition
Vectors.hpp:22
mv::math::gpu::Float3Slot16
Definition
Vectors.hpp:15
mv::math::gpu::Float3Slot16::X
float X
Definition
Vectors.hpp:16
mv::math::gpu::Float3Slot16::Padding
std::uint32_t Padding
Definition
Vectors.hpp:19
mv::math::gpu::Float3Slot16::Z
float Z
Definition
Vectors.hpp:18
mv::math::gpu::Float3Slot16::Y
float Y
Definition
Vectors.hpp:17
packages
move
math
include
mv
math
gpu
Vectors.hpp
Generated by
1.9.8