Browse Source

Quest definitely supports bounds;

bjorn 2 years ago
parent
commit
2bc2a30214

+ 432 - 7
api/init.lua

@@ -2796,7 +2796,7 @@ return {
                     {
                       name = "property",
                       type = "AnimationProperty",
-                      description = "The property (translation, rotation, scale) affected by the keyframes."
+                      description = "The property (translation, rotation, scale, weights) affected by the keyframes."
                     }
                   }
                 },
@@ -2817,7 +2817,7 @@ return {
                     {
                       name = "property",
                       type = "AnimationProperty",
-                      description = "The property (translation, rotation, scale) affected by the keyframes."
+                      description = "The property (translation, rotation, scale, weights) affected by the keyframes."
                     }
                   }
                 }
@@ -2878,6 +2878,59 @@ return {
                 }
               }
             },
+            {
+              name = "getBlendShapeCount",
+              summary = "Get the number of blend shapes in the model.",
+              description = "Returns the number of blend shapes in the model.",
+              key = "ModelData:getBlendShapeCount",
+              module = "lovr.data",
+              related = {
+                "ModelData:getBlendShapeName",
+                "Model:getBlendShapeCount"
+              },
+              variants = {
+                {
+                  arguments = {},
+                  returns = {
+                    {
+                      name = "count",
+                      type = "number",
+                      description = "The number of blend shapes in the model."
+                    }
+                  }
+                }
+              }
+            },
+            {
+              name = "getBlendShapeName",
+              summary = "Get the name of a blend shape in the model.",
+              description = "Returns the name of a blend shape in the model.",
+              key = "ModelData:getBlendShapeName",
+              module = "lovr.data",
+              notes = "This function will throw an error if the blend shape index is invalid.",
+              variants = {
+                {
+                  arguments = {
+                    {
+                      name = "index",
+                      type = "number",
+                      description = "The index of a blend shape."
+                    }
+                  },
+                  returns = {
+                    {
+                      name = "name",
+                      type = "string",
+                      description = "The name of the blend shape."
+                    }
+                  }
+                }
+              },
+              related = {
+                "ModelData:getBlendShapeCount",
+                "Model:getBlendShapeName"
+              }
+            },
             {
               name = "getBlob",
               summary = "Get a Blob in the model.",
@@ -6349,7 +6402,7 @@ return {
         {
           name = "AnimationProperty",
           summary = "Different animated properties.",
-          description = "This indicates the different transform properties that can be animated.",
+          description = "This indicates the different node properties that can be animated.",
           key = "AnimationProperty",
           module = "lovr.data",
           values = {
@@ -6364,6 +6417,10 @@ return {
             {
               name = "scale",
               description = "Node scale."
+            },
+            {
+              name = "weights",
+              description = "Node blend shape weights."
             }
           }
         },
@@ -8893,6 +8950,105 @@ return {
                 }
               }
             },
+            {
+              name = "getBlendShapeCount",
+              summary = "Get the number of blend shapes in the model.",
+              description = "Returns the number of blend shapes in the model.",
+              key = "Model:getBlendShapeCount",
+              module = "lovr.graphics",
+              related = {
+                "Model:getBlendShapeName",
+                "ModelData:getBlendShapeCount"
+              },
+              variants = {
+                {
+                  arguments = {},
+                  returns = {
+                    {
+                      name = "count",
+                      type = "number",
+                      description = "The number of blend shapes in the model."
+                    }
+                  }
+                }
+              }
+            },
+            {
+              name = "getBlendShapeName",
+              summary = "Get the name of a blend shape in the model.",
+              description = "Returns the name of a blend shape in the model.",
+              key = "Model:getBlendShapeName",
+              module = "lovr.graphics",
+              notes = "This function will throw an error if the blend shape index is invalid.",
+              variants = {
+                {
+                  arguments = {
+                    {
+                      name = "index",
+                      type = "number",
+                      description = "The index of a blend shape."
+                    }
+                  },
+                  returns = {
+                    {
+                      name = "name",
+                      type = "string",
+                      description = "The name of the blend shape."
+                    }
+                  }
+                }
+              },
+              related = {
+                "Model:getBlendShapeCount",
+                "ModelData:getBlendShapeName"
+              }
+            },
+            {
+              name = "getBlendShapeWeight",
+              summary = "Get the weight of a blend shape.",
+              description = "Returns the weight of a blend shape.  A blend shape contains offset values for the vertices of one of the meshes in a Model.  Whenever the Model is drawn, the offsets are multiplied by the weight of the blend shape, allowing for smooth blending between different meshes.  A weight of zero won't apply any displacement and will skip processing of the blend shape.",
+              key = "Model:getBlendShapeWeight",
+              module = "lovr.graphics",
+              notes = "The initial weights are declared in the model file.\n\nWeights can be any number, but usually they're kept between 0 and 1.\n\nThis function will throw an error if the blend shape name or index doesn't exist.",
+              variants = {
+                {
+                  arguments = {
+                    {
+                      name = "index",
+                      type = "number",
+                      description = "The index of a blend shape."
+                    }
+                  },
+                  returns = {
+                    {
+                      name = "weight",
+                      type = "number",
+                      description = "The weight of the blend shape."
+                    }
+                  }
+                },
+                {
+                  arguments = {
+                    {
+                      name = "name",
+                      type = "string",
+                      description = "The name of a blend shape."
+                    }
+                  },
+                  returns = {
+                    {
+                      name = "weight",
+                      type = "number",
+                      description = "The weight of the blend shape."
+                    }
+                  }
+                }
+              },
+              related = {
+                "Model:getBlendShapeCount",
+                "Model:getBlendShapeName"
+              }
+            },
             {
               name = "getBoundingBox",
               summary = "Get the bounding box of the Model.",
@@ -10343,6 +10499,50 @@ return {
                 }
               }
             },
