diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-02-14 12:09:52 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-02-14 12:10:15 -0300 |
commit | c5f509f238576dba39ffcce74ab2066f24e67b58 (patch) | |
tree | 888a1bc97d9fdf303a663e626599f74fb268dbff /core/bind/core_bind.cpp | |
parent | d0ea4754057663d2caefbabe32421fd597a8a15d (diff) |
New Navigation & Pathfinding support for 2D
-Added Navigation & NavigationPolygon nodes
-Added corresponding visual editor
-New pathfinding algorithm is modern and fast!
-Similar API to 3D Pathfinding (more coherent)
Diffstat (limited to 'core/bind/core_bind.cpp')
-rw-r--r-- | core/bind/core_bind.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 0c5d21b4f6..a03fd7fe4a 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -838,6 +838,12 @@ Variant _Geometry::segment_intersects_triangle( const Vector3& p_from, const Vec return Variant(); } + +bool _Geometry::point_is_inside_triangle(const Vector2& s, const Vector2& a, const Vector2& b, const Vector2& c) const { + + return Geometry::is_point_in_triangle(s,a,b,c); +} + DVector<Vector3> _Geometry::segment_intersects_sphere( const Vector3& p_from, const Vector3& p_to, const Vector3& p_sphere_pos,real_t p_sphere_radius) { DVector<Vector3> r; @@ -938,6 +944,7 @@ void _Geometry::_bind_methods() { ObjectTypeDB::bind_method(_MD("segment_intersects_sphere","from","to","spos","sradius"),&_Geometry::segment_intersects_sphere); ObjectTypeDB::bind_method(_MD("segment_intersects_cylinder","from","to","height","radius"),&_Geometry::segment_intersects_cylinder); ObjectTypeDB::bind_method(_MD("segment_intersects_convex","from","to","planes"),&_Geometry::segment_intersects_convex); + ObjectTypeDB::bind_method(_MD("point_is_inside_triangle","point","a","b","c"),&_Geometry::point_is_inside_triangle); ObjectTypeDB::bind_method(_MD("triangulate_polygon","polygon"),&_Geometry::triangulate_polygon); |