summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBernhard Liebl <Bernhard.Liebl@gmx.org>2017-11-05 00:46:32 +0100
committerBernhard Liebl <Bernhard.Liebl@gmx.org>2017-11-05 07:56:27 +0100
commit7ec32b6d09c0a7302bcc0c54be41bf65a7911838 (patch)
treee1ea7521cb0f8256c5537d0af9562d383c2b72f3 /core
parent3cbcf5c2ddadf1cd630137d6bd438634b8517b00 (diff)
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);