+            {
+              name = "setBlendShapeWeight",
+              summary = "Set the weight of a blend shape.",
+              description = "Sets the weight of a blend shape.  A blend shape contains offset values for the vertices of one of the meshes in a Model.  Whenever the Model is drawn, the offsets are multiplied by the weight of the blend shape, allowing for smooth blending between different meshes.  A weight of zero won't apply any displacement and will skip processing of the blend shape.",
+              key = "Model:setBlendShapeWeight",
+              module = "lovr.graphics",
+              notes = "The initial weights are declared in the model file.\n\nWeights can be any number, but usually they're kept between 0 and 1.\n\nThis function will throw an error if the blend shape name or index doesn't exist.",
+              variants = {
+                {
+                  arguments = {
+                    {
+                      name = "index",
+                      type = "number",
+                      description = "The index of a blend shape."
+                    },
+                    {
+                      name = "weight",
+                      type = "number",
+                      description = "The new weight for the blend shape."
+                    }
+                  },
+                  returns = {}
+                },
+                {
+                  arguments = {
+                    {
+                      name = "name",
+                      type = "string",
+                      description = "The name of a blend shape."
+                    },
+                    {
+                      name = "weight",
+                      type = "number",
+                      description = "The new weight for the blend shape."
+                    }
+                  },
+                  returns = {}
+                }
+              },
+              related = {
+                "Model:getBlendShapeCount",
+                "Model:getBlendShapeName"
+              }
+            },
             {
               name = "setNodeOrientation",
               summary = "Set or blend the orientation of a node.",
@@ -17527,6 +17727,11 @@ return {
                       type = "boolean",
                       description = "When supported, `Pass:setDepthClamp` will work, otherwise it will do nothing."
                     },
+                    {
+                      name = "depthResolve",
+                      type = "boolean",
+                      description = "When supported, multisampled render passes can use a non-multisampled depth texture. Otherwise, the depth texture sample count needs to match the render pass sample count."
+                    },
                     {
                       name = "indirectDrawFirstInstance",
                       type = "boolean",
@@ -18347,7 +18552,7 @@ return {
           description = "Loads a 3D model from a file.  Currently, OBJ, glTF, and binary STL files are supported.",
           key = "lovr.graphics.newModel",
           module = "lovr.graphics",
-          notes = "Currently, the following features are not supported by the model importer:\n\n- glTF: Morph targets are not supported.\n- glTF: Only the default scene is loaded.\n- glTF: Currently, each skin in a Model can have up to 256 joints.\n- glTF: Meshes can't appear multiple times in the node hierarchy with different skins, they need\n  to use 1 skin consistently.\n- glTF: `KHR_texture_transform` is supported, but all textures in a material will use the same\n  transform.\n- STL: ASCII STL files are not supported.\n\nDiffuse and emissive textures will be loaded using sRGB encoding, all other textures will be loaded as linear.",
+          notes = "Currently, the following features are not supported by the model importer:\n\n- glTF: Only the default scene is loaded.\n- glTF: Currently, each skin in a Model can have up to 256 joints.\n- glTF: Meshes can't appear multiple times in the node hierarchy with different skins, they need\n  to use 1 skin consistently.\n- glTF: `KHR_texture_transform` is supported, but all textures in a material will use the same\n  transform.\n- STL: ASCII STL files are not supported.\n\nDiffuse and emissive textures will be loaded using sRGB encoding, all other textures will be loaded as linear.\n\nLoading a model file will fail if the asset references textures or other files using absolute paths.  Relative paths should be used instead, and will be relative to the model file within the virtual filesystem.",
           related = {
             "lovr.data.newModelData",
             "Pass:draw"
@@ -20094,6 +20299,7 @@ return {
           description = "Returns the current angular velocity of a device.",
           key = "lovr.headset.getAngularVelocity",
           module = "lovr.headset",
+          notes = "If the device isn't tracked, all zeroes will be returned.",
           related = {
             "lovr.headset.getVelocity",
             "lovr.headset.getPosition",
@@ -20172,7 +20378,6 @@ return {
           description = "Returns the depth of the play area, in meters.",
           key = "lovr.headset.getBoundsDepth",
           module = "lovr.headset",
-          notes = "This currently returns 0 on the Quest.",
           related = {
             "lovr.headset.getBoundsWidth",
             "lovr.headset.getBoundsDimensions"
@@ -20197,7 +20402,6 @@ return {
           description = "Returns the size of the play area, in meters.",
           key = "lovr.headset.getBoundsDimensions",
           module = "lovr.headset",
-          notes = "This currently returns 0 on the Quest.",
           related = {
             "lovr.headset.getBoundsWidth",
             "lovr.headset.getBoundsDepth",
@@ -20258,7 +20462,6 @@ return {
           description = "Returns the width of the play area, in meters.",
           key = "lovr.headset.getBoundsWidth",
           module = "lovr.headset",
-          notes = "This currently returns 0 on the Quest.",
           related = {
             "lovr.headset.getBoundsDepth",
             "lovr.headset.getBoundsDimensions"
@@ -20860,6 +21063,7 @@ return {
           description = "Returns the current linear velocity of a device, in meters per second.",
           key = "lovr.headset.getVelocity",
           module = "lovr.headset",
+          notes = "If the device isn't tracked, all zeroes will be returned.",
           related = {
             "lovr.headset.getAngularVelocity",
             "lovr.headset.getPose",
@@ -33175,6 +33379,83 @@ return {
             }
           }
         },
+        {
+          name = "getMousePosition",
+          summary = "Get the position of the mouse.",
+          description = "Returns the position of the mouse.",
+          key = "lovr.system.getMousePosition",
+          module = "lovr.system",
+          related = {
+            "lovr.system.getMouseX",
+            "lovr.system.getMouseY",
+            "lovr.mousemoved"
+          },
+          variants = {
+            {
+              arguments = {},
+              returns = {
+                {
+                  name = "x",
+                  type = "number",
+                  description = "The x position of the mouse, relative to the top-left of the window."
+                },
+                {
+                  name = "y",
+                  type = "number",
+                  description = "The y position of the mouse, relative to the top-left of the window."
+                }
+              }
+            }
+          }
+        },
+        {
+          name = "getMouseX",
+          summary = "Get the x position of the mouse.",
+          description = "Returns the x position of the mouse.",
+          key = "lovr.system.getMouseX",
+          module = "lovr.system",
+          related = {
+            "lovr.system.getMouseY",
+            "lovr.system.getMousePosition",
+            "lovr.mousemoved"
+          },
+          variants = {
+            {
+              arguments = {},
+              returns = {
+                {
+                  name = "x",
+                  type = "number",
+                  description = "The x position of the mouse, relative to the top-left of the window."
+                }
+              }
+            }
+          }
+        },
+        {
+          name = "getMouseY",
+          summary = "Get the y position of the mouse.",
+          description = "Returns the y position of the mouse.",
+          key = "lovr.system.getMouseY",
+          module = "lovr.system",
+          related = {
+            "lovr.system.getMouseX",
+            "lovr.system.getMousePosition",
+            "lovr.mousemoved"
+          },
+          variants = {
+            {
+              arguments = {},
+              returns = {
+                {
+                  name = "y",
+                  type = "number",
+                  description = "The y position of the mouse, relative to the top-left of the window."
+                }
+              }
+            }
+          }
+        },
         {
           name = "getOS",
           summary = "Get the current operating system.",
@@ -33318,6 +33599,38 @@ return {
             }
           }
         },
+        {
+          name = "isMouseDown",
+          summary = "Check if a mouse button is pressed.",
+          description = "Returns whether a mouse button is currently pressed.",
+          key = "lovr.system.isMouseDown",
+          module = "lovr.system",
+          related = {
+            "lovr.mousepressed",
+            "lovr.mousereleased",
+            "lovr.system.getMouseX",
+            "lovr.system.getMouseY",
+            "lovr.system.getMousePosition"
+          },
+          variants = {
+            {
+              arguments = {
+                {
+                  name = "button",
+                  type = "number",
+                  description = "The index of a button to check.  Use 1 for the primary mouse button, 2 for the secondary button, and 3 for the middle button.  Other indices can be used, but are hardware-specific."
+                }
+              },
+              returns = {
+                {
+                  name = "down",
+                  type = "boolean",
+                  description = "Whether the mouse button is currently down."
+                }
+              }
+            }
+          }
+        },
         {
           name = "isWindowOpen",
           summary = "Check if the desktop window is open.",
@@ -34447,6 +34760,118 @@ return {
         }
       }
     },
+    {
+      name = "mousemoved",
+      tag = "callbacks",
+      summary = "Called when the mouse is moved.",
+      description = "This callback is called when the mouse is moved.",
+      key = "lovr.mousemoved",
+      module = "lovr",
+      related = {
+        "lovr.mousepressed",
+        "lovr.mousereleased",
+        "lovr.system.getMouseX",
+        "lovr.system.getMouseY",
+        "lovr.system.getMousePosition"
+      },
+      variants = {
+        {
+          arguments = {
+            {
+              name = "x",
+              type = "number",
+              description = "The new x position of the mouse."
+            },
+            {
+              name = "y",
+              type = "number",
+              description = "The new y position of the mouse."
+            },
+            {
+              name = "dx",
+              type = "number",
+              description = "The movement on the x axis since the last mousemove event."
+            },
+            {
+              name = "dy",
+              type = "number",
+              description = "The movement on the y axis since the last mousemove event."
+            }
+          },
+          returns = {}
+        }
+      }
+    },
+    {
+      name = "mousepressed",
+      tag = "callbacks",
+      summary = "Called when a mouse button is pressed.",
+      description = "This callback is called when a mouse button is pressed.",
+      key = "lovr.mousepressed",
+      module = "lovr",
+      related = {
+        "lovr.mousereleased",
+        "lovr.mousemoved",
+        "lovr.system.isMouseDown"
+      },
+      variants = {
+        {
+          arguments = {
+            {
+              name = "x",
+              type = "number",
+              description = "The x position of the mouse when the button was pressed."
+            },
+            {
+              name = "y",
+              type = "number",
+              description = "The y position of the mouse when the button was pressed."
+            },
+            {
+              name = "button",
+              type = "number",
+              description = "The button that was pressed.  Will be 1 for the primary button, 2 for the secondary button, or 3 for the middle mouse button."
+            }
+          },
+          returns = {}
+        }
+      }
+    },
+    {
+      name = "mousereleased",
+      tag = "callbacks",
+      summary = "Called when a mouse button is released.",
+      description = "This callback is called when a mouse button is released.",
+      key = "lovr.mousereleased",
+      module = "lovr",
+      related = {
+        "lovr.mousepressed",
+        "lovr.mousemoved",
+        "lovr.system.isMouseDown"
+      },
+      variants = {
+        {
+          arguments = {
+            {
+              name = "x",
+              type = "number",
+              description = "The x position of the mouse when the button was released."
+            },
+            {
+              name = "y",
+              type = "number",
+              description = "The y position of the mouse when the button was released."
+            },
+            {
+              name = "button",
+              type = "number",
+              description = "The button that was released.  Will be 1 for the primary button, 2 for the secondary button, or 3 for the middle mouse button."
+            }
+          },
+          returns = {}
+        }
+      }
+    },
     {
       name = "permission",
       tag = "callbacks",

+ 1 - 4
api/lovr/headset/getBoundsDepth.lua

@@ -18,8 +18,5 @@ return {
   related = {
     'lovr.headset.getBoundsWidth',
     'lovr.headset.getBoundsDimensions'
-  },
-  notes = [[
-    This currently returns 0 on the Quest.
-  ]]
+  }
 }

+ 0 - 3
api/lovr/headset/getBoundsDimensions.lua

@@ -19,9 +19,6 @@ return {
       returns = { 'width', 'depth' }
     }
   },
-  notes = [[
-    This currently returns 0 on the Quest.
-  ]],
   related = {
     'lovr.headset.getBoundsWidth',
     'lovr.headset.getBoundsDepth',

+ 1 - 4
api/lovr/headset/getBoundsWidth.lua

@@ -18,8 +18,5 @@ return {
   related = {
     'lovr.headset.getBoundsDepth',
     'lovr.headset.getBoundsDimensions'
-  },
-  notes = [[
-    This currently returns 0 on the Quest.
-  ]]
+  }
 }