diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-07-27 12:04:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-27 12:04:55 +0200 |
commit | 08d3d06ed7bdfbc24ce8a2d5ec79567000f8849f (patch) | |
tree | 4a19d9449d6a18e899e006676e97130fbe489f23 /doc/classes/RigidBody2D.xml | |
parent | 8965ec124d6b2985537a53f8aad315b26358e4f8 (diff) | |
parent | 6f1c99e5b430adbb7f52922fb43ea0fde2a8e7cc (diff) |
Merge pull request #40749 from madmiraal/fix-9097
Clarify the difference between contacts and collisions.
Diffstat (limited to 'doc/classes/RigidBody2D.xml')
-rw-r--r-- | doc/classes/RigidBody2D.xml | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml index d56dc1e17c..a7efba518c 100644 --- a/doc/classes/RigidBody2D.xml +++ b/doc/classes/RigidBody2D.xml @@ -84,7 +84,7 @@ <return type="Node2D[]"> </return> <description> - 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. </description> </method> @@ -133,7 +133,8 @@ If [code]true[/code], the body will emit signals when it collides with another RigidBody2D. See also [member contacts_reported]. </member> <member name="contacts_reported" type="int" setter="set_max_contacts_reported" getter="get_max_contacts_reported" default="0"> - 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). </member> <member name="continuous_cd" type="int" setter="set_continuous_collision_detection_mode" getter="get_continuous_collision_detection_mode" enum="RigidBody2D.CCDMode" default="0"> Continuous collision detection mode. @@ -176,14 +177,14 @@ <argument index="0" name="body" type="Node"> </argument> <description> - 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. </description> </signal> <signal name="body_exited"> <argument index="0" name="body" type="Node"> </argument> <description> - 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. </description> </signal> <signal name="body_shape_entered"> @@ -196,7 +197,7 @@ <argument index="3" name="local_shape" type="int"> </argument> <description> - 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. </description> </signal> <signal name="body_shape_exited"> @@ -209,7 +210,7 @@ <argument index="3" name="local_shape" type="int"> </argument> <description> - 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. </description> </signal> <signal name="sleeping_state_changed"> |