Browse Source

Fix physics example in Callbacks and Modules guide;

bjorn 5 years ago
parent
commit
f46444b61e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      guides/Callbacks_and_Modules.md

+ 3 - 3
guides/Callbacks_and_Modules.md

@@ -203,13 +203,13 @@ end
 
 
 function lovr.update(dt)
 function lovr.update(dt)
   -- Synchronize controllerBoxes with the active controllers
   -- Synchronize controllerBoxes with the active controllers
-  for i, controller in ipairs(lovr.headset.getControllers()) do
+  for i, hand in ipairs(lovr.headset.getHands()) do
     if not controllerBoxes[i] then
     if not controllerBoxes[i] then
       controllerBoxes[i] = world:newBoxCollider(0, 0, 0, .25)
       controllerBoxes[i] = world:newBoxCollider(0, 0, 0, .25)
       controllerBoxes[i]:setKinematic(true)
       controllerBoxes[i]:setKinematic(true)
     end
     end
-    controllerBoxes[i]:setPosition(controller:getPosition())
-    controllerBoxes[i]:setOrientation(controller:getOrientation())
+    controllerBoxes[i]:setPosition(lovr.headset.getPosition(hand))
+    controllerBoxes[i]:setOrientation(lovr.headset.getOrientation(hand))
   end
   end
 
 
   -- Update the physics simulation
   -- Update the physics simulation