summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorPoommetee Ketson <poommetee@protonmail.com>2017-11-06 09:09:08 +0700
committerGitHub <noreply@github.com>2017-11-06 09:09:08 +0700
commitb6db04993f6f50b1bf9c60f8b54288d3ee0be62d (patch)
tree7f96ff5d41dc9e896107279365d4d3d8d3364a1b /core
parent9a78efc7c270211e49fd7b2f071b61c706febffc (diff)
parent7ec32b6d09c0a7302bcc0c54be41bf65a7911838 (diff)
Merge pull request #12646 from poke1024/geomdocs
Basic docs for Geometry plus two new functions
Diffstat (limited to 'core')
-rw-r--r--core/bind/core_bind.cpp12
-rw-r--r--core/bind/core_bind.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 12b892d873..c369f4bffe 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -1316,6 +1316,16 @@ Vector<int> _Geometry::triangulate_polygon(const Vector<Vector2> &p_polygon) {
return Geometry::triangulate_polygon(p_polygon);
}
+Vector<Point2> _Geometry::convex_hull_2d(const Vector<Point2> &p_points) {
+
+ return Geometry::convex_hull_2d(p_points);
+}
+
+Vector<Vector3> _Geometry::clip_polygon(const Vector<Vector3> &p_points, const Plane &p_plane) {
+
+ return Geometry::clip_polygon(p_points, p_plane);
+}
+
Dictionary _Geometry::make_atlas(const Vector<Size2> &p_rects) {
Dictionary ret;
@@ -1376,6 +1386,8 @@ void _Geometry::_bind_methods() {
ClassDB::bind_method(D_METHOD("point_is_inside_triangle", "point", "a", "b", "c"), &_Geometry::point_is_inside_triangle);
ClassDB::bind_method(D_METHOD("triangulate_polygon", "polygon"), &_Geometry::triangulate_polygon);
+ ClassDB::bind_method(D_METHOD("convex_hull_2d", "points"), &_Geometry::convex_hull_2d);
+ ClassDB::bind_method(D_METHOD("clip_polygon", "points", "plane"), &_Geometry::clip_polygon);
ClassDB::bind_method(D_METHOD("make_atlas", "sizes"), &_Geometry::make_atlas);
}
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index 7f8c734e36..bbbb40d926 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -363,6 +363,8 @@ public:
int get_uv84_normal_bit(const Vector3 &p_vector);
Vector<int> triangulate_polygon(const Vector<Vector2> &p_polygon);
+ Vector<Point2> convex_hull_2d(const Vector<Point2> &p_points);
+ Vector<Vector3> clip_polygon(const Vector<Vector3> &p_points, const Plane &p_plane);
Dictionary make_atlas(const Vector<Size2> &p_rects);