Browse Source

Update headset docs;

bjorn 6 years ago
parent
commit
226d2ff98c

+ 34 - 4
api/init.lua

@@ -12599,10 +12599,6 @@ return {
               name = "head",
               description = "The headset."
             },
-            {
-              name = "hand",
-              description = "A hand with an unknown handedness, found on systems with a single controller like the Oculus Go."
-            },
             {
               name = "hand/left",
               description = "The left controller."
@@ -12651,6 +12647,10 @@ return {
           key = "DeviceAxis",
           module = "lovr.headset",
           values = {
+            {
+              name = "primary",
+              description = "The primary analog axis (usually thumbstick or touchpad)."
+            },
             {
               name = "trigger",
               description = "A trigger (1D)."
@@ -12794,6 +12794,10 @@ return {
           key = "DeviceButton",
           module = "lovr.headset",
           values = {
+            {
+              name = "primary",
+              description = "The primary button (usually trigger)."
+            },
             {
               name = "trigger",
               description = "The trigger button."
@@ -13402,6 +13406,32 @@ return {
             }
           }
         },
+        {
+          name = "getHands",
+          summary = "Get a list of currently tracked hand devices.",
+          description = "Returns a table with all of the currently tracked hand devices.",
+          key = "lovr.headset.getHands",
+          module = "lovr.headset",
+          variants = {
+            {
+              arguments = {},
+              returns = {
+                {
+                  name = "hands",
+                  type = "table",
+                  description = "The currently tracked hand devices.",
+                  arguments = {},
+                  returns = {}
+                }
+              }
+            }
+          },
+          examples = {
+            {
+              code = "function lovr.update(dt)\n  for i, hand in ipairs(lovr.headset.getHands()) do\n    print(hand, lovr.headset.getPose(hand))\n  end\nend"
+            }
+          }
+        },
         {
           name = "getMirrorTexture",
           tag = "headset",

+ 0 - 7
api/lovr/headset/Device.lua

@@ -5,13 +5,6 @@ return {
       name = 'head',
       description = 'The headset.'
     },
-    {
-      name = 'hand',
-      description = [[
-        A hand with an unknown handedness, found on systems with a single controller like the Oculus
-        Go.
-      ]]
-    },
     {
       name = 'hand/left',
       description = 'The left controller.'

+ 4 - 0
api/lovr/headset/DeviceAxis.lua

@@ -1,6 +1,10 @@
 return {
   description = 'Axes on an input device.',
   values = {
+    {
+      name = 'primary',
+      description = 'The primary analog axis (usually thumbstick or touchpad).'
+    },
     {
       name = 'trigger',
       description = 'A trigger (1D).'

+ 4 - 0
api/lovr/headset/DeviceButton.lua

@@ -1,6 +1,10 @@
 return {
   description = 'Buttons on an input device.',
   values = {
+    {
+      name = 'primary',
+      description = 'The primary button (usually trigger).'
+    },
     {
       name = 'trigger',
       description = 'The trigger button.'

+ 21 - 0
api/lovr/headset/getHands.lua

@@ -0,0 +1,21 @@
+return {
+  summary = 'Get a list of currently tracked hand devices.',
+  description = 'Returns a table with all of the currently tracked hand devices.',
+  arguments = {},
+  returns = {
+    {
+      name = 'hands',
+      type = 'table',
+      arguments = {},
+      returns = {},
+      description = 'The currently tracked hand devices.'
+    }
+  },
+  example = [[
+    function lovr.update(dt)
+      for i, hand in ipairs(lovr.headset.getHands()) do
+        print(hand, lovr.headset.getPose(hand))
+      end
+    end
+  ]]
+}