From ae282e9b7d06f97b2b228860525c67fcca36326c Mon Sep 17 00:00:00 2001 From: Anthony Cossins <1451668+anthonyec@users.noreply.github.com> Date: Sun, 12 Feb 2023 22:46:18 +0000 Subject: Fix return type for collide_shape to use PackedVector3Array --- servers/physics_server_3d.cpp | 6 +++--- servers/physics_server_3d.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'servers') diff --git a/servers/physics_server_3d.cpp b/servers/physics_server_3d.cpp index 6a163c86d2..c9cf8f99af 100644 --- a/servers/physics_server_3d.cpp +++ b/servers/physics_server_3d.cpp @@ -429,7 +429,7 @@ Vector PhysicsDirectSpaceState3D::_cast_motion(const Ref PhysicsDirectSpaceState3D::_collide_shape(const Ref &p_shape_query, int p_max_results) { +TypedArray PhysicsDirectSpaceState3D::_collide_shape(const Ref &p_shape_query, int p_max_results) { ERR_FAIL_COND_V(!p_shape_query.is_valid(), Array()); Vector ret; @@ -437,9 +437,9 @@ TypedArray PhysicsDirectSpaceState3D::_collide_shape(const R int rc = 0; bool res = collide_shape(p_shape_query->get_parameters(), ret.ptrw(), p_max_results, rc); if (!res) { - return TypedArray(); + return TypedArray(); } - TypedArray r; + TypedArray r; r.resize(rc * 2); for (int i = 0; i < rc * 2; i++) { r[i] = ret[i]; diff --git a/servers/physics_server_3d.h b/servers/physics_server_3d.h index abf22e68a4..2c7ebeea66 100644 --- a/servers/physics_server_3d.h +++ b/servers/physics_server_3d.h @@ -125,7 +125,7 @@ private: TypedArray _intersect_point(const Ref &p_point_query, int p_max_results = 32); TypedArray _intersect_shape(const Ref &p_shape_query, int p_max_results = 32); Vector _cast_motion(const Ref &p_shape_query); - TypedArray _collide_shape(const Ref &p_shape_query, int p_max_results = 32); + TypedArray _collide_shape(const Ref &p_shape_query, int p_max_results = 32); Dictionary _get_rest_info(const Ref &p_shape_query); protected: -- cgit v1.2.3