Browse Source

Model doc skeletons; Fixes;

bjorn 3 years ago
parent
commit
6f496bda34
73 changed files with 1258 additions and 162 deletions
  1. 162 63
      api/init.lua
  2. 3 0
      api/lovr/data/ModelData/getAnimationCount.lua
  3. 4 1
      api/lovr/data/ModelData/getAnimationDuration.lua
  4. 4 1
      api/lovr/data/ModelData/getAnimationName.lua
  5. 2 1
      api/lovr/data/ModelData/getBoundingBox.lua
  6. 2 1
      api/lovr/data/ModelData/getBoundingSphere.lua
  7. 2 1
      api/lovr/data/ModelData/getCenter.lua
  8. 2 1
      api/lovr/data/ModelData/getDepth.lua
  9. 2 1
      api/lovr/data/ModelData/getDimensions.lua
  10. 2 1
      api/lovr/data/ModelData/getHeight.lua
  11. 2 1
      api/lovr/data/ModelData/getMaterialCount.lua
  12. 2 1
      api/lovr/data/ModelData/getMaterialName.lua
  13. 3 0
      api/lovr/data/ModelData/getMetadata.lua
  14. 2 1
      api/lovr/data/ModelData/getNodeChildren.lua
  15. 3 0
      api/lovr/data/ModelData/getNodeCount.lua
  16. 1 1
      api/lovr/data/ModelData/getNodeMeshes.lua
  17. 4 1
      api/lovr/data/ModelData/getNodeName.lua
  18. 1 1
      api/lovr/data/ModelData/getNodeOrientation.lua
  19. 2 1
      api/lovr/data/ModelData/getNodeParent.lua
  20. 1 1
      api/lovr/data/ModelData/getNodePose.lua
  21. 1 1
      api/lovr/data/ModelData/getNodePosition.lua
  22. 1 1
      api/lovr/data/ModelData/getNodeScale.lua
  23. 1 1
      api/lovr/data/ModelData/getNodeSkin.lua
  24. 1 1
      api/lovr/data/ModelData/getNodeTransform.lua
  25. 2 1
      api/lovr/data/ModelData/getRootNode.lua
  26. 4 1
      api/lovr/data/ModelData/getSkinCount.lua
  27. 2 1
      api/lovr/data/ModelData/getTriangleCount.lua
  28. 5 5
      api/lovr/data/ModelData/getTriangles.lua
  29. 2 1
      api/lovr/data/ModelData/getVertexCount.lua
  30. 2 1
      api/lovr/data/ModelData/getWidth.lua
  31. 19 10
      api/lovr/graphics/Model/animate.lua
  32. 5 2
      api/lovr/graphics/Model/getAnimationDuration.lua
  33. 1 3
      api/lovr/graphics/Model/getAnimationName.lua
  34. 15 8
      api/lovr/graphics/Model/getBoundingBox.lua
  35. 36 0
      api/lovr/graphics/Model/getBoundingSphere.lua
  36. 32 0
      api/lovr/graphics/Model/getCenter.lua
  37. 0 0
      api/lovr/graphics/Model/getData.lua
  38. 20 0
      api/lovr/graphics/Model/getDepth.lua
  39. 32 0
      api/lovr/graphics/Model/getDimensions.lua
  40. 20 0
      api/lovr/graphics/Model/getHeight.lua
  41. 1 2
      api/lovr/graphics/Model/getMaterial.lua
  42. 1 2
      api/lovr/graphics/Model/getMaterialName.lua
  43. 16 0
      api/lovr/graphics/Model/getMetadata.lua
  44. 37 0
      api/lovr/graphics/Model/getNodeChildren.lua
  45. 3 8
      api/lovr/graphics/Model/getNodeCount.lua
  46. 60 0
      api/lovr/graphics/Model/getNodeDraw.lua
  47. 34 0
      api/lovr/graphics/Model/getNodeDrawCount.lua
  48. 58 0
      api/lovr/graphics/Model/getNodeOrientation.lua
  49. 34 0
      api/lovr/graphics/Model/getNodeParent.lua
  50. 20 18
      api/lovr/graphics/Model/getNodePose.lua
  51. 54 0
      api/lovr/graphics/Model/getNodePosition.lua
  52. 54 0
      api/lovr/graphics/Model/getNodeScale.lua
  53. 82 0
      api/lovr/graphics/Model/getNodeTransform.lua
  54. 16 0
      api/lovr/graphics/Model/getRootNode.lua
  55. 1 0
      api/lovr/graphics/Model/getTexture.lua
  56. 15 0
      api/lovr/graphics/Model/getTextureCount.lua
  57. 21 0
      api/lovr/graphics/Model/getTriangleCount.lua
  58. 26 0
      api/lovr/graphics/Model/getTriangles.lua
  59. 21 0
      api/lovr/graphics/Model/getVertexCount.lua
  60. 20 0
      api/lovr/graphics/Model/getWidth.lua
  61. 16 0
      api/lovr/graphics/Model/hasJoints.lua
  62. 0 11
      api/lovr/graphics/Model/resetPose.lua
  63. 49 0
      api/lovr/graphics/Model/setNodeOrientation.lua
  64. 52 0
      api/lovr/graphics/Model/setNodePose.lua
  65. 49 0
      api/lovr/graphics/Model/setNodePosition.lua
  66. 48 0
      api/lovr/graphics/Model/setNodeScale.lua
  67. 49 0
      api/lovr/graphics/Model/setNodeTransform.lua
  68. 1 1
      api/lovr/graphics/Pass/cone.lua
  69. 1 1
      api/lovr/graphics/Pass/copy.lua
  70. 1 1
      api/lovr/graphics/Pass/mesh.lua
  71. 7 0
      api/lovr/graphics/Pass/mipmap.lua
  72. 3 1
      api/lovr/graphics/Pass/read.lua
  73. 1 1
      api/lovr/graphics/Shader/getWorkgroupSize.lua

File diff suppressed because it is too large
+ 162 - 63
api/init.lua


+ 3 - 0
api/lovr/data/ModelData/getAnimationCount.lua

@@ -8,5 +8,8 @@ return {
       type = 'number',
       description = 'The number of animations in the model.'
     }
+  },
+  related = {
+    'Model:getAnimationCount'
   }
 }

+ 4 - 1
api/lovr/data/ModelData/getAnimationDuration.lua

