diff options
author | tagcup <tagcup@yahoo.com> | 2018-05-16 20:32:35 -0400 |
---|---|---|
committer | tagcup <tagcup@yahoo.com> | 2018-05-17 19:39:04 -0400 |
commit | 1bba6eeeb9f0898308e5b96f6f996c2fbabe55ee (patch) | |
tree | aad72201537119f20810b0e04a7b215a60731586 /core/math/transform.cpp | |
parent | ba134d44b8a5d87cf3694dd8858ec2a495bf6c11 (diff) | |
download | redot-engine-1bba6eeeb9f0898308e5b96f6f996c2fbabe55ee.tar.gz |
Removed incorrect Basis::set_scale().
Also added a missing constructor in Basis, and fixed usage of inverse and affine inverse in Transform.
Diffstat (limited to 'core/math/transform.cpp')
-rw-r--r-- | core/math/transform.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/core/math/transform.cpp b/core/math/transform.cpp index 7cd186ca60..9c26343f47 100644 --- a/core/math/transform.cpp +++ b/core/math/transform.cpp @@ -127,12 +127,11 @@ Transform Transform::interpolate_with(const Transform &p_transform, real_t p_c) Quat dst_rot = p_transform.basis; Vector3 dst_loc = p_transform.origin; - Transform dst; //this could be made faster by using a single function in Basis.. - dst.basis = src_rot.slerp(dst_rot, p_c).normalized(); - dst.basis.set_scale(src_scale.linear_interpolate(dst_scale, p_c)); - dst.origin = src_loc.linear_interpolate(dst_loc, p_c); + Transform interp; + interp.basis.set_quat_scale(src_rot.slerp(dst_rot, p_c).normalized(), src_scale.linear_interpolate(dst_scale, p_c)); + interp.origin = src_loc.linear_interpolate(dst_loc, p_c); - return dst; + return interp; } void Transform::scale(const Vector3 &p_scale) { |