Blender
V5.3
source
blender
gpu
shaders
material
gpu_shader_material_quaternion_to_rotation.bsl.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2026 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
#pragma once
6
7
#include "
gpu_shader_math_vector_compare.bsl.hh
"
8
9
[[
node
]]
10
void
quaternion_to_rotation
(
float
w
,
float
x
,
float
y
,
float
z
,
float4
&rotation)
11
{
12
const
float4
quat =
float4
(
w
,
x
,
y
,
z
);
13
if
(!
is_zero
(quat)) {
14
rotation =
normalize
(quat);
15
}
16
else
{
17
rotation =
float4
(1.0f, 0.0f, 0.0f, 0.0f);
18
}
19
}
z
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition
btQuadWord.h:117
w
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition
btQuadWord.h:119
y
y
Definition
compositor_morphological_blur_infos.hh:32
node
#define node
Definition
gpu_shader_cxx_attribute.hh:142
normalize
VecBase< float, D > normalize(VecOp< float, D >) RET
quaternion_to_rotation
void quaternion_to_rotation(float w, float x, float y, float z, float4 &rotation)
Definition
gpu_shader_material_quaternion_to_rotation.bsl.hh:10
is_zero
bool is_zero(float3x3 a)
Definition
gpu_shader_math_matrix_compare.bsl.hh:16
gpu_shader_math_vector_compare.bsl.hh
x
uint x
Definition
kernel/device/gpu/kernel.h:142
float4
Definition
sky_math.h:224
Generated on
for Blender by
doxygen
1.18.0