@@ -19,5 +19,8 @@ return {
   },
   notes = [[
     The duration of the animation is calculated as the latest timestamp of all of its channels.
-  ]]
+  ]],
+  related = {
+    'Model:getAnimationDuration'
+  }
 }

+ 4 - 1
api/lovr/data/ModelData/getAnimationName.lua

@@ -15,5 +15,8 @@ return {
       description = 'The name of the animation.'
     }
   },
-  notes = 'If the animation does not have a name, this function returns `nil`.'
+  notes = 'If the animation does not have a name, this function returns `nil`.',
+  related = {
+    'Model:getAnimationName'
+  }
 }

+ 2 - 1
api/lovr/data/ModelData/getBoundingBox.lua

@@ -40,6 +40,7 @@ return {
     'ModelData:getDepth',
     'ModelData:getDimensions',
     'ModelData:getCenter',
-    'ModelData:getBoundingSphere'
+    'ModelData:getBoundingSphere',
+    'Model:getBoundingBox'
   }
 }

+ 2 - 1
api/lovr/data/ModelData/getBoundingSphere.lua

@@ -30,6 +30,7 @@ return {
     'ModelData:getDepth',
     'ModelData:getDimensions',
     'ModelData:getCenter',
-    'ModelData:getBoundingBox'
+    'ModelData:getBoundingBox',
+    'Model:getBoundingSphere'
   }
 }

+ 2 - 1
api/lovr/data/ModelData/getCenter.lua

@@ -26,6 +26,7 @@ return {
     'ModelData:getHeight',
     'ModelData:getDepth',
     'ModelData:getDimensions',
-    'ModelData:getBoundingBox'
+    'ModelData:getBoundingBox',
+    'Model:getCenter'
   }
 }

+ 2 - 1
api/lovr/data/ModelData/getDepth.lua

@@ -14,6 +14,7 @@ return {
     'ModelData:getHeight',
     'ModelData:getDimensions',
     'ModelData:getCenter',
-    'ModelData:getBoundingBox'
+    'ModelData:getBoundingBox',
+    'Model:getDepth'
   }
 }

+ 2 - 1
api/lovr/data/ModelData/getDimensions.lua

@@ -26,6 +26,7 @@ return {
     'ModelData:getHeight',
     'ModelData:getDepth',
     'ModelData:getCenter',
-    'ModelData:getBoundingBox'
+    'ModelData:getBoundingBox',
+    'Model:getDimensions'
   }
 }

+ 2 - 1
api/lovr/data/ModelData/getHeight.lua

@@ -14,6 +14,7 @@ return {
     'ModelData:getDepth',
     'ModelData:getDimensions',
     'ModelData:getCenter',
-    'ModelData:getBoundingBox'
+    'ModelData:getBoundingBox',
+    'Model:getHeight'
   }
 }

+ 2 - 1
api/lovr/data/ModelData/getMaterialCount.lua

@@ -12,6 +12,7 @@ return {
   related = {
     'ModelData:getMaterialName',
     'ModelData:getMeshMaterial',
-    'ModelData:getMaterial'
+    'ModelData:getMaterial',
+    'Model:getMaterialCount'
   }
 }

+ 2 - 1
api/lovr/data/ModelData/getMaterialName.lua

@@ -18,6 +18,7 @@ return {
   related = {
     'ModelData:getMaterialCount',
     'ModelData:getMeshMaterial',
-    'ModelData:getMaterial'
+    'ModelData:getMaterial',
+    'Model:getMaterialName'
   }
 }

+ 3 - 0
api/lovr/data/ModelData/getMetadata.lua

@@ -12,5 +12,8 @@ return {
       type = 'string',
       description = 'The metadata from the model file.'
     }
+  },
+  related = {
+    'Model:getMetadata'
   }
 }

+ 2 - 1
api/lovr/data/ModelData/getNodeChildren.lua

@@ -32,6 +32,7 @@ return {
   notes = 'If the node does not have any children, this function returns an empty table.',
   related = {
     'ModelData:getNodeParent',
-    'ModelData:getRootNode'
+    'ModelData:getRootNode',
+    'Model:getNodeChildren'
   }
 }

+ 3 - 0
api/lovr/data/ModelData/getNodeCount.lua

@@ -8,5 +8,8 @@ return {
       type = 'number',
       description = 'The number of nodes in the model.'
     }
+  },
+  related = {
+    'Model:getNodeCount'
   }
 }

+ 1 - 1
api/lovr/data/ModelData/getNodeMeshes.lua

