From ccac36a6e2dd7942172c4028c82011b553d2ed88 Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Fri, 2 Jul 2021 16:48:58 -0700 Subject: Remove unused PhysicsShapeQueryResult3D & PhysicsShapeQueryResult2D --- doc/classes/PhysicsShapeQueryParameters2D.xml | 2 +- doc/classes/PhysicsShapeQueryParameters3D.xml | 2 +- doc/classes/PhysicsShapeQueryResult2D.xml | 58 --------------------------- doc/classes/PhysicsShapeQueryResult3D.xml | 58 --------------------------- scene/register_scene_types.cpp | 2 - servers/physics_server_2d.cpp | 31 -------------- servers/physics_server_2d.h | 22 ---------- servers/physics_server_3d.cpp | 31 -------------- servers/physics_server_3d.h | 22 ---------- servers/register_server_types.cpp | 2 - 10 files changed, 2 insertions(+), 228 deletions(-) delete mode 100644 doc/classes/PhysicsShapeQueryResult2D.xml delete mode 100644 doc/classes/PhysicsShapeQueryResult3D.xml diff --git a/doc/classes/PhysicsShapeQueryParameters2D.xml b/doc/classes/PhysicsShapeQueryParameters2D.xml index 321a713e26..229a40638a 100644 --- a/doc/classes/PhysicsShapeQueryParameters2D.xml +++ b/doc/classes/PhysicsShapeQueryParameters2D.xml @@ -4,7 +4,7 @@ Parameters to be sent to a 2D shape physics query. - This class contains the shape and other parameters for 2D intersection/collision queries. See also [PhysicsShapeQueryResult2D]. + This class contains the shape and other parameters for 2D intersection/collision queries. diff --git a/doc/classes/PhysicsShapeQueryParameters3D.xml b/doc/classes/PhysicsShapeQueryParameters3D.xml index 52916a8418..9ca892acb3 100644 --- a/doc/classes/PhysicsShapeQueryParameters3D.xml +++ b/doc/classes/PhysicsShapeQueryParameters3D.xml @@ -4,7 +4,7 @@ Parameters to be sent to a 3D shape physics query. - This class contains the shape and other parameters for 3D intersection/collision queries. See also [PhysicsShapeQueryResult3D]. + This class contains the shape and other parameters for 3D intersection/collision queries. diff --git a/doc/classes/PhysicsShapeQueryResult2D.xml b/doc/classes/PhysicsShapeQueryResult2D.xml deleted file mode 100644 index 07b7bc90e2..0000000000 --- a/doc/classes/PhysicsShapeQueryResult2D.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - Result of a 2D shape query in [PhysicsServer2D]. - - - The result of a 2D shape query in [PhysicsServer2D]. See also [PhysicsShapeQueryParameters2D]. - - - - - - - - - Returns the number of objects that intersected with the shape. - - - - - - - - - Returns the [Object] that intersected with the shape at index [code]idx[/code]. - - - - - - - - - Returns the instance ID of the [Object] that intersected with the shape at index [code]idx[/code]. - - - - - - - - - Returns the child index of the object's [Shape2D] that intersected with the shape at index [code]idx[/code]. - - - - - - - - - Returns the [RID] of the object that intersected with the shape at index [code]idx[/code]. - - - - - - diff --git a/doc/classes/PhysicsShapeQueryResult3D.xml b/doc/classes/PhysicsShapeQueryResult3D.xml deleted file mode 100644 index d0ca227a68..0000000000 --- a/doc/classes/PhysicsShapeQueryResult3D.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - Result of a 3D shape query in [PhysicsServer3D]. - - - The result of a 3D shape query in [PhysicsServer3D]. See also [PhysicsShapeQueryParameters3D]. - - - - - - - - - Returns the number of objects that intersected with the shape. - - - - - - - - - Returns the [Object] that intersected with the shape at index [code]idx[/code]. - - - - - - - - - Returns the instance ID of the [Object] that intersected with the shape at index [code]idx[/code]. - - - - - - - - - Returns the child index of the object's [Shape3D] that intersected with the shape at index [code]idx[/code]. - - - - - - - - - Returns the [RID] of the object that intersected with the shape at index [code]idx[/code]. - - - - - - diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 85bd08529c..24a9b12733 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -937,14 +937,12 @@ void register_scene_types() { ClassDB::add_compatibility_class("Physics2DServerSW", "PhysicsServer2DSW"); ClassDB::add_compatibility_class("Physics2DServer", "PhysicsServer2D"); ClassDB::add_compatibility_class("Physics2DShapeQueryParameters", "PhysicsShapeQueryParameters2D"); - ClassDB::add_compatibility_class("Physics2DShapeQueryResult", "PhysicsShapeQueryResult2D"); ClassDB::add_compatibility_class("Physics2DTestMotionResult", "PhysicsTestMotionResult2D"); ClassDB::add_compatibility_class("PhysicsBody", "PhysicsBody3D"); ClassDB::add_compatibility_class("PhysicsDirectBodyState", "PhysicsDirectBodyState3D"); ClassDB::add_compatibility_class("PhysicsDirectSpaceState", "PhysicsDirectSpaceState3D"); ClassDB::add_compatibility_class("PhysicsServer", "PhysicsServer3D"); ClassDB::add_compatibility_class("PhysicsShapeQueryParameters", "PhysicsShapeQueryParameters3D"); - ClassDB::add_compatibility_class("PhysicsShapeQueryResult", "PhysicsShapeQueryResult3D"); ClassDB::add_compatibility_class("PinJoint", "PinJoint3D"); ClassDB::add_compatibility_class("PlaneShape", "WorldMarginShape3D"); ClassDB::add_compatibility_class("ProceduralSky", "Sky"); diff --git a/servers/physics_server_2d.cpp b/servers/physics_server_2d.cpp index 12200989fd..ec0ff57a5e 100644 --- a/servers/physics_server_2d.cpp +++ b/servers/physics_server_2d.cpp @@ -418,37 +418,6 @@ void PhysicsDirectSpaceState2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_rest_info", "shape"), &PhysicsDirectSpaceState2D::_get_rest_info); } -int PhysicsShapeQueryResult2D::get_result_count() const { - return result.size(); -} - -RID PhysicsShapeQueryResult2D::get_result_rid(int p_idx) const { - return result[p_idx].rid; -} - -ObjectID PhysicsShapeQueryResult2D::get_result_object_id(int p_idx) const { - return result[p_idx].collider_id; -} - -Object *PhysicsShapeQueryResult2D::get_result_object(int p_idx) const { - return result[p_idx].collider; -} - -int PhysicsShapeQueryResult2D::get_result_object_shape(int p_idx) const { - return result[p_idx].shape; -} - -PhysicsShapeQueryResult2D::PhysicsShapeQueryResult2D() { -} - -void PhysicsShapeQueryResult2D::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_result_count"), &PhysicsShapeQueryResult2D::get_result_count); - ClassDB::bind_method(D_METHOD("get_result_rid", "idx"), &PhysicsShapeQueryResult2D::get_result_rid); - ClassDB::bind_method(D_METHOD("get_result_object_id", "idx"), &PhysicsShapeQueryResult2D::get_result_object_id); - ClassDB::bind_method(D_METHOD("get_result_object", "idx"), &PhysicsShapeQueryResult2D::get_result_object); - ClassDB::bind_method(D_METHOD("get_result_object_shape", "idx"), &PhysicsShapeQueryResult2D::get_result_object_shape); -} - /////////////////////////////// Vector2 PhysicsTestMotionResult2D::get_motion() const { diff --git a/servers/physics_server_2d.h b/servers/physics_server_2d.h index 1059c197cc..6737aacaf0 100644 --- a/servers/physics_server_2d.h +++ b/servers/physics_server_2d.h @@ -92,8 +92,6 @@ public: PhysicsDirectBodyState2D(); }; -class PhysicsShapeQueryResult2D; - //used for script class PhysicsShapeQueryParameters2D : public RefCounted { GDCLASS(PhysicsShapeQueryParameters2D, RefCounted); @@ -203,26 +201,6 @@ public: PhysicsDirectSpaceState2D(); }; -class PhysicsShapeQueryResult2D : public RefCounted { - GDCLASS(PhysicsShapeQueryResult2D, RefCounted); - - Vector result; - - friend class PhysicsDirectSpaceState2D; - -protected: - static void _bind_methods(); - -public: - int get_result_count() const; - RID get_result_rid(int p_idx) const; - ObjectID get_result_object_id(int p_idx) const; - Object *get_result_object(int p_idx) const; - int get_result_object_shape(int p_idx) const; - - PhysicsShapeQueryResult2D(); -}; - class PhysicsTestMotionResult2D; class PhysicsServer2D : public Object { diff --git a/servers/physics_server_3d.cpp b/servers/physics_server_3d.cpp index 144b2e18cd..7a0253506c 100644 --- a/servers/physics_server_3d.cpp +++ b/servers/physics_server_3d.cpp @@ -365,37 +365,6 @@ void PhysicsDirectSpaceState3D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_rest_info", "shape"), &PhysicsDirectSpaceState3D::_get_rest_info); } -int PhysicsShapeQueryResult3D::get_result_count() const { - return result.size(); -} - -RID PhysicsShapeQueryResult3D::get_result_rid(int p_idx) const { - return result[p_idx].rid; -} - -ObjectID PhysicsShapeQueryResult3D::get_result_object_id(int p_idx) const { - return result[p_idx].collider_id; -} - -Object *PhysicsShapeQueryResult3D::get_result_object(int p_idx) const { - return result[p_idx].collider; -} - -int PhysicsShapeQueryResult3D::get_result_object_shape(int p_idx) const { - return result[p_idx].shape; -} - -PhysicsShapeQueryResult3D::PhysicsShapeQueryResult3D() { -} - -void PhysicsShapeQueryResult3D::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_result_count"), &PhysicsShapeQueryResult3D::get_result_count); - ClassDB::bind_method(D_METHOD("get_result_rid", "idx"), &PhysicsShapeQueryResult3D::get_result_rid); - ClassDB::bind_method(D_METHOD("get_result_object_id", "idx"), &PhysicsShapeQueryResult3D::get_result_object_id); - ClassDB::bind_method(D_METHOD("get_result_object", "idx"), &PhysicsShapeQueryResult3D::get_result_object); - ClassDB::bind_method(D_METHOD("get_result_object_shape", "idx"), &PhysicsShapeQueryResult3D::get_result_object_shape); -} - /////////////////////////////// Vector3 PhysicsTestMotionResult3D::get_motion() const { diff --git a/servers/physics_server_3d.h b/servers/physics_server_3d.h index 1fabedc6ad..78fc026747 100644 --- a/servers/physics_server_3d.h +++ b/servers/physics_server_3d.h @@ -94,8 +94,6 @@ public: PhysicsDirectBodyState3D(); }; -class PhysicsShapeQueryResult3D; - class PhysicsShapeQueryParameters3D : public RefCounted { GDCLASS(PhysicsShapeQueryParameters3D, RefCounted); friend class PhysicsDirectSpaceState3D; @@ -196,26 +194,6 @@ public: PhysicsDirectSpaceState3D(); }; -class PhysicsShapeQueryResult3D : public RefCounted { - GDCLASS(PhysicsShapeQueryResult3D, RefCounted); - - Vector result; - - friend class PhysicsDirectSpaceState3D; - -protected: - static void _bind_methods(); - -public: - int get_result_count() const; - RID get_result_rid(int p_idx) const; - ObjectID get_result_object_id(int p_idx) const; - Object *get_result_object(int p_idx) const; - int get_result_object_shape(int p_idx) const; - - PhysicsShapeQueryResult3D(); -}; - class RenderingServerHandler { public: virtual void set_vertex(int p_vertex_id, const void *p_vector3) = 0; diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index 4e309927bb..2118dca015 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -212,14 +212,12 @@ void register_server_types() { ClassDB::register_virtual_class(); ClassDB::register_virtual_class(); - ClassDB::register_virtual_class(); ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_virtual_class(); ClassDB::register_virtual_class(); - ClassDB::register_virtual_class(); ClassDB::register_class(); // Physics 2D -- cgit v1.2.3