diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-09-01 12:59:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-01 12:59:49 +0200 |
commit | 69de1eca01507c49141de2485e64861ca3e368ee (patch) | |
tree | 8bf5b7fbfe77b76df43d9fefc3fcc9b8c487f558 /core/bind/core_bind.cpp | |
parent | 815055a29b3b459c170d794253b14953065281f5 (diff) | |
parent | 6cc54a58647454850c5475f6759c1bbbb76d68d3 (diff) |
Merge pull request #31667 from YeldhamDev/geometry_point_circle_cleanup
Add 'is_point_in_circle()' to Geometry class, and general file cleanup
Diffstat (limited to 'core/bind/core_bind.cpp')
-rw-r--r-- | core/bind/core_bind.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index b5e84d49a0..ce0f47de9c 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -1432,6 +1432,11 @@ PoolVector<Plane> _Geometry::build_capsule_planes(float p_radius, float p_height return Geometry::build_capsule_planes(p_radius, p_height, p_sides, p_lats, p_axis); } +bool _Geometry::is_point_in_circle(const Vector2 &p_point, const Vector2 &p_circle_pos, real_t p_circle_radius) { + + return Geometry::is_point_in_circle(p_point, p_circle_pos, p_circle_radius); +} + real_t _Geometry::segment_intersects_circle(const Vector2 &p_from, const Vector2 &p_to, const Vector2 &p_circle_pos, real_t p_circle_radius) { return Geometry::segment_intersects_circle(p_from, p_to, p_circle_pos, p_circle_radius); @@ -1727,6 +1732,7 @@ void _Geometry::_bind_methods() { ClassDB::bind_method(D_METHOD("build_box_planes", "extents"), &_Geometry::build_box_planes); ClassDB::bind_method(D_METHOD("build_cylinder_planes", "radius", "height", "sides", "axis"), &_Geometry::build_cylinder_planes, DEFVAL(Vector3::AXIS_Z)); ClassDB::bind_method(D_METHOD("build_capsule_planes", "radius", "height", "sides", "lats", "axis"), &_Geometry::build_capsule_planes, DEFVAL(Vector3::AXIS_Z)); + ClassDB::bind_method(D_METHOD("is_point_in_circle", "point", "circle_position", "circle_radius"), &_Geometry::is_point_in_circle); ClassDB::bind_method(D_METHOD("segment_intersects_circle", "segment_from", "segment_to", "circle_position", "circle_radius"), &_Geometry::segment_intersects_circle); ClassDB::bind_method(D_METHOD("segment_intersects_segment_2d", "from_a", "to_a", "from_b", "to_b"), &_Geometry::segment_intersects_segment_2d); ClassDB::bind_method(D_METHOD("line_intersects_line_2d", "from_a", "dir_a", "from_b", "dir_b"), &_Geometry::line_intersects_line_2d); |