MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / interpolate_with

Method interpolate_with

core/math/transform_3d.cpp:100–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100Transform3D Transform3D::interpolate_with(const Transform3D &p_transform, real_t p_c) const {
101 Transform3D interp;
102
103 Vector3 src_scale = basis.get_scale();
104 Quaternion src_rot = basis.get_rotation_quaternion();
105 Vector3 src_loc = origin;
106
107 Vector3 dst_scale = p_transform.basis.get_scale();
108 Quaternion dst_rot = p_transform.basis.get_rotation_quaternion();
109 Vector3 dst_loc = p_transform.origin;
110
111 interp.basis.set_quaternion_scale(src_rot.slerp(dst_rot, p_c).normalized(), src_scale.lerp(dst_scale, p_c));
112 interp.origin = src_loc.lerp(dst_loc, p_c);
113
114 return interp;
115}
116
117void Transform3D::scale(const Vector3 &p_scale) {
118 basis.scale(p_scale);

Callers 15

_update_scrollMethod · 0.45
execute_modificationsMethod · 0.45
blend_variantMethod · 0.45
interpolate_variantMethod · 0.45
_process_modifiersMethod · 0.45
_process_copyMethod · 0.45
_process_convertMethod · 0.45
_retarget_global_poseMethod · 0.45
_retarget_poseMethod · 0.45
lerpMethod · 0.45

Calls 6

set_quaternion_scaleMethod · 0.80
get_scaleMethod · 0.45
normalizedMethod · 0.45
slerpMethod · 0.45
lerpMethod · 0.45

Tested by

no test coverage detected