diff options
author | Ninni Pipping <over999ships@gmail.com> | 2023-03-23 11:13:24 +0100 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-03-27 17:49:05 +0200 |
commit | 9a4a0d042c41ecf6a3ba0ffe9107db9f616b2c60 (patch) | |
tree | 4681e6dd138cd6dfd3cfb64ddf62e5bd96deba25 /doc/classes/PhysicsServer3D.xml | |
parent | 7a827f979e70edebc9e61856f11e594d26ec779d (diff) |
Improve documentation for Area monitor callbacks in `PhysicsServer3D`
(cherry picked from commit 41242712410589315bfefa2b0630d96281b49006)
Diffstat (limited to 'doc/classes/PhysicsServer3D.xml')
-rw-r--r-- | doc/classes/PhysicsServer3D.xml | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index 82464d2f99..46ffc3eabe 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -119,6 +119,13 @@ <param index="0" name="area" type="RID" /> <param index="1" name="callback" type="Callable" /> <description> + Sets the area's area monitor callback. This callback will be called when any other (shape of an) area enters or exits (a shape of) the given area, and must take the following five parameters: + 1. an integer [code]status[/code]: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other area's shape entered or exited the area, + 2. an [RID] [code]area_rid[/code]: the [RID] of the other area that entered or exited the area, + 3. an integer [code]instance_id[/code]: the [code]ObjectID[/code] attached to the other area, + 4. an integer [code]area_shape_idx[/code]: the index of the shape of the other area that entered or exited the area, + 5. an integer [code]self_shape_idx[/code]: the index of the shape of the area where the other area entered or exited. + By counting (or keeping track of) the shapes that enter and exit, it can be determined if an area (with all its shapes) is entering for the first time or exiting for the last time. </description> </method> <method name="area_set_collision_layer"> @@ -142,12 +149,13 @@ <param index="0" name="area" type="RID" /> <param index="1" name="callback" type="Callable" /> <description> - Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters: - 1: [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED], depending on whether the object entered or exited the area. - 2: [RID] of the object that entered/exited the area. - 3: Instance ID of the object that entered/exited the area. - 4: The shape index of the object that entered/exited the area. - 5: The shape index of the area where the object entered/exited. + Sets the area's body monitor callback. This callback will be called when any other (shape of a) body enters or exits (a shape of) the given area, and must take the following five parameters: + 1. an integer [code]status[/code]: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other body shape entered or exited the area, + 2. an [RID] [code]body_rid[/code]: the [RID] of the body that entered or exited the area, + 3. an integer [code]instance_id[/code]: the [code]ObjectID[/code] attached to the body, + 4. an integer [code]body_shape_idx[/code]: the index of the shape of the body that entered or exited the area, + 5. an integer [code]self_shape_idx[/code]: the index of the shape of the area where the body entered or exited. + By counting (or keeping track of) the shapes that enter and exit, it can be determined if a body (with all its shapes) is entering for the first time or exiting for the last time. </description> </method> <method name="area_set_monitorable"> |