summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-07-05 21:08:29 +0200
committerGitHub <noreply@github.com>2021-07-05 21:08:29 +0200
commit8cd1b59ea78f5145eae1762e2b1311c1a1b92cbc (patch)
tree5a1c767355f88f10636765b5cd00674386f6fd07
parent26b86c1074cdc1256492f73b1c168a823412af45 (diff)
parentccac36a6e2dd7942172c4028c82011b553d2ed88 (diff)
Merge pull request #50100 from nekomatata/remove-shape-query-result
Remove unused PhysicsShapeQueryResult3D & PhysicsShapeQueryResult2D
-rw-r--r--doc/classes/PhysicsShapeQueryParameters2D.xml2
-rw-r--r--doc/classes/PhysicsShapeQueryParameters3D.xml2
-rw-r--r--doc/classes/PhysicsShapeQueryResult2D.xml58
-rw-r--r--doc/classes/PhysicsShapeQueryResult3D.xml58
-rw-r--r--scene/register_scene_types.cpp2
-rw-r--r--servers/physics_server_2d.cpp31
-rw-r--r--servers/physics_server_2d.h22
-rw-r--r--servers/physics_server_3d.cpp31
-rw-r--r--servers/physics_server_3d.h22
-rw-r--r--servers/register_server_types.cpp2
10 files changed, 2 insertions, 228 deletions
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.
</brief_description>
<description>
- 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.
</description>
<tutorials>
</tutorials>
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.
</brief_description>
<description>
- 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.
</description>
<tutorials>
</tutorials>
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 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="PhysicsShapeQueryResult2D" inherits="RefCounted" version="4.0">
- <brief_description>
- Result of a 2D shape query in [PhysicsServer2D].
- </brief_description>
- <description>
- The result of a 2D shape query in [PhysicsServer2D]. See also [PhysicsShapeQueryParameters2D].
- </description>
- <tutorials>
- </tutorials>
- <methods>
- <method name="get_result_count" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Returns the number of objects that intersected with the shape.
- </description>
- </method>
- <method name="get_result_object" qualifiers="const">
- <return type="Object">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Returns the [Object] that intersected with the shape at index [code]idx[/code].
- </description>
- </method>
- <method name="get_result_object_id" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Returns the instance ID of the [Object] that intersected with the shape at index [code]idx[/code].
- </description>
- </method>
- <method name="get_result_object_shape" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Returns the child index of the object's [Shape2D] that intersected with the shape at index [code]idx[/code].
- </description>
- </method>
- <method name="get_result_rid" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Returns the [RID] of the object that intersected with the shape at index [code]idx[/code].
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
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 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="PhysicsShapeQueryResult3D" inherits="RefCounted" version="4.0">
- <brief_description>
- Result of a 3D shape query in [PhysicsServer3D].
- </brief_description>
- <description>
- The result of a 3D shape query in [PhysicsServer3D]. See also [PhysicsShapeQueryParameters3D].
- </description>
- <tutorials>
- </tutorials>
- <methods>
- <method name="get_result_count" qualifiers="const">
- <return type="int">
- </return>
- <description>
- Returns the number of objects that intersected with the shape.
- </description>
- </method>
- <method name="get_result_object" qualifiers="const">
- <return type="Object">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Returns the [Object] that intersected with the shape at index [code]idx[/code].
- </description>
- </method>
- <method name="get_result_object_id" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Returns the instance ID of the [Object] that intersected with the shape at index [code]idx[/code].
- </description>
- </method>
- <method name="get_result_object_shape" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Returns the child index of the object's [Shape3D] that intersected with the shape at index [code]idx[/code].
- </description>
- </method>
- <method name="get_result_rid" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <description>
- Returns the [RID] of the object that intersected with the shape at index [code]idx[/code].
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
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<PhysicsDirectSpaceState2D::ShapeResult> 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<PhysicsDirectSpaceState3D::ShapeResult> 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<PhysicsDirectBodyState2D>();
ClassDB::register_virtual_class<PhysicsDirectSpaceState2D>();
- ClassDB::register_virtual_class<PhysicsShapeQueryResult2D>();
ClassDB::register_class<PhysicsTestMotionResult2D>();
ClassDB::register_class<PhysicsShapeQueryParameters2D>();
ClassDB::register_class<PhysicsShapeQueryParameters3D>();
ClassDB::register_virtual_class<PhysicsDirectBodyState3D>();
ClassDB::register_virtual_class<PhysicsDirectSpaceState3D>();
- ClassDB::register_virtual_class<PhysicsShapeQueryResult3D>();
ClassDB::register_class<PhysicsTestMotionResult3D>();
// Physics 2D