Clarify the difference between contacts and collisions.
(cherry picked from commit 6f1c99e5b4
)
This commit is contained in:
parent
b717a61903
commit
cdb3712992
|
@ -96,7 +96,7 @@
|
||||||
<return type="Array">
|
<return type="Array">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
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.
|
[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>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
@ -161,10 +161,11 @@
|
||||||
If [code]true[/code], the body can enter sleep mode when there is no movement. See [member sleeping].
|
If [code]true[/code], the body can enter sleep mode when there is no movement. See [member sleeping].
|
||||||
</member>
|
</member>
|
||||||
<member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" default="false">
|
<member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" default="false">
|
||||||
If [code]true[/code], the RigidBody will emit signals when it collides with another RigidBody.
|
If [code]true[/code], the RigidBody will emit signals when it collides with another RigidBody. See also [member contacts_reported].
|
||||||
</member>
|
</member>
|
||||||
<member name="contacts_reported" type="int" setter="set_max_contacts_reported" getter="get_max_contacts_reported" default="0">
|
<member name="contacts_reported" type="int" setter="set_max_contacts_reported" getter="get_max_contacts_reported" default="0">
|
||||||
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).
|
||||||
</member>
|
</member>
|
||||||
<member name="continuous_cd" type="bool" setter="set_use_continuous_collision_detection" getter="is_using_continuous_collision_detection" default="false">
|
<member name="continuous_cd" type="bool" setter="set_use_continuous_collision_detection" getter="is_using_continuous_collision_detection" default="false">
|
||||||
If [code]true[/code], continuous collision detection is used.
|
If [code]true[/code], continuous collision detection is used.
|
||||||
|
@ -208,14 +209,14 @@
|
||||||
<argument index="0" name="body" type="Node">
|
<argument index="0" name="body" type="Node">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
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.
|
||||||
</description>
|
</description>
|
||||||
</signal>
|
</signal>
|
||||||
<signal name="body_exited">
|
<signal name="body_exited">
|
||||||
<argument index="0" name="body" type="Node">
|
<argument index="0" name="body" type="Node">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
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.
|
||||||
</description>
|
</description>
|
||||||
</signal>
|
</signal>
|
||||||
<signal name="body_shape_entered">
|
<signal name="body_shape_entered">
|
||||||
|
@ -228,7 +229,7 @@
|
||||||
<argument index="3" name="local_shape" type="int">
|
<argument index="3" name="local_shape" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
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.
|
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.
|
||||||
</description>
|
</description>
|
||||||
</signal>
|
</signal>
|
||||||
|
@ -242,7 +243,7 @@
|
||||||
<argument index="3" name="local_shape" type="int">
|
<argument index="3" name="local_shape" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
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.
|
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.
|
||||||
</description>
|
</description>
|
||||||
</signal>
|
</signal>
|
||||||
|
|
|
@ -84,7 +84,7 @@
|
||||||
<return type="Array">
|
<return type="Array">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<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.
|
[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>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
@ -137,7 +137,8 @@
|
||||||
If [code]true[/code], the body will emit signals when it collides with another RigidBody2D. See also [member contacts_reported].
|
If [code]true[/code], the body will emit signals when it collides with another RigidBody2D. See also [member contacts_reported].
|
||||||
</member>
|
</member>
|
||||||
<member name="contacts_reported" type="int" setter="set_max_contacts_reported" getter="get_max_contacts_reported" default="0">
|
<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>
|
||||||
<member name="continuous_cd" type="int" setter="set_continuous_collision_detection_mode" getter="get_continuous_collision_detection_mode" enum="RigidBody2D.CCDMode" default="0">
|
<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.
|
Continuous collision detection mode.
|
||||||
|
@ -184,14 +185,14 @@
|
||||||
<argument index="0" name="body" type="Node">
|
<argument index="0" name="body" type="Node">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<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>
|
</description>
|
||||||
</signal>
|
</signal>
|
||||||
<signal name="body_exited">
|
<signal name="body_exited">
|
||||||
<argument index="0" name="body" type="Node">
|
<argument index="0" name="body" type="Node">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<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>
|
</description>
|
||||||
</signal>
|
</signal>
|
||||||
<signal name="body_shape_entered">
|
<signal name="body_shape_entered">
|
||||||
|
@ -204,7 +205,7 @@
|
||||||
<argument index="3" name="local_shape" type="int">
|
<argument index="3" name="local_shape" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<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>
|
</description>
|
||||||
</signal>
|
</signal>
|
||||||
<signal name="body_shape_exited">
|
<signal name="body_shape_exited">
|
||||||
|
@ -217,7 +218,7 @@
|
||||||
<argument index="3" name="local_shape" type="int">
|
<argument index="3" name="local_shape" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<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>
|
</description>
|
||||||
</signal>
|
</signal>
|
||||||
<signal name="sleeping_state_changed">
|
<signal name="sleeping_state_changed">
|
||||||
|
|
Loading…
Reference in New Issue