Selaa lähdekoodia

Update physics-events.md (#447)

misterduke 1 vuosi sitten
vanhempi
commit
e60369dfa6
1 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 4 4
      docs/en/manuals/physics-events.md

+ 4 - 4
docs/en/manuals/physics-events.md

@@ -112,10 +112,10 @@ Here is a small example of how to avoid these limitations:
 ```lua
 local function physics_world_listener(self, event, data)
     if event == hash("contact_point_event") then
-        local position_a = event.a.normal * SIZE
-        local position_b =  event.b.normal * SIZE
-        local url_a = msg.url(nil, event.a.id, "collisionobject")
-        local url_b = msg.url(nil, event.b.id, "collisionobject")
+        local position_a = data.a.normal * SIZE
+        local position_b =  data.b.normal * SIZE
+        local url_a = msg.url(nil, data.a.id, "collisionobject")
+        local url_b = msg.url(nil, data.b.id, "collisionobject")
         -- fill the message in the same way arguments should be passed to `physics.create_joint()`
         local message = {physics.JOINT_TYPE_FIXED, url_a, "joind_id", position_a, url_b, position_b, {max_length = SIZE}}
         -- send message to the object itself