@@ -1,5 +1,5 @@
 return {
-  summary = 'Returns the indices of meshes attached to a node.',
+  summary = 'Get the indices of meshes attached to a node.',
   description = [[
     Returns a table of mesh indices attached to a node.  Meshes define the geometry and materials of
     a model, as opposed to the nodes which define the transforms and hierarchy.  A node can have

+ 4 - 1
api/lovr/data/ModelData/getNodeName.lua

@@ -15,5 +15,8 @@ return {
       description = 'The name of the node.'
     }
   },
-  notes = 'If the node does not have a name, this function returns `nil`.'
+  notes = 'If the node does not have a name, this function returns `nil`.',
+  related = {
+    'Model:getNodeName'
+  }
 }

+ 1 - 1
api/lovr/data/ModelData/getNodeOrientation.lua

@@ -1,5 +1,5 @@
 return {
-  summary = 'Returns the local orientation of a node.',
+  summary = 'Get the local orientation of a node.',
   description = 'Returns local orientation of a node, relative to its parent.',
   arguments = {
     index = {

+ 2 - 1
api/lovr/data/ModelData/getNodeParent.lua

@@ -29,6 +29,7 @@ return {
   },
   related = {
     'ModelData:getNodeChildren',
-    'ModelData:getRootNode'
+    'ModelData:getRootNode',
+    'Model:getNodeParent'
   }
 }

+ 1 - 1
api/lovr/data/ModelData/getNodePose.lua

@@ -1,5 +1,5 @@
 return {
-  summary = 'Returns the local pose of a node.',
+  summary = 'Get the local pose of a node.',
   description = 'Returns local pose (position and orientation) of a node, relative to its parent.',
   arguments = {
     index = {

+ 1 - 1
api/lovr/data/ModelData/getNodePosition.lua

@@ -1,5 +1,5 @@
 return {
-  summary = 'Returns the local position of a node.',
+  summary = 'Get the local position of a node.',
   description = 'Returns local position of a node, relative to its parent.',
   arguments = {
     index = {

+ 1 - 1
api/lovr/data/ModelData/getNodeScale.lua

@@ -1,5 +1,5 @@
 return {
-  summary = 'Returns the local scale of a node.',
+  summary = 'Get the local scale of a node.',
   description = 'Returns local scale of a node, relative to its parent.',
   arguments = {
     index = {

+ 1 - 1
api/lovr/data/ModelData/getNodeSkin.lua

@@ -1,5 +1,5 @@
 return {
-  summary = 'Returns the index of the skin used by a node.',
+  summary = 'Get the index of the skin used by a node.',
   description = [[
     Returns the index of the skin used by a node.  Skins are collections of joints used for skeletal
     animation.  A model can have multiple skins, and each node can use at most one skin to drive the

+ 1 - 1
api/lovr/data/ModelData/getNodeTransform.lua

@@ -1,5 +1,5 @@
 return {
-  summary = 'Returns the local transform of a node.',
+  summary = 'Get the local transform of a node.',
   description = [[
     Returns local transform (position, orientation, and scale) of a node, relative to its parent.
   ]],

+ 2 - 1
api/lovr/data/ModelData/getRootNode.lua

@@ -11,6 +11,7 @@ return {
   },
   related = {
     'ModelData:getNodeCount',
-    'ModelData:getNodeParent'
+    'ModelData:getNodeParent',
+    'Model:getRootNode'
   }
 }

+ 4 - 1
api/lovr/data/ModelData/getSkinCount.lua

@@ -12,5 +12,8 @@ return {
       description = 'The number of skins in the model.'
     }
   },
-  notes = 'There is currently a maximum of 256 skins.'
+  notes = 'There is currently a maximum of 256 skins.',
+  related = {
+    'Model:hasJoints'
+  }
 }

+ 2 - 1
api/lovr/data/ModelData/getTriangleCount.lua

@@ -15,6 +15,7 @@ return {
   },
   related = {
     'ModelData:getTriangles',
-    'ModelData:getVertexCount'
+    'ModelData:getVertexCount',
+    'Model:getTriangleCount'
   }
 }

+ 5 - 5
api/lovr/data/ModelData/getTriangles.lua

@@ -1,9 +1,8 @@
 return {
-  summary = 'Get all the triangles in a mesh.',
+  summary = 'Get all the triangles in the model.',
   description = [[
-    Returns the data for all triangles in the mesh.  There are a few differences between this
-    function and the mesh-specific functions like `ModelData:getMeshVertex` and
-    `ModelData:getMeshIndex`:
+    Returns the data for all triangles in the model.  There are a few differences between this and
+    the mesh-specific functions like `ModelData:getMeshVertex` and `ModelData:getMeshIndex`:
 
     - Only vertex positions are returned, not other vertex attributes.
     - Positions are relative to the origin of the whole model, instead of local to a node.
@@ -29,6 +28,7 @@ return {
   notes = 'After this function is called on a ModelData once, the result is cached.',
   related = {
     'ModelData:getTriangleCount',
-    'ModelData:getVertexCount'
+    'ModelData:getVertexCount',
+    'Model:getTriangles'
   }
 }

+ 2 - 1
api/lovr/data/ModelData/getVertexCount.lua

@@ -14,6 +14,7 @@ return {
   },
   related = {
     'ModelData:getTriangles',
-    'ModelData:getTriangleCount'
+    'ModelData:getTriangleCount',
+    'Model:getVertexCount'
   }
 }

+ 2 - 1
api/lovr/data/ModelData/getWidth.lua

@@ -14,6 +14,7 @@ return {
     'ModelData:getDepth',
     'ModelData:getDimensions',
     'ModelData:getCenter',
-    'ModelData:getBoundingBox'
+    'ModelData:getBoundingBox',
+    'Model:getWidth'
   }
 }

+ 19 - 10
api/lovr/graphics/Model/animate.lua

@@ -1,23 +1,23 @@
 return {
-  summary = 'Apply an animation to the pose of the Model.',
+  summary = 'Apply an animation to the nodes of the Model.',
   description = 'TODO',
   arguments = {
     name = {
       type = 'string',
-      description = 'The name of an animation.'
+      description = 'The name of an animation in the model file.'
     },
     index = {
       type = 'number',
-      description = 'The index of an animation.'
+      description = 'The index of an animation in the model file.'
     },
     time = {
       type = 'number',
       description = 'The timestamp to evaluate the keyframes at, in seconds.'
     },
-    alpha = {
+    blend = {
       type = 'number',
-      default = '1',
-      description = 'How much of the animation to mix in, from 0 to 1.'
+      default = '1.0',
+      description = 'How much of the animation\'s pose to blend into the nodes, from 0 to 1.'
     }
   },
   returns = {},
@@ -31,12 +31,21 @@ return {
       returns = {}
     }
   },
+  notes = [[
+    TODO What happens if the timestamp is before the first keyframe?
+    TODO Does it loop?
+  ]],
   related = {
-    'Model:resetPose',
-    'Model:getNodePose',
-    'Model:setNodePose',
     'Model:getAnimationCount',
     'Model:getAnimationName',
-    'Model:getAnimationDuration'
+    'Model:getAnimationDuration',
+    'Model:getNodePosition',
+    'Model:setNodePosition',
+    'Model:getNodeOrientation',
+    'Model:setNodeOrientation',
+    'Model:getNodeScale',
+    'Model:setNodeScale',
+    'Model:getNodeTransform',
+    'Model:setNodeTransform'
   }
 }

+ 5 - 2
api/lovr/graphics/Model/getAnimationDuration.lua

@@ -19,14 +19,17 @@ return {
   },
   variants = {
     {
-      arguments = { 'name' },
+      arguments = { 'index' },
       returns = { 'duration' }
     },
     {
-      arguments = { 'index' },
+      arguments = { 'name' },
       returns = { 'duration' }
     }
   },
+  notes = [[
+    TODO how is duration calculated?
+  ]],
   related = {
     'Model:getAnimationCount',
     'Model:getAnimationName',

+ 1 - 3
api/lovr/graphics/Model/getAnimationName.lua

@@ -17,8 +17,6 @@ return {
   },
   related = {
     'Model:getAnimationCount',
-    'Model:getAnimationDuration',
-    'Model:getMaterialName',
-    'Model:getNodeName'
+    'Model:getAnimationDuration'
   }
 }

+ 15 - 8
api/lovr/graphics/Model/getBoundingBox.lua

@@ -1,40 +1,47 @@
 return {
-  summary = 'Get the axis aligned bounding box of the Model.',
-  description = 'TODO',
+  summary = 'Get the bounding box of the Model.',
+  description = 'Returns the 6 values of the Model\'s axis-aligned bounding box.',
   arguments = {},
   returns = {
     {
       name = 'minx',
       type = 'number',
-      description = 'The minimum x coordinate of the box.'
+      description = 'The minimum x coordinate of the vertices in the Model.'
     },
     {
       name = 'maxx',
       type = 'number',
-      description = 'The maximum x coordinate of the box.'
+      description = 'The maximum x coordinate of the vertices in the Model.'
     },
     {
       name = 'miny',
       type = 'number',
-      description = 'The minimum y coordinate of the box.'
+      description = 'The minimum y coordinate of the vertices in the Model.'
     },
     {
       name = 'maxy',
       type = 'number',
-      description = 'The maximum y coordinate of the box.'
+      description = 'The maximum y coordinate of the vertices in the Model.'
     },
     {
       name = 'minz',
       type = 'number',
-      description = 'The minimum z coordinate of the box.'
+      description = 'The minimum z coordinate of the vertices in the Model.'
     },
     {
       name = 'maxz',
       type = 'number',
-      description = 'The maximum z coordinate of the box.'
+      description = 'The maximum z coordinate of the vertices in the Model.'
     }
   },
   related = {
+    'Model:getWidth',
+    'Model:getHeight',
+    'Model:getDepth',
+    'Model:getDimensions',
+    'Model:getCenter',
+    'Model:getBoundingSphere',
+    'ModelData:getBoundingBox',
     'Collider:getAABB'
   }
 }

+ 36 - 0
api/lovr/graphics/Model/getBoundingSphere.lua

@@ -0,0 +1,36 @@
+return {
+  summary = 'Get the bounding sphere of the Model.',
+  description = 'Returns a sphere approximately enclosing the vertices in the Model.',
+  arguments = {},
+  returns = {
+    {
+      name = 'x',
+      type = 'number',
+      description = 'The x coordinate of the position of the sphere.'
+    },
+    {
+      name = 'y',
+      type = 'number',
+      description = 'The y coordinate of the position of the sphere.'
+    },
+    {
+      name = 'z',
+      type = 'number',
+      description = 'The z coordinate of the position of the sphere.'
+    },
+    {
+      name = 'radius',
+      type = 'number',
+      description = 'The radius of the bounding sphere.'
+    }
+  },
+  related = {
+    'Model:getWidth',
+    'Model:getHeight',
+    'Model:getDepth',
+    'Model:getDimensions',
+    'Model:getCenter',
+    'Model:getBoundingBox',
+    'ModelData:getBoundingSphere'
+  }
+}

+ 32 - 0
api/lovr/graphics/Model/getCenter.lua

@@ -0,0 +1,32 @@
+return {
+  summary = 'Get the center of the Model\'s bounding box.',
+  description = [[
+    Returns the center of the Model's axis-aligned bounding box, relative to the Model's origin.
+  ]],
+  arguments = {},
+  returns = {
+    {
+      name = 'x',
+      type = 'number',
+      description = 'The x offset of the center of the bounding box.'
+    },
+    {
+      name = 'y',
+      type = 'number',
+      description = 'The y offset of the center of the bounding box.'
+    },
+    {
+      name = 'z',
+      type = 'number',
+      description = 'The z offset of the center of the bounding box.'
+    }
+  },
+  related = {
+    'Model:getWidth',
+    'Model:getHeight',
+    'Model:getDepth',
+    'Model:getDimensions',
+    'Model:getBoundingBox',
+    'ModelData:getCenter'
+  }
+}

+ 0 - 0
api/lovr/graphics/Model/getModelData.lua → api/lovr/graphics/Model/getData.lua


+ 20 - 0
api/lovr/graphics/Model/getDepth.lua

@@ -0,0 +1,20 @@
+return {
+  summary = 'Get the depth of the Model.',
+  description = 'Returns the depth of the Model, computed from its axis-aligned bounding box.',
+  arguments = {},
+  returns = {
+    {
+      name = 'depth',
+      type = 'number',
+      description = 'The depth of the Model.'
+    }
+  },
+  related = {
+    'Model:getWidth',
+    'Model:getHeight',
+    'Model:getDimensions',
+    'Model:getCenter',
+    'Model:getBoundingBox',
+    'ModelData:getDepth'
+  }
+}

+ 32 - 0
api/lovr/graphics/Model/getDimensions.lua

@@ -0,0 +1,32 @@
+return {
+  summary = 'Get the dimensions of the Model.',
+  description = [[
+    Returns the width, height, and depth of the Model, computed from its axis-aligned bounding box.
+  ]],
+  arguments = {},
+  returns = {
+    {
+      name = 'width',
+      type = 'number',
+      description = 'The width of the Model.'
+    },
+    {
+      name = 'height',
+      type = 'number',
+      description = 'The height of the Model.'
+    },
+    {
+      name = 'depth',
+      type = 'number',
+      description = 'The depth of the Model.'
+    }
+  },
+  related = {
+    'Model:getWidth',
+    'Model:getHeight',
+    'Model:getDepth',
+    'Model:getCenter',
+    'Model:getBoundingBox',
+    'ModelData:getDimensions'
+  }
+}

+ 20 - 0
api/lovr/graphics/Model/getHeight.lua

@@ -0,0 +1,20 @@
+return {
+  summary = 'Get the height of the Model.',
+  description = 'Returns the height of the Model, computed from its axis-aligned bounding box.',
+  arguments = {},
+  returns = {
+    {
+      name = 'height',
+      type = 'number',
+      description = 'The height of the Model.'
+    }
+  },
+  related = {
+    'Model:getWidth',
+    'Model:getDepth',
+    'Model:getDimensions',
+    'Model:getCenter',
+    'Model:getBoundingBox',
+    'ModelData:getHeight'
+  }
+}

+ 1 - 2
api/lovr/graphics/Model/getMaterial.lua

@@ -29,7 +29,6 @@ return {
   },
   related = {
     'Model:getMaterialCount',
-    'Model:getMaterialName',
-    'Material'
+    'Model:getMaterialName'
   }
 }

+ 1 - 2
api/lovr/graphics/Model/getMaterialName.lua

@@ -17,7 +17,6 @@ return {
   },
   related = {
     'Model:getMaterialCount',
-    'Model:getAnimationName',
-    'Model:getNodeName'
+    'Model:getMaterial'
   }
 }

+ 16 - 0
api/lovr/graphics/Model/getMetadata.lua

@@ -0,0 +1,16 @@
+return {
+  summary = 'Get extra information from the model file.',
+  description = [[
+    Returns extra information stored in the model file.  Currently this is only implemented for glTF
+    models and returns the JSON string from the glTF or glb file.  The metadata can be used to get
+    application-specific data or add support for glTF extensions not supported by LÖVR.
+  ]],
+  arguments = {},
+  returns = {
+    {
+      name = 'metadata',
+      type = 'string',
+      description = 'The metadata from the model file.'
+    }
+  }
+}

+ 37 - 0
api/lovr/graphics/Model/getNodeChildren.lua

@@ -0,0 +1,37 @@
+return {
+  summary = 'Get the children of a node.',
+  description = [[
+    Given a parent node, this function returns a table with the indices of its children.
+  ]],
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of the parent node.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of the parent node.'
+    }
+  },
+  returns = {
+    parent = {
+      type = 'number',
+      description = 'The index of the node\'s parent.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'index' },
+      returns = { 'children' }
+    },
+    {
+      arguments = { 'name' },
+      returns = { 'children' }
+    }
+  },
+  notes = 'If the node does not have any children, this function returns an empty table.',
+  related = {
+    'Model:getNodeParent',
+    'Model:getRootNode'
+  }
+}

+ 3 - 8
api/lovr/graphics/Model/getNodeCount.lua

@@ -1,17 +1,12 @@
 return {
-  summary = 'Get the number of nodes in the Model.',
-  description = 'Returns the number of nodes in the Model.',
+  summary = 'Get the number of nodes in the model.',
+  description = 'Returns the number of nodes in the model.',
   arguments = {},
   returns = {
     {
       name = 'count',
       type = 'number',
-      description = 'The number of nodes in the Model.'
+      description = 'The number of nodes in the model.'
     }
-  },
-  related = {
-    'Model:getNodeName',
-    'Model:getNodePose',
-    'Model:pose'
   }
 }

+ 60 - 0
api/lovr/graphics/Model/getNodeDraw.lua

@@ -0,0 +1,60 @@
+return {
+  summary = 'TODO',
+  description = 'TODO',
+  arguments = {
+    node = {
+      type = 'number',
+      description = 'The index of the node.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of the node.'
+    },
+    index = {
+      type = 'number',
+      description = 'The index of the draw.'
+    }
+  },
+  returns = {
+    mode = {
+      type = 'MeshMode',
+      description = 'Whether the vertices are points, lines, or triangles.'
+    },
+    material = {
+      type = 'Material',
+      description = 'The Material used by the draw.'
+    },
+    start = {
+      type = 'number',
+      description = 'The offset of the first vertex in the draw.'
+    },
+    count = {
+      type = 'number',
+      description = 'The number of vertices in the draw.'
+    },
+    base = {
+      type = 'number',
+      description = [[
+        The base vertex of the draw (added to each instance value), or nil if the draw does not use
+        an index buffer.
+      ]]
+    }
+  },
+  variants = {
+    {
+      arguments = { 'node', 'index' },
+      returns = { 'mode', 'material', 'start', 'count', 'base' }
+    },
+    {
+      arguments = { 'name', 'index' },
+      returns = { 'mode', 'material', 'start', 'count', 'base' }
+    }
+  },
+  related = {
+    'Pass:setMeshMode',
+    'Pass:setMaterial',
+    'Pass:mesh',
+    'Model:getVertexBuffer',
+    'Model:getIndexBuffer'
+  }
+}

+ 34 - 0
api/lovr/graphics/Model/getNodeDrawCount.lua

@@ -0,0 +1,34 @@
+return {
+  summary = 'TODO',
+  description = 'TODO',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of a node.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of a node.'
+    }
+  },
+  returns = {
+    count = {
+      type = 'number',
+      description = 'The number of draws in the node.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'index' },
+      returns = { 'count' }
+    },
+    {
+      arguments = { 'name' },
+      returns = { 'count' }
+    }
+  },
+  related = {
+    'ModelData:getNodeMeshCount',
+    'Model:getNodeDraw'
+  }
+}

+ 58 - 0
api/lovr/graphics/Model/getNodeOrientation.lua

@@ -0,0 +1,58 @@
+return {
+  summary = 'Get the orientation of a node.',
+  description = 'TODO',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of the node.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of the node.'
+    },
+    space = {
+      type = 'CoordinateSpace',
+      default = [['global']],
+      description = 'The coordinate space to return the orientation in.'
+    }
+  },
+  returns = {
+    angle = {
+      type = 'number',
+      description = 'The number of radians the node is rotated around its axis of rotation.'
+    },
+    ax = {
+      type = 'number',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      description = 'The z component of the axis of rotation.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'index', 'space' },
+      returns = { 'angle', 'ax', 'ay', 'az' }
+    },
+    {
+      arguments = { 'name', 'space' },
+      returns = { 'angle', 'ax', 'ay', 'az' }
+    }
+  },
+  related = {
+    'Model:getNodePosition',
+    'Model:setNodePosition',
+    'Model:getNodeScale',
+    'Model:setNodeScale',
+    'Model:getNodePose',
+    'Model:setNodePose',
+    'Model:getNodeTransform',
+    'Model:setNodeTransform',
+    'Model:animate'
+  }
+}

+ 34 - 0
api/lovr/graphics/Model/getNodeParent.lua

@@ -0,0 +1,34 @@
+return {
+  summary = 'Get the parent of a node.',
+  description = 'Given a child node, this function returns the index of its parent.',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of the child node.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of the child node.'
+    }
+  },
+  returns = {
+    parent = {
+      type = 'number',
+      description = 'The index of the parent.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'index' },
+      returns = { 'parent' }
+    },
+    {
+      arguments = { 'name' },
+      returns = { 'parent' }
+    }
+  },
+  related = {
+    'Model:getNodeChildren',
+    'Model:getRootNode'
+  }
+}

+ 20 - 18
api/lovr/graphics/Model/getNodePose.lua

@@ -1,22 +1,19 @@
 return {
-  summary = 'Get the pose of a single node.',
-  description = 'Returns the pose of a single node in the Model in a given `CoordinateSpace`.',
+  summary = 'Get the pose of a node.',
+  description = 'TODO',
   arguments = {
-    name = {
-      type = 'string',
-      description = 'The name of the node.'
-    },
     index = {
       type = 'number',
-      description = 'The node index.'
+      description = 'The index of a node.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of a node.'
     },
     space = {
       type = 'CoordinateSpace',
       default = [['global']],
-      description = [[
-        Whether the pose should be returned relative to the node's parent or relative to the root
-        node of the Model.
-      ]]
+      description = 'The coordinate space to return the pose in.'
     }
   },
   returns = {
@@ -34,7 +31,7 @@ return {
     },
     angle = {
       type = 'number',
-      description = 'The number of radians the node is rotated around its rotational axis.'
+      description = 'The number of radians the node is rotated around its axis of rotation.'
     },
     ax = {
       type = 'number',
@@ -51,18 +48,23 @@ return {
   },
   variants = {
     {
-      arguments = { 'name', 'space' },
+      arguments = { 'index', 'space' },
       returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
     },
     {
-      arguments = { 'index', 'space' },
+      arguments = { 'name', 'space' },
       returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
     }
   },
   related = {
-    'Model:pose',
-    'Model:animate',
-    'Model:getNodeName',
-    'Model:getNodeCount'
+    'Model:getNodePosition',
+    'Model:setNodePosition',
+    'Model:getNodeOrientation',
+    'Model:setNodeOrientation',
+    'Model:getNodeScale',
+    'Model:setNodeScale',
+    'Model:getNodeTransform',
+    'Model:setNodeTransform',
+    'Model:animate'
   }
 }

+ 54 - 0
api/lovr/graphics/Model/getNodePosition.lua

@@ -0,0 +1,54 @@
+return {
+  summary = 'Get the position of a node.',
+  description = 'TODO',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of the node.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of the node.'
+    },
+    space = {
+      type = 'CoordinateSpace',
+      default = [['global']],
+      description = 'The coordinate space to return the position in.'
+    }
+  },
+  returns = {
+    x = {
+      type = 'number',
+      description = 'The x coordinate.'
+    },
+    y = {
+      type = 'number',
+      description = 'The y coordinate.'
+    },
+    z = {
+      type = 'number',
+      description = 'The z coordinate.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'index', 'space' },
+      returns = { 'x', 'y', 'z' }
+    },
+    {
+      arguments = { 'name', 'space' },
+      returns = { 'x', 'y', 'z' }
+    }
+  },
+  related = {
+    'Model:getNodeOrientation',
+    'Model:setNodeOrientation',
+    'Model:getNodeScale',
+    'Model:setNodeScale',
+    'Model:getNodePose',
+    'Model:setNodePose',
+    'Model:getNodeTransform',
+    'Model:setNodeTransform',
+    'Model:animate'
+  }
+}

+ 54 - 0
api/lovr/graphics/Model/getNodeScale.lua

@@ -0,0 +1,54 @@
+return {
+  summary = 'Get the scale of a node.',
+  description = 'TODO',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of the node.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of the node.'
+    },
+    space = {
+      type = 'CoordinateSpace',
+      default = [['global']],
+      description = 'The coordinate space to return the scale in.'
+    }
+  },
+  returns = {
+    x = {
+      type = 'number',
+      description = 'The x scale.'
+    },
+    y = {
+      type = 'number',
+      description = 'The y scale.'
+    },
+    z = {
+      type = 'number',
+      description = 'The z scale.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'index', 'space' },
+      returns = { 'x', 'y', 'z' }
+    },
+    {
+      arguments = { 'name', 'space' },
+      returns = { 'x', 'y', 'z' }
+    }
+  },
+  related = {
+    'Model:getNodePosition',
+    'Model:setNodePosition',
+    'Model:getNodeOrientation',
+    'Model:setNodeOrientation',
+    'Model:getNodePose',
+    'Model:setNodePose',
+    'Model:getNodeTransform',
+    'Model:setNodeTransform',
+    'Model:animate'
+  }
+}

+ 82 - 0
api/lovr/graphics/Model/getNodeTransform.lua

@@ -0,0 +1,82 @@
+return {
+  summary = 'Get the transform of a node.',
+  description = 'TODO',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of a node.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of a node.'
+    },
+    space = {
+      type = 'CoordinateSpace',
+      default = [['global']],
+      description = 'The coordinate space to return the transform in.'
+    }
+  },
+  returns = {
+    x = {
+      type = 'number',
+      description = 'The x position of the node.'
+    },
+    y = {
+      type = 'number',
+      description = 'The y position of the node.'
+    },
+    z = {
+      type = 'number',
+      description = 'The z position of the node.'
+    },
+    sx = {
+      type = 'number',
+      description = 'The x scale of the node.'
+    },
+    sy = {
+      type = 'number',
+      description = 'The y scale of the node.'
+    },
+    sz = {
+      type = 'number',
+      description = 'The z scale of the node.'
+    },
+    angle = {
+      type = 'number',
+      description = 'The number of radians the node is rotated around its axis of rotation.'
+    },
+    ax = {
+      type = 'number',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      description = 'The z component of the axis of rotation.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'index', 'space' },
+      returns = { 'x', 'y', 'z', 'sx', 'sy', 'sz', 'angle', 'ax', 'ay', 'az' }
+    },
+    {
+      arguments = { 'name', 'space' },
+      returns = { 'x', 'y', 'z', 'sx', 'sy', 'sz', 'angle', 'ax', 'ay', 'az' }
+    }
+  },
+  related = {
+    'Model:getNodePosition',
+    'Model:setNodePosition',
+    'Model:getNodeOrientation',
+    'Model:setNodeOrientation',
+    'Model:getNodeScale',
+    'Model:setNodeScale',
+    'Model:getNodePose',
+    'Model:setNodePose',
+    'Model:animate'
+  }
+}

