Pārlūkot izejas kodu

Add Controller Models example;

bjorn 5 gadi atpakaļ
vecāks
revīzija
e567b0c252
2 mainītis faili ar 15 papildinājumiem un 0 dzēšanām
  1. 14 0
      examples/Interaction/Controller_Models/main.lua
  2. 1 0
      examples/init.lua

+ 14 - 0
examples/Interaction/Controller_Models/main.lua

@@ -0,0 +1,14 @@
+function lovr.load()
+  models = {
+    left = lovr.headset.newModel('hand/left'),
+    right = lovr.headset.newModel('hand/right')
+  }
+end
+
+function lovr.draw()
+  for hand, model in pairs(models) do
+    if lovr.headset.isTracked(hand) then
+      model:draw(mat4(lovr.headset.getPose(hand)))
+    end
+  end
+end

+ 1 - 0
examples/init.lua

@@ -7,6 +7,7 @@ return {
   'Interaction/Pointer',
   'Interaction/Pointer_UI',
   'Interaction/Physics_Pointer',
+  'Interaction/Controller_Models',
   'Custom_Mesh',
   'Animation',
   'Physics',