diff options
author | Ricardo Buring <ricardo.buring@gmail.com> | 2023-03-23 15:59:41 +0100 |
---|---|---|
committer | Ricardo Buring <ricardo.buring@gmail.com> | 2023-03-23 16:16:23 +0100 |
commit | 61429a5f49f2509f631703886b8b3234701a0206 (patch) | |
tree | 2c44e9fa18c01ceb4ec9455791ad8c5ba05a1795 /servers/physics_server_2d.cpp | |
parent | b31d00a9144a481b25d078b1b3ed6ff55c0e3a48 (diff) | |
download | redot-engine-61429a5f49f2509f631703886b8b3234701a0206.tar.gz |
Fix collide_shape return type
Fix PhysicsDirectSpaceState3D::_collide_shape return type.
Also PhysicsDirectSpaceState2D::_collide_shape.
Diffstat (limited to 'servers/physics_server_2d.cpp')
-rw-r--r-- | servers/physics_server_2d.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/servers/physics_server_2d.cpp b/servers/physics_server_2d.cpp index f9a8d5f156..4ad83ef327 100644 --- a/servers/physics_server_2d.cpp +++ b/servers/physics_server_2d.cpp @@ -409,17 +409,17 @@ Vector<real_t> PhysicsDirectSpaceState2D::_cast_motion(const Ref<PhysicsShapeQue return ret; } -TypedArray<PackedVector2Array> PhysicsDirectSpaceState2D::_collide_shape(const Ref<PhysicsShapeQueryParameters2D> &p_shape_query, int p_max_results) { - ERR_FAIL_COND_V(!p_shape_query.is_valid(), Array()); +TypedArray<Vector2> PhysicsDirectSpaceState2D::_collide_shape(const Ref<PhysicsShapeQueryParameters2D> &p_shape_query, int p_max_results) { + ERR_FAIL_COND_V(!p_shape_query.is_valid(), TypedArray<Vector2>()); Vector<Vector2> ret; ret.resize(p_max_results * 2); int rc = 0; bool res = collide_shape(p_shape_query->get_parameters(), ret.ptrw(), p_max_results, rc); if (!res) { - return TypedArray<PackedVector2Array>(); + return TypedArray<Vector2>(); } - TypedArray<PackedVector2Array> r; + TypedArray<Vector2> r; r.resize(rc * 2); for (int i = 0; i < rc * 2; i++) { r[i] = ret[i]; |