Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add recovery_as_collision to extension binding of _body_test_motion #74707

Merged
merged 1 commit into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/classes/PhysicsServer3DExtension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,8 @@
<param index="3" name="margin" type="float" />
<param index="4" name="max_collisions" type="int" />
<param index="5" name="collide_separation_ray" type="bool" />
<param index="6" name="result" type="PhysicsServer3DExtensionMotionResult*" />
<param index="6" name="recovery_as_collision" type="bool" />
<param index="7" name="result" type="PhysicsServer3DExtensionMotionResult*" />
<description>
</description>
</method>
Expand Down
2 changes: 1 addition & 1 deletion servers/extensions/physics_server_3d_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void PhysicsServer3DExtension::_bind_methods() {

GDVIRTUAL_BIND(_body_set_ray_pickable, "body", "enable");

GDVIRTUAL_BIND(_body_test_motion, "body", "from", "motion", "margin", "max_collisions", "collide_separation_ray", "result");
GDVIRTUAL_BIND(_body_test_motion, "body", "from", "motion", "margin", "max_collisions", "collide_separation_ray", "recovery_as_collision", "result");

GDVIRTUAL_BIND(_body_get_direct_state, "body");

Expand Down
4 changes: 2 additions & 2 deletions servers/extensions/physics_server_3d_extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ class PhysicsServer3DExtension : public PhysicsServer3D {

EXBIND2(body_set_ray_pickable, RID, bool)

GDVIRTUAL7RC(bool, _body_test_motion, RID, const Transform3D &, const Vector3 &, real_t, int, bool, GDExtensionPtr<PhysicsServer3DExtensionMotionResult>)
GDVIRTUAL8RC(bool, _body_test_motion, RID, const Transform3D &, const Vector3 &, real_t, int, bool, bool, GDExtensionPtr<PhysicsServer3DExtensionMotionResult>)

thread_local static const HashSet<RID> *exclude_bodies;
thread_local static const HashSet<ObjectID> *exclude_objects;
Expand All @@ -394,7 +394,7 @@ class PhysicsServer3DExtension : public PhysicsServer3D {
bool ret = false;
exclude_bodies = &p_parameters.exclude_bodies;
exclude_objects = &p_parameters.exclude_objects;
GDVIRTUAL_REQUIRED_CALL(_body_test_motion, p_body, p_parameters.from, p_parameters.motion, p_parameters.margin, p_parameters.max_collisions, p_parameters.collide_separation_ray, r_result, ret);
GDVIRTUAL_REQUIRED_CALL(_body_test_motion, p_body, p_parameters.from, p_parameters.motion, p_parameters.margin, p_parameters.max_collisions, p_parameters.collide_separation_ray, p_parameters.recovery_as_collision, r_result, ret);
exclude_bodies = nullptr;
exclude_objects = nullptr;
return ret;
Expand Down