Przeglądaj źródła

Pointer examples use point poses;

bjorn 1 rok temu
rodzic
commit
e4a63265ba

+ 1 - 0
examples/Interaction/Pointer/main.lua

@@ -1,5 +1,6 @@
 function lovr.draw(pass)
   for i, hand in ipairs(lovr.headset.getHands()) do
+    hand = hand .. '/point'
     local position = vec3(lovr.headset.getPosition(hand))
     local direction = quat(lovr.headset.getOrientation(hand)):direction()
 

+ 2 - 2
examples/Interaction/Pointer_UI/main.lua

@@ -32,8 +32,8 @@ function lovr.update()
     tips[hand] = tips[hand] or lovr.math.newVec3()
 
     -- Ray info:
-    local rayPosition = vec3(lovr.headset.getPosition(hand))
-    local rayDirection = vec3(quat(lovr.headset.getOrientation(hand)):direction())
+    local rayPosition = vec3(lovr.headset.getPosition(hand .. '/point'))
+    local rayDirection = vec3(quat(lovr.headset.getOrientation(hand .. '/point')):direction())
 
     -- Call the raycast helper function to get the intersection point of the ray and the button plane
     local hit = raycast(rayPosition, rayDirection, button.position, vec3(0, 0, 1))