| 98 | } |
| 99 | |
| 100 | Transform3D 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 | |
| 117 | void Transform3D::scale(const Vector3 &p_scale) { |
| 118 | basis.scale(p_scale); |
no test coverage detected