Blender V5.3
gpu_shader_math_rotation.bsl.hh File Reference

Go to the source code of this file.

Functions

Interpolate
float2 interpolate_dot_slerp (float t, float cosom)
Quaternion interpolate (Quaternion a, Quaternion b, float t)
float3 spherical_interpolate (float3 a, float3 b, float t)
Rotate
float3x3 rotate (float3x3 mat, AxisAngle rotation)
float3x3 rotate (float3x3 mat, EulerXYZ rotation)
float4x4 rotate (float4x4 mat, AxisAngle rotation)
float4x4 rotate (float4x4 mat, EulerXYZ rotation)

Function Documentation

◆ interpolate()

◆ interpolate_dot_slerp()

float2 interpolate_dot_slerp ( float t,
float cosom )

Generic function for implementing slerp (quaternions and spherical vector coords).

Parameters
tfactor in [0..1]
cosomdot product from normalized vectors/quaternions.
Returns
calculated weights.

Definition at line 24 of file gpu_shader_math_rotation.bsl.hh.

References abs, acos, eps, interpolate_dot_slerp(), sin, and w().

Referenced by interpolate(), interpolate_dot_slerp(), and spherical_interpolate().

◆ rotate() [1/4]

◆ rotate() [2/4]

float3x3 rotate ( float3x3 mat,
EulerXYZ rotation )

Equivalent to mat * from_rotation(rotation) but with fewer operation. Optimized for rotation on basis vector (i.e: AxisAngle({1, 0, 0}, 0.2f)).

Definition at line 109 of file gpu_shader_math_rotation.bsl.hh.

References from_rotation(), and rotate().

◆ rotate() [3/4]

float4x4 rotate ( float4x4 mat,
AxisAngle rotation )

Equivalent to mat * from_rotation(rotation) but with fewer operation. Optimized for rotation on basis vector (i.e: AxisAngle({1, 0, 0}, 0.2f)).

Definition at line 131 of file gpu_shader_math_rotation.bsl.hh.

References rotate().

◆ rotate() [4/4]

float4x4 rotate ( float4x4 mat,
EulerXYZ rotation )

Equivalent to mat * from_rotation(rotation) but with fewer operation. Optimized for rotation on basis vector (i.e: AxisAngle({1, 0, 0}, 0.2f)).

Definition at line 147 of file gpu_shader_math_rotation.bsl.hh.

References rotate().

◆ spherical_interpolate()

float3 spherical_interpolate ( float3 a,
float3 b,
float t )