+ 16 - 0
api/lovr/graphics/Model/getRootNode.lua

@@ -0,0 +1,16 @@
+return {
+  summary = 'Get the index of the root node.',
+  description = 'Returns the index of the model\'s root node.',
+  arguments = {},
+  returns = {
+    {
+      name = 'root',
+      type = 'number',
+      description = 'The index of the root node.'
+    }
+  },
+  related = {
+    'Model:getNodeCount',
+    'Model:getNodeParent'
+  }
+}

+ 1 - 0
api/lovr/graphics/Model/getTexture.lua

@@ -10,6 +10,7 @@ return {
     }
   },
   related = {
+    'Model:getTextureCount',
     'Model:getMaterial'
   }
 }

+ 15 - 0
api/lovr/graphics/Model/getTextureCount.lua

@@ -0,0 +1,15 @@
+return {
+  summary = 'Get the number of textures in the Model.',
+  description = 'Returns the number of textures in the Model.',
+  arguments = {},
+  returns = {
+    {
+      name = 'count',
+      type = 'number',
+      description = 'The number of textures in the Model.'
+    }
+  },
+  related = {
+    'Model:getTexture'
+  }
+}

+ 21 - 0
api/lovr/graphics/Model/getTriangleCount.lua

@@ -0,0 +1,21 @@
+return {
+  summary = 'Get the total number of triangles in the Model.',
+  description = 'Returns the total number of triangles in the Model.',
+  arguments = {},
+  returns = {
+    {
+      name = 'count',
+      type = 'number',
+      description = 'The total number of triangles in the Model.'
+    }
+  },
+  notes = [[
+    This isn't always related to the length of the vertex buffer, since a mesh in the Model could be
+    drawn by multiple nodes.
+  ]],
+  related = {
+    'Model:getTriangles',
+    'Model:getVertexCount',
+    'ModelData:getTriangleCount'
+  }
+}

