Skip to content

Commit

Permalink
Merge pull request #70707 from mihe/bind-physics-exclude
Browse files Browse the repository at this point in the history
Bind methods related to physics query exclusions
  • Loading branch information
akien-mga authored Jan 11, 2023
2 parents 87efd0b + ba8af83 commit 9c02bf1
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/classes/PhysicsDirectSpaceState2DExtension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,11 @@
<description>
</description>
</method>
<method name="is_body_excluded_from_query" qualifiers="const">
<return type="bool" />
<param index="0" name="body" type="RID" />
<description>
</description>
</method>
</methods>
</class>
6 changes: 6 additions & 0 deletions doc/classes/PhysicsDirectSpaceState3DExtension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,11 @@
<description>
</description>
</method>
<method name="is_body_excluded_from_query" qualifiers="const">
<return type="bool" />
<param index="0" name="body" type="RID" />
<description>
</description>
</method>
</methods>
</class>
12 changes: 12 additions & 0 deletions doc/classes/PhysicsServer2DExtension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -933,5 +933,17 @@
<description>
</description>
</method>
<method name="body_test_motion_is_excluding_body" qualifiers="const">
<return type="bool" />
<param index="0" name="body" type="RID" />
<description>
</description>
</method>
<method name="body_test_motion_is_excluding_object" qualifiers="const">
<return type="bool" />
<param index="0" name="object" type="int" />
<description>
</description>
</method>
</methods>
</class>
12 changes: 12 additions & 0 deletions doc/classes/PhysicsServer3DExtension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1284,5 +1284,17 @@
<description>
</description>
</method>
<method name="body_test_motion_is_excluding_body" qualifiers="const">
<return type="bool" />
<param index="0" name="body" type="RID" />
<description>
</description>
</method>
<method name="body_test_motion_is_excluding_object" qualifiers="const">
<return type="bool" />
<param index="0" name="object" type="int" />
<description>
</description>
</method>
</methods>
</class>
5 changes: 5 additions & 0 deletions servers/extensions/physics_server_2d_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ bool PhysicsDirectSpaceState2DExtension::is_body_excluded_from_query(const RID &
thread_local const HashSet<RID> *PhysicsDirectSpaceState2DExtension::exclude = nullptr;

void PhysicsDirectSpaceState2DExtension::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_body_excluded_from_query", "body"), &PhysicsDirectSpaceState2DExtension::is_body_excluded_from_query);

GDVIRTUAL_BIND(_intersect_ray, "from", "to", "collision_mask", "collide_with_bodies", "collide_with_areas", "hit_from_inside", "result");
GDVIRTUAL_BIND(_intersect_point, "position", "canvas_instance_id", "collision_mask", "collide_with_bodies", "collide_with_areas", "results", "max_results");
GDVIRTUAL_BIND(_intersect_shape, "shape_rid", "transform", "motion", "margin", "collision_mask", "collide_with_bodies", "collide_with_areas", "result", "max_results");
Expand Down Expand Up @@ -203,6 +205,9 @@ void PhysicsServer2DExtension::_bind_methods() {

/* BODY API */

ClassDB::bind_method(D_METHOD("body_test_motion_is_excluding_body", "body"), &PhysicsServer2DExtension::body_test_motion_is_excluding_body);
ClassDB::bind_method(D_METHOD("body_test_motion_is_excluding_object", "object"), &PhysicsServer2DExtension::body_test_motion_is_excluding_object);

GDVIRTUAL_BIND(_body_create);

GDVIRTUAL_BIND(_body_set_space, "body", "space");
Expand Down
5 changes: 5 additions & 0 deletions servers/extensions/physics_server_3d_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ bool PhysicsDirectSpaceState3DExtension::is_body_excluded_from_query(const RID &
thread_local const HashSet<RID> *PhysicsDirectSpaceState3DExtension::exclude = nullptr;

void PhysicsDirectSpaceState3DExtension::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_body_excluded_from_query", "body"), &PhysicsDirectSpaceState3DExtension::is_body_excluded_from_query);

GDVIRTUAL_BIND(_intersect_ray, "from", "to", "collision_mask", "collide_with_bodies", "collide_with_areas", "hit_from_inside", "hit_back_faces", "result");
GDVIRTUAL_BIND(_intersect_point, "position", "collision_mask", "collide_with_bodies", "collide_with_areas", "results", "max_results");
GDVIRTUAL_BIND(_intersect_shape, "shape_rid", "transform", "motion", "margin", "collision_mask", "collide_with_bodies", "collide_with_areas", "result_count", "max_results");
Expand Down Expand Up @@ -206,6 +208,9 @@ void PhysicsServer3DExtension::_bind_methods() {

/* BODY API */

ClassDB::bind_method(D_METHOD("body_test_motion_is_excluding_body", "body"), &PhysicsServer3DExtension::body_test_motion_is_excluding_body);
ClassDB::bind_method(D_METHOD("body_test_motion_is_excluding_object", "object"), &PhysicsServer3DExtension::body_test_motion_is_excluding_object);

GDVIRTUAL_BIND(_body_create);

GDVIRTUAL_BIND(_body_set_space, "body", "space");
Expand Down

0 comments on commit 9c02bf1

Please sign in to comment.