From 08272585e9daa3dfb4988e7f495212ffe5979bfc Mon Sep 17 00:00:00 2001 From: "Andrii Doroshenko (Xrayez)" Date: Sun, 1 Sep 2019 14:34:51 +0300 Subject: [PATCH] Remove redundant transform method in Geometry singleton Transform2D's xform method can be used instead which handles `PoolVector2Array` now (as well as 3D version). --- core/bind/core_bind.cpp | 7 ------- core/bind/core_bind.h | 2 -- core/math/geometry.h | 10 ---------- doc/classes/Geometry.xml | 12 ------------ 4 files changed, 31 deletions(-) diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index ce0f47de9c4..5161f8bab20 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -1689,11 +1689,6 @@ Array _Geometry::offset_polyline_2d(const Vector &p_polygon, real_t p_d return ret; } -Vector _Geometry::transform_points_2d(const Vector &p_points, const Transform2D &p_mat) { - - return Geometry::transform_points_2d(p_points, p_mat); -} - Dictionary _Geometry::make_atlas(const Vector &p_rects) { Dictionary ret; @@ -1773,8 +1768,6 @@ void _Geometry::_bind_methods() { ClassDB::bind_method(D_METHOD("offset_polygon_2d", "polygon", "delta", "join_type"), &_Geometry::offset_polygon_2d, DEFVAL(JOIN_SQUARE)); ClassDB::bind_method(D_METHOD("offset_polyline_2d", "polyline", "delta", "join_type", "end_type"), &_Geometry::offset_polyline_2d, DEFVAL(JOIN_SQUARE), DEFVAL(END_SQUARE)); - ClassDB::bind_method(D_METHOD("transform_points_2d", "points", "transform"), &_Geometry::transform_points_2d); - ClassDB::bind_method(D_METHOD("make_atlas", "sizes"), &_Geometry::make_atlas); BIND_ENUM_CONSTANT(OPERATION_UNION); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 561bba53c97..693b85710a7 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -434,8 +434,6 @@ public: Array offset_polygon_2d(const Vector &p_polygon, real_t p_delta, PolyJoinType p_join_type = JOIN_SQUARE); Array offset_polyline_2d(const Vector &p_polygon, real_t p_delta, PolyJoinType p_join_type = JOIN_SQUARE, PolyEndType p_end_type = END_SQUARE); - Vector transform_points_2d(const Vector &p_points, const Transform2D &p_mat); - Dictionary make_atlas(const Vector &p_rects); _Geometry(); diff --git a/core/math/geometry.h b/core/math/geometry.h index b512cfce804..8b0a51c6517 100644 --- a/core/math/geometry.h +++ b/core/math/geometry.h @@ -832,16 +832,6 @@ public: return _polypath_offset(p_polygon, p_delta, p_join_type, p_end_type); } - static Vector transform_points_2d(const Vector &p_points, const Transform2D &p_mat) { - - Vector points; - - for (int i = 0; i < p_points.size(); ++i) { - points.push_back(p_mat.xform(p_points[i])); - } - return points; - } - static Vector triangulate_delaunay_2d(const Vector &p_points) { Vector tr = Delaunay2D::triangulate(p_points); diff --git a/doc/classes/Geometry.xml b/doc/classes/Geometry.xml index 5c5be6c44fa..3824baa4dc8 100644 --- a/doc/classes/Geometry.xml +++ b/doc/classes/Geometry.xml @@ -441,18 +441,6 @@ Tests if the segment ([code]from[/code], [code]to[/code]) intersects the triangle [code]a[/code], [code]b[/code], [code]c[/code]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, an empty [Variant] is returned. - - - - - - - - - Transforms an array of points by [code]transform[/code] and returns the result. - Can be useful in conjunction with performing polygon boolean operations in a CSG-like manner, see [method merge_polygons_2d], [method clip_polygons_2d], [method intersect_polygons_2d], [method exclude_polygons_2d]. - -