+ 26 - 0
api/lovr/graphics/Model/getTriangles.lua

@@ -0,0 +1,26 @@
+return {
+  summary = 'Get all the triangles in the Model.',
+  description = 'TODO',
+  arguments = {},
+  returns = {
+    {
+      name = 'vertices',
+      type = 'table',
+      description = [[
+        The triangle vertex positions, returned as a flat (non-nested) table of numbers.  The
+        position of each vertex is given as an x, y, and z coordinate.
+      ]]
+    },
+    {
+      name = 'indices',
+      type = 'table',
+      description = 'The vertex indices.  Every 3 indices describes a triangle.'
+    }
+  },
+  notes = 'After this function is called on a Model once, the result is cached (in its ModelData).',
+  related = {
+    'Model:getTriangleCount',
+    'Model:getVertexCount',
+    'ModelData:getTriangles'
+  }
+}

+ 21 - 0
api/lovr/graphics/Model/getVertexCount.lua

@@ -0,0 +1,21 @@
+return {
+  summary = 'Get the total vertex count of the Model.',
+  description = 'Returns the total vertex count of the Model.',
+  arguments = {},
+  returns = {
+    {
+      name = 'count',
+      type = 'number',
+      description = 'The total number of vertices.'
+    }
+  },
+  notes = [[
+    This isn't always the same as the length of the vertex buffer, since a mesh in the Model could
+    be drawn by multiple nodes.
+  ]],
+  related = {
+    'Model:getTriangles',
+    'Model:getTriangleCount',
+    'ModelData:getVertexCount'
+  }
+}

