diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-08-31 13:08:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-31 13:08:39 +0200 |
commit | 46a568e0a7d437bcb1c6517d6531f9216d3f832a (patch) | |
tree | ec73768e027ba15de8cb320d9d8305d84e7e8c13 | |
parent | 7b63e5db1e3014b29202293b27ca2d690c13936d (diff) | |
parent | c139d9ef7deb2df51bf7e2dbdd4a312b3f67c97f (diff) |
Merge pull request #65131 from TokageItLab/transform-with
-rw-r--r-- | core/math/transform_3d.cpp | 13 | ||||
-rw-r--r-- | core/math/transform_3d.h | 1 | ||||
-rw-r--r-- | core/variant/variant_call.cpp | 1 | ||||
-rw-r--r-- | doc/classes/Transform3D.xml | 8 |
4 files changed, 1 insertions, 22 deletions
diff --git a/core/math/transform_3d.cpp b/core/math/transform_3d.cpp index a634faca9a..2de9e81b38 100644 --- a/core/math/transform_3d.cpp +++ b/core/math/transform_3d.cpp @@ -94,9 +94,7 @@ void Transform3D::set_look_at(const Vector3 &p_eye, const Vector3 &p_target, con origin = p_eye; } -Transform3D Transform3D::spherical_interpolate_with(const Transform3D &p_transform, real_t p_c) const { - /* not sure if very "efficient" but good enough? */ - +Transform3D Transform3D::interpolate_with(const Transform3D &p_transform, real_t p_c) const { Transform3D interp; Vector3 src_scale = basis.get_scale(); @@ -113,15 +111,6 @@ Transform3D Transform3D::spherical_interpolate_with(const Transform3D &p_transfo return interp; } -Transform3D Transform3D::interpolate_with(const Transform3D &p_transform, real_t p_c) const { - Transform3D interp; - - interp.basis = basis.lerp(p_transform.basis, p_c); - interp.origin = origin.lerp(p_transform.origin, p_c); - - return interp; -} - void Transform3D::scale(const Vector3 &p_scale) { basis.scale(p_scale); origin *= p_scale; diff --git a/core/math/transform_3d.h b/core/math/transform_3d.h index b572e90859..c62e4a7b0e 100644 --- a/core/math/transform_3d.h +++ b/core/math/transform_3d.h @@ -103,7 +103,6 @@ struct _NO_DISCARD_ Transform3D { void operator*=(const real_t p_val); Transform3D operator*(const real_t p_val) const; - Transform3D spherical_interpolate_with(const Transform3D &p_transform, real_t p_c) const; Transform3D interpolate_with(const Transform3D &p_transform, real_t p_c) const; _FORCE_INLINE_ Transform3D inverse_xform(const Transform3D &t) const { diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index 8af2a09111..a4bce979fe 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -1969,7 +1969,6 @@ static void _register_variant_builtin_methods() { bind_method(Transform3D, translated, sarray("offset"), varray()); bind_method(Transform3D, translated_local, sarray("offset"), varray()); bind_method(Transform3D, looking_at, sarray("target", "up"), varray(Vector3(0, 1, 0))); - bind_method(Transform3D, spherical_interpolate_with, sarray("xform", "weight"), varray()); bind_method(Transform3D, interpolate_with, sarray("xform", "weight"), varray()); bind_method(Transform3D, is_equal_approx, sarray("xform"), varray()); diff --git a/doc/classes/Transform3D.xml b/doc/classes/Transform3D.xml index 14aa72b80c..18b4f9e6f9 100644 --- a/doc/classes/Transform3D.xml +++ b/doc/classes/Transform3D.xml @@ -141,14 +141,6 @@ This can be seen as transforming with respect to the local frame. </description> </method> - <method name="spherical_interpolate_with" qualifiers="const"> - <return type="Transform3D" /> - <param index="0" name="xform" type="Transform3D" /> - <param index="1" name="weight" type="float" /> - <description> - Returns a transform spherically interpolated between this transform and another by a given [param weight] (on the range of 0.0 to 1.0). - </description> - </method> <method name="translated" qualifiers="const"> <return type="Transform3D" /> <param index="0" name="offset" type="Vector3" /> |