Blender
V5.3
source
blender
gpu
shaders
common
gpu_shader_math_matrix_conversion.bsl.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
#pragma once
6
7
#include "
gpu_shader_math_base.bsl.hh
"
8
#include "
gpu_shader_math_euler.bsl.hh
"
9
#include "
gpu_shader_math_matrix_compare.bsl.hh
"
10
#include "
gpu_shader_math_quaternion.bsl.hh
"
11
12
/* -------------------------------------------------------------------- */
15
19
float3
to_scale
(
float3x3
mat)
20
{
21
return
float3
(
length
(mat[0]),
length
(mat[1]),
length
(mat[2]));
22
}
23
26
float3
to_scale
(
float4x4
mat)
27
{
28
return
to_scale
(to_float3x3(mat));
29
}
30
33
template
<
typename
MatT,
bool
allow_negative_scale>
float3
to_scale
(MatT mat)
34
{
35
float3
result =
to_scale
(mat);
36
if
(allow_negative_scale) {
37
if
(
is_negative
(mat)) {
38
result = -result;
39
}
40
}
41
return
result;
42
}
43
template
float3
to_scale<float3x3, true>
(
float3x3
mat);
44
template
float3
to_scale<float3x3, false>
(
float3x3
mat);
45
template
float3
to_scale<float4x4, true>
(
float4x4
mat);
46
template
float3
to_scale<float4x4, false>
(
float4x4
mat);
47
length
float length(VecOp< float, D >) RET
gpu_shader_math_base.bsl.hh
gpu_shader_math_euler.bsl.hh
gpu_shader_math_matrix_compare.bsl.hh
is_negative
bool is_negative(float3x3 mat)
Definition
gpu_shader_math_matrix_compare.bsl.hh:47
to_scale
float3 to_scale(float3x3 mat)
Definition
gpu_shader_math_matrix_conversion.bsl.hh:19
gpu_shader_math_quaternion.bsl.hh
blender::float4x4
MatBase< float, 4, 4 > float4x4
Definition
BLI_math_matrix_types.hh:1024
float3
Definition
sky_math.h:135
float3x3
Definition
types_float3x3.h:21
Generated on
for Blender by
doxygen
1.18.0