+ 20 - 0
api/lovr/graphics/Model/getWidth.lua

@@ -0,0 +1,20 @@
+return {
+  summary = 'Get the width of the Model.',
+  description = 'Returns the width of the Model, computed from its axis-aligned bounding box.',
+  arguments = {},
+  returns = {
+    {
+      name = 'width',
+      type = 'number',
+      description = 'The width of the Model.'
+    }
+  },
+  related = {
+    'Model:getHeight',
+    'Model:getDepth',
+    'Model:getDimensions',
+    'Model:getCenter',
+    'Model:getBoundingBox',
+    'ModelData:getWidth'
+  }
+}

+ 16 - 0
api/lovr/graphics/Model/hasJoints.lua

@@ -0,0 +1,16 @@
+return {
+  summary = 'Check if the Model uses joints for skeletal animation.',
+  description = 'TODO',
+  arguments = {},
+  returns = {
+    {
+      name = 'jointed',
+      type = 'boolean',
+      description = 'Whether the animation uses joints for skeletal animation.'
+    }
+  },
+  notes = [[
+    TODO it's computed as skinCount
+    TODO it's different from animationCount
+  ]]
+}

+ 0 - 11
api/lovr/graphics/Model/resetPose.lua

@@ -1,11 +0,0 @@
-return {
-  summary = 'Reset the Model to the default pose.',
-  description = 'TODO',
-  arguments = {},
-  returns = {},
-  related = {
-    'Model:animate',
-    'Model:getNodePose',
-    'Model:setNodePose'
-  }
-}

