Skip to content

Commit

Permalink
Merge pull request #42715 from madmiraal/fix-42614-3.2
Browse files Browse the repository at this point in the history
[3.2] Update area-body_shape_entered-exited signal documentation.
  • Loading branch information
akien-mga authored Jan 15, 2021
2 parents 258f41c + 253b1c2 commit 066716a
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 50 deletions.
48 changes: 32 additions & 16 deletions doc/classes/Area.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,16 @@
<argument index="0" name="area" type="Area">
</argument>
<description>
Emitted when another area enters.
Emitted when another Area enters this Area. Requires [member monitoring] to be set to [code]true[/code].
[code]area[/code] the other Area.
</description>
</signal>
<signal name="area_exited">
<argument index="0" name="area" type="Area">
</argument>
<description>
Emitted when another area exits.
Emitted when another Area exits this Area. Requires [member monitoring] to be set to [code]true[/code].
[code]area[/code] the other Area.
</description>
</signal>
<signal name="area_shape_entered">
Expand All @@ -167,10 +169,14 @@
</argument>
<argument index="2" name="area_shape" type="int">
</argument>
<argument index="3" name="self_shape" type="int">
<argument index="3" name="local_shape" type="int">
</argument>
<description>
Emitted when another area enters, reporting which areas overlapped. [code]shape_owner_get_owner(shape_find_owner(shape))[/code] returns the parent object of the owner of the [code]shape[/code].
Emitted when one of another Area's [Shape]s enters one of this Area's [Shape]s. Requires [member monitoring] to be set to [code]true[/code].
[code]area_id[/code] the [RID] of the other Area's [CollisionObject] used by the [PhysicsServer].
[code]area[/code] the other Area.
[code]area_shape[/code] the index of the [Shape] of the other Area used by the [PhysicsServer].
[code]local_shape[/code] the index of the [Shape] of this Area used by the [PhysicsServer].
</description>
</signal>
<signal name="area_shape_exited">
Expand All @@ -180,26 +186,30 @@
</argument>
<argument index="2" name="area_shape" type="int">
</argument>
<argument index="3" name="self_shape" type="int">
<argument index="3" name="local_shape" type="int">
</argument>
<description>
Emitted when another area exits, reporting which areas were overlapping.
Emitted when one of another Area's [Shape]s enters one of this Area's [Shape]s. Requires [member monitoring] to be set to [code]true[/code].
[code]area_id[/code] the [RID] of the other Area's [CollisionObject] used by the [PhysicsServer].
[code]area[/code] the other Area.
[code]area_shape[/code] the index of the [Shape] of the other Area used by the [PhysicsServer].
[code]local_shape[/code] the index of the [Shape] of this Area used by the [PhysicsServer].
</description>
</signal>
<signal name="body_entered">
<argument index="0" name="body" type="Node">
</argument>
<description>
Emitted when a physics body enters.
The [code]body[/code] argument can either be a [PhysicsBody] or a [GridMap] instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).
Emitted when a [PhysicsBody] or [GridMap] enters this Area. Requires [member monitoring] to be set to [code]true[/code]. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape]s.
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody] or [GridMap].
</description>
</signal>
<signal name="body_exited">
<argument index="0" name="body" type="Node">
</argument>
<description>
Emitted when a physics body exits.
The [code]body[/code] argument can either be a [PhysicsBody] or a [GridMap] instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).
Emitted when a [PhysicsBody] or [GridMap] exits this Area. Requires [member monitoring] to be set to [code]true[/code]. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape]s.
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody] or [GridMap].
</description>
</signal>
<signal name="body_shape_entered">
Expand All @@ -209,11 +219,14 @@
</argument>
<argument index="2" name="body_shape" type="int">
</argument>
<argument index="3" name="area_shape" type="int">
<argument index="3" name="local_shape" type="int">
</argument>
<description>
Emitted when a physics body enters, reporting which shapes overlapped.
The [code]body[/code] argument can either be a [PhysicsBody] or a [GridMap] instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).
Emitted when one of a [PhysicsBody] or [GridMap]'s [Shape]s enters one of this Area's [Shape]s. Requires [member monitoring] to be set to [code]true[/code]. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape]s.
[code]body_id[/code] the [RID] of the [PhysicsBody] or [MeshLibrary]'s [CollisionObject] used by the [PhysicsServer].
[code]body[/code] the [Node], if it exists in the tree, of the [PhysicsBody] or [GridMap].
[code]body_shape[/code] the index of the [Shape] of the [PhysicsBody] or [GridMap] used by the [PhysicsServer].
[code]local_shape[/code] the index of the [Shape] of this Area used by the [PhysicsServer].
</description>
</signal>
<signal name="body_shape_exited">
Expand All @@ -223,11 +236,14 @@
</argument>
<argument index="2" name="body_shape" type="int">
</argument>
<argument index="3" name="area_shape" type="int">
<argument index="3" name="local_shape" type="int">
</argument>
<description>
Emitted when a physics body exits, reporting which shapes were overlapping.
The [code]body[/code] argument can either be a [PhysicsBody] or a [GridMap] instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).
Emitted when one of a [PhysicsBody] or [GridMap]'s [Shape]s enters one of this Area's [Shape]s. Requires [member monitoring] to be set to [code]true[/code]. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape]s.
[code]body_id[/code] the [RID] of the [PhysicsBody] or [MeshLibrary]'s [CollisionObject] used by the [PhysicsServer].
[code]body[/code] the [Node], if it exists in the tree, of the [PhysicsBody] or [GridMap].
[code]body_shape[/code] the index of the [Shape] of the [PhysicsBody] or [GridMap] used by the [PhysicsServer].
[code]local_shape[/code] the index of the [Shape] of this Area used by the [PhysicsServer].
</description>
</signal>
</signals>
Expand Down
48 changes: 32 additions & 16 deletions doc/classes/Area2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,16 @@
<argument index="0" name="area" type="Area2D">
</argument>
<description>
Emitted when another area enters.
Emitted when another Area2D enters this Area2D. Requires [member monitoring] to be set to [code]true[/code].
[code]area[/code] the other Area2D.
</description>
</signal>
<signal name="area_exited">
<argument index="0" name="area" type="Area2D">
</argument>
<description>
Emitted when another area exits.
Emitted when another Area2D exits this Area2D. Requires [member monitoring] to be set to [code]true[/code].
[code]area[/code] the other Area2D.
</description>
</signal>
<signal name="area_shape_entered">
Expand All @@ -157,10 +159,14 @@
</argument>
<argument index="2" name="area_shape" type="int">
</argument>
<argument index="3" name="self_shape" type="int">
<argument index="3" name="local_shape" type="int">
</argument>
<description>
Emitted when another area enters, reporting which shapes overlapped. [code]shape_owner_get_owner(shape_find_owner(shape))[/code] returns the parent object of the owner of the [code]shape[/code].
Emitted when one of another Area2D's [Shape2D]s enters one of this Area2D's [Shape2D]s. Requires [member monitoring] to be set to [code]true[/code].
[code]area_id[/code] the [RID] of the other Area2D's [CollisionObject2D] used by the [Physics2DServer].
[code]area[/code] the other Area2D.
[code]area_shape[/code] the index of the [Shape2D] of the other Area2D used by the [Physics2DServer].
[code]local_shape[/code] the index of the [Shape2D] of this Area2D used by the [Physics2DServer].
</description>
</signal>
<signal name="area_shape_exited">
Expand All @@ -170,26 +176,30 @@
</argument>
<argument index="2" name="area_shape" type="int">
</argument>
<argument index="3" name="self_shape" type="int">
<argument index="3" name="local_shape" type="int">
</argument>
<description>
Emitted when another area exits, reporting which shapes were overlapping.
Emitted when one of another Area2D's [Shape2D]s exits one of this Area2D's [Shape2D]s. Requires [member monitoring] to be set to [code]true[/code].
[code]area_id[/code] the [RID] of the other Area2D's [CollisionObject2D] used by the [Physics2DServer].
[code]area[/code] the other Area2D.
[code]area_shape[/code] the index of the [Shape2D] of the other Area2D used by the [Physics2DServer].
[code]local_shape[/code] the index of the [Shape2D] of this Area2D used by the [Physics2DServer].
</description>
</signal>
<signal name="body_entered">
<argument index="0" name="body" type="Node">
</argument>
<description>
Emitted when a physics body enters.
The [code]body[/code] argument can either be a [PhysicsBody2D] or a [TileMap] instance (while TileMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).
Emitted when a [PhysicsBody2D] or [TileMap] enters this Area2D. Requires [member monitoring] to be set to [code]true[/code]. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap].
</description>
</signal>
<signal name="body_exited">
<argument index="0" name="body" type="Node">
</argument>
<description>
Emitted when a physics body exits.
The [code]body[/code] argument can either be a [PhysicsBody2D] or a [TileMap] instance (while TileMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).
Emitted when a [PhysicsBody2D] or [TileMap] exits this Area2D. Requires [member monitoring] to be set to [code]true[/code]. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap].
</description>
</signal>
<signal name="body_shape_entered">
Expand All @@ -199,11 +209,14 @@
</argument>
<argument index="2" name="body_shape" type="int">
</argument>
<argument index="3" name="area_shape" type="int">
<argument index="3" name="local_shape" type="int">
</argument>
<description>
Emitted when a physics body enters, reporting which shapes overlapped.
The [code]body[/code] argument can either be a [PhysicsBody2D] or a [TileMap] instance (while TileMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).
Emitted when one of a [PhysicsBody2D] or [TileMap]'s [Shape2D]s enters one of this Area2D's [Shape2D]s. Requires [member monitoring] to be set to [code]true[/code]. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
[code]body_id[/code] the [RID] of the [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [Physics2DServer].
[code]body[/code] the [Node], if it exists in the tree, of the [PhysicsBody2D] or [TileMap].
[code]body_shape[/code] the index of the [Shape2D] of the [PhysicsBody2D] or [TileMap] used by the [Physics2DServer].
[code]local_shape[/code] the index of the [Shape2D] of this Area2D used by the [Physics2DServer].
</description>
</signal>
<signal name="body_shape_exited">
Expand All @@ -213,11 +226,14 @@
</argument>
<argument index="2" name="body_shape" type="int">
</argument>
<argument index="3" name="area_shape" type="int">
<argument index="3" name="local_shape" type="int">
</argument>
<description>
Emitted when a physics body exits, reporting which shapes were overlapping.
The [code]body[/code] argument can either be a [PhysicsBody2D] or a [TileMap] instance (while TileMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).
Emitted when one of a [PhysicsBody2D] or [TileMap]'s [Shape2D]s exits one of this Area2D's [Shape2D]s. Requires [member monitoring] to be set to [code]true[/code]. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
[code]body_id[/code] the [RID] of the [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [Physics2DServer].
[code]body[/code] the [Node], if it exists in the tree, of the [PhysicsBody2D] or [TileMap].
[code]body_shape[/code] the index of the [Shape2D] of the [PhysicsBody2D] or [TileMap] used by the [Physics2DServer].
[code]local_shape[/code] the index of the [Shape2D] of this Area2D used by the [Physics2DServer].
</description>
</signal>
</signals>
Expand Down
20 changes: 14 additions & 6 deletions doc/classes/RigidBody.xml
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,16 @@
<argument index="0" name="body" type="Node">
</argument>
<description>
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 collision with another [PhysicsBody] or [GridMap] occurs. 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. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape]s.
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody] or [GridMap].
</description>
</signal>
<signal name="body_exited">
<argument index="0" name="body" type="Node">
</argument>
<description>
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.
Emitted when the collision with another [PhysicsBody] or [GridMap] ends. 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. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape]s.
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody] or [GridMap].
</description>
</signal>
<signal name="body_shape_entered">
Expand All @@ -235,8 +237,11 @@
<argument index="3" name="local_shape" type="int">
</argument>
<description>
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.
Emitted when one of this RigidBody's [Shape]s collides with another [PhysicsBody] or [GridMap]'s [Shape]s. 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. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape]s.
[code]body_id[/code] the [RID] of the other [PhysicsBody] or [MeshLibrary]'s [CollisionObject] used by the [PhysicsServer].
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody] or [GridMap].
[code]body_shape[/code] the index of the [Shape] of the other [PhysicsBody] or [GridMap] used by the [PhysicsServer].
[code]local_shape[/code] the index of the [Shape] of this RigidBody used by the [PhysicsServer].
[b]Note:[/b] Bullet physics cannot identify the shape index when using a [ConcavePolygonShape]. Don't use multiple [CollisionShape]s when using a [ConcavePolygonShape] with Bullet physics if you need shape indices.
</description>
</signal>
Expand All @@ -250,8 +255,11 @@
<argument index="3" name="local_shape" type="int">
</argument>
<description>
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.
Emitted when the collision between one of this RigidBody's [Shape]s and another [PhysicsBody] or [GridMap]'s [Shape]s ends. 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. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape]s.
[code]body_id[/code] the [RID] of the other [PhysicsBody] or [MeshLibrary]'s [CollisionObject] used by the [PhysicsServer]. [GridMap]s are detected if the Meshes have [Shape]s.
[code]body[/code] the [Node], if it exists in the tree, of the other [PhysicsBody] or [GridMap].
[code]body_shape[/code] the index of the [Shape] of the other [PhysicsBody] or [GridMap] used by the [PhysicsServer].
[code]local_shape[/code] the index of the [Shape] of this RigidBody used by the [PhysicsServer].
[b]Note:[/b] Bullet physics cannot identify the shape index when using a [ConcavePolygonShape]. Don't use multiple [CollisionShape]s when using a [ConcavePolygonShape] with Bullet physics if you need shape indices.
</description>
</signal>
Expand Down
Loading

0 comments on commit 066716a

Please sign in to comment.