You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
-Changed KinematicBody API yet again to make it friendlier
-Fixed get_scale functions (and added set_scale) to make it more coherent when decomposing and composing (fixes bugs in transform interpolation)
This commit is contained in:
@@ -118,17 +118,17 @@ Transform Transform::interpolate_with(const Transform &p_transform, real_t p_c)
|
||||
|
||||
/* not sure if very "efficient" but good enough? */
|
||||
|
||||
Vector3 src_scale = basis.get_scale();
|
||||
Quat src_rot = basis;
|
||||
Vector3 src_scale = basis.get_signed_scale();
|
||||
Quat src_rot = basis.orthonormalized();
|
||||
Vector3 src_loc = origin;
|
||||
|
||||
Vector3 dst_scale = p_transform.basis.get_scale();
|
||||
Vector3 dst_scale = p_transform.basis.get_signed_scale();
|
||||
Quat dst_rot = p_transform.basis;
|
||||
Vector3 dst_loc = p_transform.origin;
|
||||
|
||||
Transform dst;
|
||||
dst.basis = src_rot.slerp(dst_rot, p_c);
|
||||
dst.basis.scale(src_scale.linear_interpolate(dst_scale, p_c));
|
||||
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);
|
||||
|
||||
return dst;
|
||||
|
||||
Reference in New Issue
Block a user