Skip to content

Commit

Permalink
Added missing message fields
Browse files Browse the repository at this point in the history
  • Loading branch information
britzl committed Dec 4, 2023
1 parent 64797c3 commit 65e6c83
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/en/manuals/physics-messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ The `"collision_response"` message is sent for all collision objects. It has the
`other_group`
: the collision group of the other collision object (`hash`)

`own_group`
: the collision group of the collision object (`hash`)

The collision_response message is only adequate to resolve collisions where you don't need any details on the actual intersection of the objects, for example if you want to detect if a bullet hits an enemy. There is only one of these messages sent for any colliding pair of objects each frame.

```Lua
Expand Down Expand Up @@ -66,9 +69,12 @@ The `"contact_point_response"` message is sent when one of the colliding objects
`other_position`
: the world position of the other collision object (`vector3`).

`group`
`other_group`
: the collision group of the other collision object (`hash`).

`own_group`
: the collision group of the collision object (`hash`).

For a game or application where you need to separate objects perfectly, the `"contact_point_response"` message gives you all information you need. However, note that for any given collision pair, several `"contact_point_response"` messages can be received each frame, depending on the nature of the collision. See [Resolving collisions for more information](/manuals/physics-resolving-collisions).

```Lua
Expand Down Expand Up @@ -96,6 +102,12 @@ In a trigger collision `"collision_response"` messages are sent. In addition, tr
`enter`
: `true` if the interaction was an entry into the trigger, `false` if it was an exit. (`boolean`).

`other_group`
: the collision group of the other collision object (`hash`).

`own_group`
: the collision group of the collision object (`hash`).

```Lua
function on_message(self, message_id, message, sender)
-- check for the message
Expand Down

0 comments on commit 65e6c83

Please sign in to comment.