+ 49 - 0
api/lovr/graphics/Model/setNodeOrientation.lua

@@ -0,0 +1,49 @@
+return {
+  summary = 'Set or blend the orientation of a node.',
+  description = 'TODO',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of the node.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of the node.'
+    },
+    orientation = {
+      type = 'rotation',
+      description = 'The target orientation.'
+    },
+    blend = {
+      type = 'number',
+      default = '1.0',
+      description = [[
+        A number from 0 to 1 indicating how much of the target orientation to blend in.  A value of
+        0 will not change the node's orientation at all, whereas 1 will fully blend to the target
+        orientation.
+      ]]
+    }
+  },
+  returns = {},
+  variants = {
+    {
+      arguments = { 'index', 'orientation', 'blend' },
+      returns = {}
+    },
+    {
+      arguments = { 'name', 'orientation', 'blend' },
+      returns = {}
+    }
+  },
+  related = {
+    'Model:getNodePosition',
+    'Model:setNodePosition',
+    'Model:getNodeScale',
+    'Model:setNodeScale',
+    'Model:getNodePose',
+    'Model:setNodePose',
+    'Model:getNodeTransform',
+    'Model:setNodeTransform',
+    'Model:animate'
+  }
+}

+ 52 - 0
api/lovr/graphics/Model/setNodePose.lua

