From 6f1c99e5b430adbb7f52922fb43ea0fde2a8e7cc Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Mon, 27 Jul 2020 10:35:15 +0100 Subject: [PATCH] Clarify the difference between contacts and collisions. --- doc/classes/RigidBody2D.xml | 13 +++++++------ doc/classes/RigidBody3D.xml | 15 ++++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml index d56dc1e17c15..a7efba518c6f 100644 --- a/doc/classes/RigidBody2D.xml +++ b/doc/classes/RigidBody2D.xml @@ -84,7 +84,7 @@ - Returns a list of the bodies colliding with this one. Use [member contacts_reported] to set the maximum number reported. You must also set [member contact_monitor] to [code]true[/code]. + Returns a list of the bodies colliding with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. [b]Note:[/b] The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead. @@ -133,7 +133,8 @@ If [code]true[/code], the body will emit signals when it collides with another RigidBody2D. See also [member contacts_reported]. - The maximum number of contacts to report. + The maximum number of contacts that will be recorded. Requires [member contact_monitor] to be set to [code]true[/code]. + [b]Note:[/b] The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner). Continuous collision detection mode. @@ -176,14 +177,14 @@ - Emitted when a body enters into contact with this one. [member contact_monitor] must be [code]true[/code] and [member contacts_reported] greater than [code]0[/code]. + Emitted when a body enters into contact with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. - Emitted when a body exits contact with this one. [member contact_monitor] must be [code]true[/code] and [member contacts_reported] greater than [code]0[/code]. + Emitted when a body exits contact with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. @@ -196,7 +197,7 @@ - Emitted when a body enters into contact with this one. Reports colliding shape information. See [CollisionObject2D] for shape index information. [member contact_monitor] must be [code]true[/code] and [member contacts_reported] greater than [code]0[/code]. + Emitted when a body enters into contact with this one. Reports colliding shape information. See [CollisionObject2D] for shape index information. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. @@ -209,7 +210,7 @@ - Emitted when a body shape exits contact with this one. Reports colliding shape information. See [CollisionObject2D] for shape index information. [member contact_monitor] must be [code]true[/code] and [member contacts_reported] greater than [code]0[/code]. + Emitted when a body shape exits contact with this one. Reports colliding shape information. See [CollisionObject2D] for shape index information. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. diff --git a/doc/classes/RigidBody3D.xml b/doc/classes/RigidBody3D.xml index 370e6bd19cfa..933885ba778d 100644 --- a/doc/classes/RigidBody3D.xml +++ b/doc/classes/RigidBody3D.xml @@ -96,7 +96,7 @@ - Returns a list of the bodies colliding with this one. By default, number of max contacts reported is at 0, see the [member contacts_reported] property to increase it. + Returns a list of the bodies colliding with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. [b]Note:[/b] The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead. @@ -157,10 +157,11 @@ If [code]true[/code], the body can enter sleep mode when there is no movement. See [member sleeping]. - If [code]true[/code], the RigidBody3D will emit signals when it collides with another RigidBody3D. + If [code]true[/code], the RigidBody3D will emit signals when it collides with another RigidBody3D. See also [member contacts_reported]. - The maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0. + The maximum number of contacts that will be recorded. Requires [member contact_monitor] to be set to [code]true[/code]. + [b]Note:[/b] The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner). If [code]true[/code], continuous collision detection is used. @@ -200,14 +201,14 @@ - Emitted when a body enters into contact with this one. Contact monitor and contacts reported must be enabled for this to work. + Emitted when a body enters into contact with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. - Emitted when a body shape exits contact with this one. Contact monitor and contacts reported must be enabled for this to work. + Emitted when a body shape exits contact with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. @@ -220,7 +221,7 @@ - Emitted when a body enters into contact with this one. Contact monitor and contacts reported must be enabled for this to work. + Emitted when a body enters into contact with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. This signal not only receives the body that collided with this one, but also its [RID] ([code]body_id[/code]), the shape index from the colliding body ([code]body_shape[/code]), and the shape index from this body ([code]local_shape[/code]) the other body collided with. @@ -234,7 +235,7 @@ - Emitted when a body shape exits contact with this one. Contact monitor and contacts reported must be enabled for this to work. + Emitted when a body shape exits contact with this one. Requires [member contact_monitor] to be set to [code]true[/code] and [member contacts_reported] to be set high enough to detect all the collisions. This signal not only receives the body that stopped colliding with this one, but also its [RID] ([code]body_id[/code]), the shape index from the colliding body ([code]body_shape[/code]), and the shape index from this body ([code]local_shape[/code]) the other body stopped colliding with.