diff options
author | Mikael Hermansson <mikael@hermansson.io> | 2023-03-02 17:48:08 +0100 |
---|---|---|
committer | Mikael Hermansson <mikael@hermansson.io> | 2023-03-02 18:00:03 +0100 |
commit | fb3454a3ec6d0559ccd4404b61df50b6fe1cbfcd (patch) | |
tree | a4c7ac519f0a9d330256c07baa905ef228eefba7 | |
parent | 31eccb5501ddc92b4a17fd6ae33dca4ad217702c (diff) | |
download | redot-engine-fb3454a3ec6d0559ccd4404b61df50b6fe1cbfcd.tar.gz |
Add `pick_ray` parameter to extension binding of `intersect_ray`
-rw-r--r-- | doc/classes/PhysicsDirectSpaceState3DExtension.xml | 3 | ||||
-rw-r--r-- | servers/extensions/physics_server_3d_extension.cpp | 2 | ||||
-rw-r--r-- | servers/extensions/physics_server_3d_extension.h | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/doc/classes/PhysicsDirectSpaceState3DExtension.xml b/doc/classes/PhysicsDirectSpaceState3DExtension.xml index 8c21cd5145..64089489c0 100644 --- a/doc/classes/PhysicsDirectSpaceState3DExtension.xml +++ b/doc/classes/PhysicsDirectSpaceState3DExtension.xml @@ -64,7 +64,8 @@ <param index="4" name="collide_with_areas" type="bool" /> <param index="5" name="hit_from_inside" type="bool" /> <param index="6" name="hit_back_faces" type="bool" /> - <param index="7" name="result" type="PhysicsServer3DExtensionRayResult*" /> + <param index="7" name="pick_ray" type="bool" /> + <param index="8" name="result" type="PhysicsServer3DExtensionRayResult*" /> <description> </description> </method> diff --git a/servers/extensions/physics_server_3d_extension.cpp b/servers/extensions/physics_server_3d_extension.cpp index 0d8476fd68..bea9abf328 100644 --- a/servers/extensions/physics_server_3d_extension.cpp +++ b/servers/extensions/physics_server_3d_extension.cpp @@ -39,7 +39,7 @@ thread_local const HashSet<RID> *PhysicsDirectSpaceState3DExtension::exclude = n 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_ray, "from", "to", "collision_mask", "collide_with_bodies", "collide_with_areas", "hit_from_inside", "hit_back_faces", "pick_ray", "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"); GDVIRTUAL_BIND(_cast_motion, "shape_rid", "transform", "motion", "margin", "collision_mask", "collide_with_bodies", "collide_with_areas", "closest_safe", "closest_unsafe", "info"); diff --git a/servers/extensions/physics_server_3d_extension.h b/servers/extensions/physics_server_3d_extension.h index bec403c0ec..6c5dd38714 100644 --- a/servers/extensions/physics_server_3d_extension.h +++ b/servers/extensions/physics_server_3d_extension.h @@ -128,7 +128,7 @@ protected: static void _bind_methods(); bool is_body_excluded_from_query(const RID &p_body) const; - GDVIRTUAL8R(bool, _intersect_ray, const Vector3 &, const Vector3 &, uint32_t, bool, bool, bool, bool, GDExtensionPtr<PhysicsServer3DExtensionRayResult>) + GDVIRTUAL9R(bool, _intersect_ray, const Vector3 &, const Vector3 &, uint32_t, bool, bool, bool, bool, bool, GDExtensionPtr<PhysicsServer3DExtensionRayResult>) GDVIRTUAL6R(int, _intersect_point, const Vector3 &, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer3DExtensionShapeResult>, int) GDVIRTUAL9R(int, _intersect_shape, RID, const Transform3D &, const Vector3 &, real_t, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer3DExtensionShapeResult>, int) GDVIRTUAL10R(bool, _cast_motion, RID, const Transform3D &, const Vector3 &, real_t, uint32_t, bool, bool, GDExtensionPtr<real_t>, GDExtensionPtr<real_t>, GDExtensionPtr<PhysicsServer3DExtensionShapeRestInfo>) @@ -140,7 +140,7 @@ public: virtual bool intersect_ray(const RayParameters &p_parameters, RayResult &r_result) override { exclude = &p_parameters.exclude; bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_intersect_ray, p_parameters.from, p_parameters.to, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, p_parameters.hit_from_inside, p_parameters.hit_back_faces, &r_result, ret); + GDVIRTUAL_REQUIRED_CALL(_intersect_ray, p_parameters.from, p_parameters.to, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, p_parameters.hit_from_inside, p_parameters.hit_back_faces, p_parameters.pick_ray, &r_result, ret); exclude = nullptr; return ret; } |