@@ -0,0 +1,52 @@
+return {
+  summary = 'Set or blend the pose of a node.',
+  description = 'TODO',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of the node.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of the node.'
+    },
+    position = {
+      type = 'vector3',
+      description = 'The target position.'
+    },
+    orientation = {
+      type = 'rotation',
+      description = 'The target orientation.'
+    },
+    blend = {
+      type = 'number',
+      default = '1.0',
+      description = [[
+        A number from 0 to 1 indicating how much of the target pose to blend in.  A value of 0 will
+        not change the node's pose at all, whereas 1 will fully blend to the target pose.
+      ]]
+    }
+  },
+  returns = {},
+  variants = {
+    {
+      arguments = { 'index', 'position', 'orientation', 'blend' },
+      returns = {}
+    },
+    {
+      arguments = { 'name', 'position', 'orientation', 'blend' },
+      returns = {}
+    }
+  },
+  related = {
+    'Model:getNodePosition',
+    'Model:setNodePosition',
+    'Model:getNodeOrientation',
+    'Model:setNodeOrientation',
+    'Model:getNodeScale',
+    'Model:setNodeScale',
+    'Model:getNodeTransform',
+    'Model:setNodeTransform',
+    'Model:animate'
+  }
+}

+ 49 - 0
api/lovr/graphics/Model/setNodePosition.lua

@@ -0,0 +1,49 @@
+return {
+  summary = 'Set or blend the position of a node.',
+  description = 'TODO',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of the node.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of the node.'
+    },
+    position = {
+      type = 'vector3',
+      description = 'The target position.'
+    },
+    blend = {
+      type = 'number',
+      default = '1.0',
+      description = [[
+        A number from 0 to 1 indicating how much of the target position to blend in.  A value of 0
+        will not change the node's position at all, whereas 1 will fully blend to the target
+        position.
+      ]]
+    }
+  },
+  returns = {},
+  variants = {
+    {
+      arguments = { 'index', 'position', 'blend' },
+      returns = {}
+    },
+    {
+      arguments = { 'name', 'position', 'blend' },
+      returns = {}
+    }
+  },
+  related = {
+    'Model:getNodeOrientation',
+    'Model:setNodeOrientation',
+    'Model:getNodeScale',
+    'Model:setNodeScale',
+    'Model:getNodePose',
+    'Model:setNodePose',
+    'Model:getNodeTransform',
+    'Model:setNodeTransform',
+    'Model:animate'
+  }
+}

+ 48 - 0
api/lovr/graphics/Model/setNodeScale.lua

@@ -0,0 +1,48 @@
+return {
+  summary = 'Set or blend the scale of a node.',
+  description = 'TODO',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of the node.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of the node.'
+    },
+    scale = {
+      type = 'vector3',
+      description = 'The target scale.'
+    },
+    blend = {
+      type = 'number',
+      default = '1.0',
+      description = [[
+        A number from 0 to 1 indicating how much of the target scale to blend in.  A value of 0 will
+        not change the node's scale at all, whereas 1 will fully blend to the target scale.
+      ]]
+    }
+  },
+  returns = {},
+  variants = {
+    {
+      arguments = { 'index', 'scale', 'blend' },
+      returns = {}
+    },
+    {
+      arguments = { 'name', 'scale', 'blend' },
+      returns = {}
+    }
+  },
+  related = {
+    'Model:getNodePosition',
+    'Model:setNodePosition',
+    'Model:getNodeOrientation',
+    'Model:setNodeOrientation',
+    'Model:getNodePose',
+    'Model:setNodePose',
+    'Model:getNodeTransform',
+    'Model:setNodeTransform',
+    'Model:animate'
+  }
+}

+ 49 - 0
api/lovr/graphics/Model/setNodeTransform.lua

@@ -0,0 +1,49 @@
+return {
+  summary = 'Set or blend the transform of a node.',
+  description = 'TODO',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of the node.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of the node.'
+    },
+    transform = {
+      type = 'transform',
+      description = 'The target transform.'
+    },
+    blend = {
+      type = 'number',
+      default = '1.0',
+      description = [[
+        A number from 0 to 1 indicating how much of the target transform to blend in.  A value of 0
+        will not change the node's transform at all, whereas 1 will fully blend to the target
+        transform.
+      ]]
+    }
+  },
+  returns = {},
+  variants = {
+    {
+      arguments = { 'index', 'transform', 'blend' },
+      returns = {}
+    },
+    {
+      arguments = { 'name', 'transform', 'blend' },
+      returns = {}
+    }
+  },
+  related = {
+    'Model:getNodePosition',
+    'Model:setNodePosition',
+    'Model:getNodeOrientation',
+    'Model:setNodeOrientation',
+    'Model:getNodeScale',
+    'Model:setNodeScale',
+    'Model:getNodePose',
+    'Model:setNodePose',
+    'Model:animate'
+  }
+}

+ 1 - 1
api/lovr/graphics/Pass/cone.lua

@@ -17,7 +17,7 @@ return {
       default = '64',
       description = 'The number of circular segments to render.'
     }
-  }
+  },
   returns = {},
   notes = 'TODO'
 }

+ 1 - 1
api/lovr/graphics/Pass/copy.lua

@@ -18,7 +18,7 @@ return {
     image = {
       type = 'Image',
       description = 'TODO'
-    }
+    },
     texturesrc = {
       type = 'Texture',
       description = 'TODO'

+ 1 - 1
api/lovr/graphics/Pass/mesh.lua

@@ -27,7 +27,7 @@ return {
     stride = {
       type = 'number',
       description = 'TODO'
-    }
+    },
     transform = {
       type = 'transform',
       description = 'The transform to apply to the mesh.'

+ 7 - 0
api/lovr/graphics/Pass/mipmap.lua

@@ -20,5 +20,12 @@ return {
       default = 'nil',
       description = 'TODO'
     }
+  },
+  returns = {},
+  variants = {
+    {
+      arguments = { 'texture', 'base', 'count' },
+      returns = {}
+    }
   }
 }

+ 3 - 1
api/lovr/graphics/Pass/read.lua

@@ -52,7 +52,9 @@ return {
       type = 'number',
       default = 'nil',
       description = 'TODO'
-    },
+    }
+  },
+  returns = {
     readback = {
       type = 'Readback',
       description = 'TODO'

+ 1 - 1
api/lovr/graphics/Shader/getWorkgroupSize.lua

@@ -12,7 +12,7 @@ return {
       name = 'y',
       type = 'number',
       description = 'The y size of a workgroup.'
-    }
+    },
     {
       name = 'z',
       type = 'number',

Some files were not shown because too many files changed in this diff