IceShard
1
A personal game engine project, with development focused on 2D/2.5D games.
Toggle main menu visibility
Loading...
Searching...
No Matches
math
public
ice
math
decompose.hxx
Go to the documentation of this file.
1
3
4
#pragma once
5
#include <
ice/math/vector/vector_operations.hxx
>
6
#include <
ice/math/rotate.hxx
>
7
#include <
ice/math/scale.hxx
>
8
#include <
ice/math/translate.hxx
>
9
10
namespace
ice::math
11
{
12
13
template
<
typename
T>
14
constexpr
void
decompose
(
15
mat<4, 4, T>
matrix,
16
vec3f
* pos,
17
vec3f
*
scale
,
18
vec<3, rad>
* angle
19
)
noexcept
;
20
21
22
template
<
typename
T>
23
constexpr
void
decompose
(
24
mat<4, 4, T>
matrix,
25
vec3f
* pos,
26
vec3f
*
scale
,
27
vec<3, rad>
* angle
28
)
noexcept
29
{
30
if
(
scale
!=
nullptr
)
31
{
32
*
scale
=
ice::math::scale
(matrix);
33
}
34
35
matrix =
ice::math::ortho_normalize
(matrix);
36
37
if
(pos !=
nullptr
)
38
{
39
*pos =
ice::math::translation
(matrix);
40
}
41
if
(angle !=
nullptr
)
42
{
43
*angle =
ice::math::rotation
(matrix);
44
}
45
}
46
47
}
// namespace ice::math
ice::math
Definition
algorithm.hxx:8
ice::math::vec
mat< Size, 1, T > vec
Definition
vector.hxx:172
ice::math::ortho_normalize
constexpr auto ortho_normalize(mat< 4, 4, T > matrix) noexcept -> mat< 4, 4, T >
Definition
matrix_operations.hxx:224
ice::math::decompose
constexpr void decompose(mat< 4, 4, T > matrix, vec3f *pos, vec3f *scale, vec< 3, rad > *angle) noexcept
Definition
decompose.hxx:23
ice::math::translation
constexpr auto translation(mat< 3, 3, f32 > const &matrix) noexcept -> vec< 2, f32 >
Definition
translate.hxx:45
ice::math::rotation
auto rotation(mat< 4, 4, f32 > const &matrix) noexcept -> vec< 3, rad >
Definition
rotate.hxx:72
ice::math::vec3f
vec< 3, f32 > vec3f
Definition
vector.hxx:182
ice::math::scale
constexpr auto scale(vec< 3, f32 > v) noexcept -> mat< 4, 4, f32 >
Definition
scale.hxx:26
rotate.hxx
scale.hxx
ice::math::mat
Definition
matrix.hxx:12
translate.hxx
vector_operations.hxx
Generated by
1.18.0