Blender V5.3
gpu_shader_math_matrix_interpolate.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
12
13/* -------------------------------------------------------------------- */
16
17#if 0 /* TODO(@fclem): Implement */
30#endif
31
37{
38 float3 a_loc, b_loc;
39 float3 a_scale, b_scale;
40 Quaternion a_quat, b_quat;
41 to_loc_rot_scale(a, a_loc, a_quat, a_scale);
42 to_loc_rot_scale(b, b_loc, b_quat, b_scale);
43
44 float3 location = interpolate(a_loc, b_loc, t);
45 float3 scale = interpolate(a_scale, b_scale, t);
46 Quaternion rotation = interpolate(a_quat, b_quat, t);
47 return from_loc_rot_scale(location, rotation, scale);
48}
49
54/* TODO(fclem): Implement */
55// mat4x4 pseudo_invert(mat4x4 mat, float epsilon); /* Not implemented. Too complex to port. */
56
float3x3 scale(float3x3 mat, float2 scale)
float4x4 from_loc_rot_scale(float3 location, EulerXYZ rotation, float3 scale)
float4x4 interpolate_fast(float4x4 a, float4x4 b, float t)
Quaternion interpolate(Quaternion a, Quaternion b, float t)
void to_loc_rot_scale(float4x4 mat, float3 &r_location, EulerXYZ &r_rotation, float3 &r_scale)
MatBase< float, 4, 4 > float4x4