Kaynağa Gözat

ModelData docs;

whew
bjorn 3 yıl önce
ebeveyn
işleme
2fcc549d9a
42 değiştirilmiş dosya ile 2666 ekleme ve 93 silme
  1. 1436 92
      api/init.lua
  2. 18 0
      api/lovr/data/AnimationProperty.lua
  3. 34 0
      api/lovr/data/AttributeType.lua
  4. 1 1
      api/lovr/data/ChannelLayout.lua
  5. 36 0
      api/lovr/data/DefaultAttribute.lua
  6. 45 0
      api/lovr/data/DrawMode.lua
  7. 38 0
      api/lovr/data/ModelData/getAnimationChannelCount.lua
  8. 12 0
      api/lovr/data/ModelData/getAnimationCount.lua
  9. 23 0
      api/lovr/data/ModelData/getAnimationDuration.lua
  10. 46 0
      api/lovr/data/ModelData/getAnimationKeyframe.lua
  11. 38 0
      api/lovr/data/ModelData/getAnimationKeyframeCount.lua
  12. 19 0
      api/lovr/data/ModelData/getAnimationName.lua
  13. 38 0
      api/lovr/data/ModelData/getAnimationNode.lua
  14. 39 0
      api/lovr/data/ModelData/getAnimationProperty.lua
  15. 38 0
      api/lovr/data/ModelData/getAnimationSmoothMode.lua
  16. 45 0
      api/lovr/data/ModelData/getBoundingBox.lua
  17. 35 0
      api/lovr/data/ModelData/getBoundingSphere.lua
  18. 31 0
      api/lovr/data/ModelData/getCenter.lua
  19. 19 0
      api/lovr/data/ModelData/getDepth.lua
  20. 31 0
      api/lovr/data/ModelData/getDimensions.lua
  21. 19 0
      api/lovr/data/ModelData/getHeight.lua
  22. 171 0
      api/lovr/data/ModelData/getMaterial.lua
  23. 17 0
      api/lovr/data/ModelData/getMaterialCount.lua
  24. 23 0
      api/lovr/data/ModelData/getMaterialName.lua
  25. 15 0
      api/lovr/data/ModelData/getMeshCount.lua
  26. 21 0
      api/lovr/data/ModelData/getMeshDrawMode.lua
  27. 33 0
      api/lovr/data/ModelData/getMeshIndex.lua
  28. 22 0
      api/lovr/data/ModelData/getMeshIndexCount.lua
  29. 42 0
      api/lovr/data/ModelData/getMeshIndexFormat.lua
  30. 20 0
      api/lovr/data/ModelData/getMeshMaterial.lua
  31. 32 0
      api/lovr/data/ModelData/getMeshVertex.lua
  32. 21 0
      api/lovr/data/ModelData/getMeshVertexCount.lua
  33. 37 0
      api/lovr/data/ModelData/getMeshVertexFormat.lua
  34. 16 0
      api/lovr/data/ModelData/getSkinCount.lua
  35. 23 0
      api/lovr/data/ModelData/getSkinInverseBindMatrix.lua
  36. 18 0
      api/lovr/data/ModelData/getSkinJoints.lua
  37. 20 0
      api/lovr/data/ModelData/getTriangleCount.lua
  38. 34 0
      api/lovr/data/ModelData/getTriangles.lua
  39. 19 0
      api/lovr/data/ModelData/getVertexCount.lua
  40. 19 0
      api/lovr/data/ModelData/getWidth.lua
  41. 18 0
      api/lovr/data/SmoothMode.lua
  42. 4 0
      api/main.lua

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1436 - 92
api/init.lua


+ 18 - 0
api/lovr/data/AnimationProperty.lua

@@ -0,0 +1,18 @@
+return {
+  summary = 'Different animated properties.',
+  description = 'This indicates the different transform properties that can be animated.',
+  values = {
+    {
+      name = 'translation',
+      description = 'Node translation.'
+    },
+    {
+      name = 'rotation',
+      description = 'Node rotation.'
+    },
+    {
+      name = 'scale',
+      description = 'Node scale.'
+    }
+  }
+}

+ 34 - 0
api/lovr/data/AttributeType.lua

@@ -0,0 +1,34 @@
+return {
+  summary = 'Data types for vertex attributes in meshes.',
+  description = 'These are the data types that can be used by vertex data in meshes.',
+  values = {
+    {
+      name = 'i8',
+      description = 'Signed 8 bit integers (-128 to 127).'
+    },
+    {
+      name = 'u8',
+      description = 'Unsigned 8 bit integers (0 to 255).'
+    },
+    {
+      name = 'i16',
+      description = 'Signed 16 bit integers (-32768 to 32767).'
+    },
+    {
+      name = 'u16',
+      description = 'Unsigned 16 bit integers (0 to 65535).'
+    },
+    {
+      name = 'i32',
+      description = 'Signed 32 bit integers (-2147483648 to 2147483647).'
+    },
+    {
+      name = 'u32',
+      description = 'Unsigned 32 bit integers (0 to 429467295).'
+    },
+    {
+      name = 'f32',
+      description = 'Floating point numbers.'
+    }
+  }
+}

+ 1 - 1
api/lovr/data/ChannelLayout.lua

@@ -20,7 +20,7 @@ return {
       description = [[
         4 channels.  Ambisonic channels don't map directly to speakers but instead represent
         directions in 3D space, sort of like the images of a skybox.  Currently, ambisonic sounds
-        can only be loaded, not played.  
+        can only be loaded, not played.
       ]]
     }
   },

+ 36 - 0
api/lovr/data/DefaultAttribute.lua

@@ -0,0 +1,36 @@
+return {
+  summary = 'Attributes that can be loaded from a model.',
+  description = [[
+    These are the different types of attributes that may be present in meshes loaded from models.
+  ]],
+  values = {
+    {
+      name = 'position',
+      description = 'Vertex positions.'
+    },
+    {
+      name = 'normal',
+      description = 'Vertex normal vectors.'
+    },
+    {
+      name = 'uv',
+      description = 'Vertex texture coordinates.'
+    },
+    {
+      name = 'color',
+      description = 'Vertex colors.'
+    },
+    {
+      name = 'tangent',
+      description = 'Vertex tangent vectors.'
+    },
+    {
+      name = 'joints',
+      description = 'Vertex joint indices.'
+    },
+    {
+      name = 'weights',
+      description = 'Vertex joint weights.'
+    }
+  }
+}

+ 45 - 0
api/lovr/data/DrawMode.lua

@@ -0,0 +1,45 @@
+return {
+  summary = 'Different draw modes for meshes in ModelDatas.',
+  description = 'The DrawMode of a mesh determines how its vertices are connected together.',
+  values = {
+    {
+      name = 'points',
+      description = 'Each vertex is draw as a single point.'
+    },
+    {
+      name = 'lines',
+      description = 'Every pair of vertices is drawn as a line.'
+    },
+    {
+      name = 'linestrip',
+      description = 'Draws a single line through all of the vertices.'
+    },
+    {
+      name = 'lineloop',
+      description = [[
+        Draws a single line through all of the vertices, then connects back to the first vertex.
+      ]]
+    },
+    {
+      name = 'strip',
+      description = [[
+        Vertices are rendered as triangles.  After the first 3 vertices, each
+        subsequent vertex connects to the previous two.
+      ]]
+    },
+    {
+      name = 'triangles',
+      description = 'Every 3 vertices forms a triangle.'
+    },
+    {
+      name = 'fan',
+      description = [[
+        Vertices are rendered as triangles.  After the first 3 vertices, each
+        subsequent vertex is connected to the previous vertex and the first vertex.
+      ]]
+    }
+  },
+  related = {
+    'ModelData:getMeshDrawMode'
+  }
+}

+ 38 - 0
api/lovr/data/ModelData/getAnimationChannelCount.lua

@@ -0,0 +1,38 @@
+return {
+  summary = 'Get the number of channels in an animation.',
+  description = [[
+    Returns the number of channels in an animation.
+
+    A channel is a set of keyframes for a single property of a node.
+  ]],
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of an animation.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of an animation.'
+    }
+  },
+  returns = {
+    count = {
+      type = 'number',
+      description = 'The number of channels in the animation.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'index' },
+      returns = { 'count' }
+    },
+    {
+      arguments = { 'name' },
+      returns = { 'count' }
+    }
+  },
+  related = {
+    'ModelData:getAnimationNode',
+    'ModelData:getAnimationProperty'
+  }
+}

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

@@ -0,0 +1,12 @@
+return {
+  summary = 'Get the number of animations in the model.',
+  description = 'Returns the number of animations in the model.',
+  arguments = {},
+  returns = {
+    {
+      name = 'count',
+      type = 'number',
+      description = 'The number of animations in the model.'
+    }
+  }
+}

+ 23 - 0
api/lovr/data/ModelData/getAnimationDuration.lua

@@ -0,0 +1,23 @@
+return {
+  summary = 'Get the duration of an animation.',
+  description = 'Returns the duration of an animation.',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of the animation.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of the animation.'
+    }
+  },
+  returns = {
+    duration = {
+      type = 'number',
+      description = 'The duration of the animation, in seconds.'
+    }
+  },
+  notes = [[
+    The duration of the animation is calculated as the latest timestamp of all of its channels.
+  ]]
+}

+ 46 - 0
api/lovr/data/ModelData/getAnimationKeyframe.lua

@@ -0,0 +1,46 @@
+return {
+  summary = 'Get a keyframe in a channel of an animation.',
+  description = 'Returns a single keyframe in a channel of an animation.',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of an animation.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of an animation.'
+    },
+    channel = {
+      type = 'number',
+      description = 'The index of a channel in the animation.'
+    },
+    keyframe = {
+      type = 'number',
+      description = 'The index of a keyframe in the channel.'
+    }
+  },
+  returns = {
+    time = {
+      type = 'number',
+      description = 'The timestamp of the keyframe.'
+    },
+    ['...'] = {
+      type = 'number',
+      description = 'The data for the keyframe (either 3 or 4 numbers depending on the property).'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'index', 'channel', 'keyframe' },
+      returns = { 'time', '...' }
+    },
+    {
+      arguments = { 'name', 'channel', 'keyframe' },
+      returns = { 'time', '...' }
+    }
+  },
+  related = {
+    'ModelData:getAnimationSmoothMode',
+    'ModelData:getAnimationKeyframeCount'
+  }
+}

+ 38 - 0
api/lovr/data/ModelData/getAnimationKeyframeCount.lua

@@ -0,0 +1,38 @@
+return {
+  summary = 'Get the number of keyframes in a channel of an animation.',
+  description = 'Returns the number of keyframes in a channel of an animation.',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of an animation.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of an animation.'
+    },
+    channel = {
+      type = 'number',
+      description = 'The index of a channel in the animation.'
+    }
+  },
+  returns = {
+    count = {
+      type = 'number',
+      description = 'The number of keyframes in the channel.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'index', 'channel' },
+      returns = { 'count' }
+    },
+    {
+      arguments = { 'name', 'channel' },
+      returns = { 'count' }
+    }
+  },
+  related = {
+    'ModelData:getAnimationSmoothMode',
+    'ModelData:getAnimationKeyframe'
+  }
+}

+ 19 - 0
api/lovr/data/ModelData/getAnimationName.lua

@@ -0,0 +1,19 @@
+return {
+  summary = 'Get the name of an animation.',
+  description = 'Returns the name of an animation.',
+  arguments = {
+    {
+      name = 'index',
+      type = 'number',
+      description = 'The index of the animation.'
+    }
+  },
+  returns = {
+    {
+      name = 'name',
+      type = 'string',
+      description = 'The name of the animation.'
+    }
+  },
+  notes = 'If the animation does not have a name, this function returns `nil`.'
+}

+ 38 - 0
api/lovr/data/ModelData/getAnimationNode.lua

@@ -0,0 +1,38 @@
+return {
+  summary = 'Get the node targeted by the channel of an animation.',
+  description = 'Returns the index of a node targeted by an animation\'s channel.',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of an animation.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of an animation.'
+    },
+    channel = {
+      type = 'number',
+      description = 'The index of a channel in the animation.'
+    }
+  },
+  returns = {
+    node = {
+      type = 'number',
+      description = 'The index of the node targeted by the channel.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'index', 'channel' },
+      returns = { 'node' }
+    },
+    {
+      arguments = { 'name', 'channel' },
+      returns = { 'node' }
+    }
+  },
+  related = {
+    'ModelData:getAnimationNode',
+    'ModelData:getAnimationProperty'
+  }
+}

+ 39 - 0
api/lovr/data/ModelData/getAnimationProperty.lua

@@ -0,0 +1,39 @@
+return {
+  summary = 'Get the property targeted by the channel of an animation.',
+  description = 'Returns the property targeted by an animation\'s channel.',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of an animation.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of an animation.'
+    },
+    channel = {
+      type = 'number',
+      description = 'The index of a channel in the animation.'
+    }
+  },
+  returns = {
+    property = {
+      type = 'AnimationProperty',
+      description = 'The property (translation, rotation, scale) affected by the keyframes.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'index', 'channel' },
+      returns = { 'property' }
+    },
+    {
+      arguments = { 'name', 'channel' },
+      returns = { 'property' }
+    }
+  },
+  related = {
+    'ModelData:getAnimationNode',
+    'ModelData:getAnimationProperty',
+    'ModelData:getAnimationSmoothMode'
+  }
+}

+ 38 - 0
api/lovr/data/ModelData/getAnimationSmoothMode.lua

@@ -0,0 +1,38 @@
+return {
+  summary = 'Get the smooth mode of a channel in an animation.',
+  description = 'Returns the smooth mode of a channel in an animation.',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of an animation.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of an animation.'
+    },
+    channel = {
+      type = 'number',
+      description = 'The index of a channel in the animation.'
+    }
+  },
+  returns = {
+    smooth = {
+      type = 'SmoothMode',
+      description = 'The smooth mode of the keyframes.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'index', 'channel' },
+      returns = { 'smooth' }
+    },
+    {
+      arguments = { 'name', 'channel' },
+      returns = { 'smooth' }
+    }
+  },
+  related = {
+    'ModelData:getAnimationNode',
+    'ModelData:getAnimationProperty'
+  }
+}

+ 45 - 0
api/lovr/data/ModelData/getBoundingBox.lua

@@ -0,0 +1,45 @@
+return {
+  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 vertices in the model.'
+    },
+    {
+      name = 'maxx',
+      type = 'number',
+      description = 'The maximum x coordinate of the vertices in the model.'
+    },
+    {
+      name = 'miny',
+      type = 'number',
+      description = 'The minimum y coordinate of the vertices in the model.'
+    },
+    {
+      name = 'maxy',
+      type = 'number',
+      description = 'The maximum y coordinate of the vertices in the model.'
+    },
+    {
+      name = 'minz',
+      type = 'number',
+      description = 'The minimum z coordinate of the vertices in the model.'
+    },
+    {
+      name = 'maxz',
+      type = 'number',
+      description = 'The maximum z coordinate of the vertices in the model.'
+    }
+  },
+  related = {
+    'ModelData:getWidth',
+    'ModelData:getHeight',
+    'ModelData:getDepth',
+    'ModelData:getDimensions',
+    'ModelData:getCenter',
+    'ModelData:getBoundingSphere'
+  }
+}

+ 35 - 0
api/lovr/data/ModelData/getBoundingSphere.lua

@@ -0,0 +1,35 @@
+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 = {
+    'ModelData:getWidth',
+    'ModelData:getHeight',
+    'ModelData:getDepth',
+    'ModelData:getDimensions',
+    'ModelData:getCenter',
+    'ModelData:getBoundingBox'
+  }
+}

+ 31 - 0
api/lovr/data/ModelData/getCenter.lua

@@ -0,0 +1,31 @@
+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 = {
+    'ModelData:getWidth',
+    'ModelData:getHeight',
+    'ModelData:getDepth',
+    'ModelData:getDimensions',
+    'ModelData:getBoundingBox'
+  }
+}

+ 19 - 0
api/lovr/data/ModelData/getDepth.lua

@@ -0,0 +1,19 @@
+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 = {
+    'ModelData:getWidth',
+    'ModelData:getHeight',
+    'ModelData:getDimensions',
+    'ModelData:getCenter',
+    'ModelData:getBoundingBox'
+  }
+}

+ 31 - 0
api/lovr/data/ModelData/getDimensions.lua

@@ -0,0 +1,31 @@
+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 = {
+    'ModelData:getWidth',
+    'ModelData:getHeight',
+    'ModelData:getDepth',
+    'ModelData:getCenter',
+    'ModelData:getBoundingBox'
+  }
+}

+ 19 - 0
api/lovr/data/ModelData/getHeight.lua

@@ -0,0 +1,19 @@
+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 = {
+    'ModelData:getWidth',
+    'ModelData:getDepth',
+    'ModelData:getDimensions',
+    'ModelData:getCenter',
+    'ModelData:getBoundingBox'
+  }
+}

+ 171 - 0
api/lovr/data/ModelData/getMaterial.lua

@@ -0,0 +1,171 @@
+return {
+  summary = 'Get the material properties for a material in the model.',
+  description = 'Returns a table with all of the properties of a material.',
+  arguments = {
+    index = {
+      type = 'number',
+      description = 'The index of a material.'
+    },
+    name = {
+      type = 'string',
+      description = 'The name of a material.'
+    }
+  },
+  returns = {
+    properties = {
+      type = 'table',
+      description = 'The material properties.',
+      table = {
+        {
+          name = 'color',
+          type = 'table',
+          description = [[
+            The color of the material.  The table contains the `r`, `g`, `b`, and `a` components of the color,
+            from 0 to 1.
+          ]]
+        },
+        {
+          name = 'glow',
+          type = 'table',
+          description = [[
+            The glow color of the material (sometimes called emissive).  The table contains the `r`,
+            `g`, and `b` components of the color from 0 to 1, and a fourth number indicating the
+            strength of the glow.
+          ]]
+        },
+        {
+          name = 'uvShift',
+          type = 'table',
+          description = 'A table with 2 numbers indicating an offset to apply to UVs.'
+        },
+        {
+          name = 'uvScale',
+          type = 'table',
+          description = [[
+            A table with 2 numbers indicating a scale to apply to UVs.  By default, shaders apply
+            the UV scale before the UV offset.
+          ]]
+        },
+        {
+          name = 'metalness',
+          type = 'number',
+          description = [[
+            The metalness parameter of the material.  This is typically 0 or 1.  By default, shaders
+            multiply this property with the value from the metalness texture (when present) to get
+            the final metalness used for shading.
+          ]]
+        },
+        {
+          name = 'roughness',
+          type = 'number',
+          description = [[
+            The roughness parameter of the material.  By default, shaders multiply this property
+            with the value from the roughness texture (when present) to get the final roughness used
+            for shading.
+          ]]
+        },
+        {
+          name = 'clearcoat',
+          type = 'number',
+          description = 'The clearcoat parameter of the material.'
+        },
+        {
+          name = 'clearcoatRoughness',
+          type = 'number',
+          description = 'The roughness of the clearcoat layer.'
+        },
+        {
+          name = 'occlusionStrength',
+          type = 'number',
+          description = [[
+            A number multiplied by the value from the ambient occlusion texture to control how
+            strong the occlusion effect is.
+          ]]
+        },
+        {
+          name = 'normalScale',
+          type = 'number',
+          description = [[
+            A number multiplied by the value from the normal texture to control how strong the
+            normal mapping effect is.
+          ]]
+        },
+        {
+          name = 'alphaCutoff',
+          type = 'number',
+          description = [[
+            If a pixel has an alpha value less than the alpha cutoff, it will be discarded, which
+            prevents it from occluding things behind it.  This is sometimes called "holepunch" or
+            "cutout" alpha.  It's useful for textures with transparency.
+          ]]
+        },
+        {
+          name = 'texture',
+          type = 'number',
+          description = 'The index of the Image used for the color texture.',
+        },
+        {
+          name = 'glowTexture',
+          type = 'number',
+          description = 'The index of the Image used for the glow texture.',
+        },
+        {
+          name = 'occlusionTexture',
+          type = 'number',
+          description = [[
+            The index of the Image used for the ambient occlusion texture.  The red channel of the
+            texture is used for ambient occlusion, allowing multiple parameters to use the same
+            texture.
+          ]]
+        },
+        {
+          name = 'metalnessTexture',
+          type = 'number',
+          description = [[
+            The index of the Image used for the metalness texture.  The blue channel of the texture
+            is used for metalness, allowing multiple parameters to use the same texture.
+          ]]
+        },
+        {
+          name = 'roughnessTexture',
+          type = 'number',
+          description = [[
+            The index of the Image to use for the roughness texture.  The green channel of the
+            texture is used for roughness, allowing multiple parameters to use the same texture.
+          ]]
+        },
+        {
+          name = 'clearcoatTexture',
+          type = 'number',
+          description = [[
+            The index of the Image to use for the clearcoat texture.  The red channel of the texture
+            is used for the clearcoat parameter, allowing multiple parameters to use the same
+            texture.
+          ]]
+        },
+        {
+          name = 'normalTexture',
+          type = 'number',
+          description = 'The index of the Image to use for the normal map.'
+        }
+      }
+    }
+  },
+  variants = {
+    {
+      arguments = { 'index' },
+      returns = { 'properties' }
+    },
+    {
+      arguments = { 'name' },
+      returns = { 'properties' }
+    }
+  },
+  notes = 'All images are optional and may be `nil`.',
+  related = {
+    'ModelData:getMaterialCount',
+    'ModelData:getMeshMaterial',
+    'lovr.graphics.newMaterial',
+    'Model:getMaterial'
+  }
+}

+ 17 - 0
api/lovr/data/ModelData/getMaterialCount.lua

@@ -0,0 +1,17 @@
+return {
+  summary = 'Get the number of materials in the model.',
+  description = 'Returns the number of materials in the model.',
+  arguments = {},
+  returns = {
+    {
+      name = 'count',
+      type = 'number',
+      description = 'The number of materials in the model.'
+    }
+  },
+  related = {
+    'ModelData:getMaterialName',
+    'ModelData:getMeshMaterial',
+    'ModelData:getMaterial'
+  }
+}

+ 23 - 0
api/lovr/data/ModelData/getMaterialName.lua

@@ -0,0 +1,23 @@
+return {
+  summary = 'Get the name of a material in the model.',
+  description = 'Returns the name of a material in the model.',
+  arguments = {
+    {
+      name = 'index',
+      type = 'number',
+      description = 'The index of a material.'
+    }
+  },
+  returns = {
+    {
+      name = 'name',
+      type = 'string',
+      description = 'The name of the material, or nil if the material does not have a name.'
+    }
+  },
+  related = {
+    'ModelData:getMaterialCount',
+    'ModelData:getMeshMaterial',
+    'ModelData:getMaterial'
+  }
+}

+ 15 - 0
api/lovr/data/ModelData/getMeshCount.lua

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

+ 21 - 0
api/lovr/data/ModelData/getMeshDrawMode.lua

@@ -0,0 +1,21 @@
+return {
+  summary = 'Get the draw mode of a mesh.',
+  description = [[
+    Returns the draw mode of a mesh.  This controls how its vertices are connected together (points,
+    lines, or triangles).
+  ]],
+  arguments = {
+    {
+      name = 'mesh',
+      type = 'number',
+      description = 'The index of a mesh.'
+    }
+  },
+  returns = {
+    {
+      name = 'mode',
+      type = 'DrawMode',
+      description = 'The draw mode of the mesh.'
+    }
+  }
+}

+ 33 - 0
api/lovr/data/ModelData/getMeshIndex.lua

@@ -0,0 +1,33 @@
+return {
+  summary = 'Get one of the vertex indices in a mesh.',
+  description = [[
+    Returns one of the vertex indices in a mesh.  If a mesh has vertex indices, they define the
+    order and connectivity of the vertices in the mesh, allowing a vertex to be reused multiple
+    times without duplicating its data.
+  ]],
+  arguments = {
+    {
+      name = 'mesh',
+      type = 'number',
+      description = 'The index of a mesh to get the vertex from.'
+    },
+    {
+      name = 'index',
+      type = 'number',
+      description = 'The index of a vertex index in the mesh to retrieve.'
+    }
+  },
+  returns = {
+    {
+      name = 'vertexindex',
+      type = 'number',
+      description = 'The vertex index.  Like all indices in Lua, this is 1-indexed.'
+    }
+  },
+  related = {
+    'ModelData:getMeshIndexFormat',
+    'ModelData:getMeshIndexCount',
+    'ModelData:getMeshVertex',
+    'ModelData:getTriangles'
+  }
+}

+ 22 - 0
api/lovr/data/ModelData/getMeshIndexCount.lua

@@ -0,0 +1,22 @@
+return {
+  summary = 'Get the number of vertex indices in a mesh.',
+  description = [[
+    Returns the number of vertex indices in a mesh.  Vertex indices allow for vertices to be reused
+    when defining triangles.
+  ]],
+  arguments = {
+    {
+      name = 'mesh',
+      type = 'number',
+      description = 'The index of a mesh.'
+    }
+  },
+  returns = {
+    {
+      name = 'count',
+      type = 'number',
+      description = 'The number of vertex indices in the mesh.'
+    }
+  },
+  notes = 'This may return zero if the mesh does not use indices.'
+}

+ 42 - 0
api/lovr/data/ModelData/getMeshIndexFormat.lua

@@ -0,0 +1,42 @@
+return {
+  summary = 'Get the data format of vertex indices in a mesh.',
+  description = [[
+    Returns the data format of vertex indices in a mesh.  If a mesh doesn't use vertex indices, this
+    function returns nil.
+  ]],
+  arguments = {
+    {
+      name = 'mesh',
+      type = 'number',
+      description = 'The index of a mesh.'
+    }
+  },
+  returns = {
+    {
+      name = 'type',
+      type = 'AttributeType',
+      description = 'The data type of each vertex index (always u16 or u32).'
+    },
+    {
+      name = 'blob',
+      type = 'number',
+      description = 'The index of a Blob in the mesh where the binary data is stored.'
+    },
+    {
+      name = 'offset',
+      type = 'number',
+      description = 'A byte offset into the Blob\'s data where the index data starts.'
+    },
+    {
+      name = 'stride',
+      type = 'number',
+      description = [[
+        The number of bytes between subsequent vertex indices.  Indices are always tightly packed,
+        so this will always be 2 or 4 depending on the data type.
+      ]]
+    }
+  },
+  related = {
+    'ModelData:getMeshVertexFormat'
+  }
+}

+ 20 - 0
api/lovr/data/ModelData/getMeshMaterial.lua

@@ -0,0 +1,20 @@
+return {
+  summary = 'Get the index of the material applied to a mesh.',
+  description = 'Returns the index of the material applied to a mesh.',
+  arguments = {
+    {
+      name = 'mesh',
+      type = 'number',
+      description = 'The index of a mesh.'
+    }
+  },
+  returns = {
+    {
+      name = 'material',
+      type = 'number',
+      description = [[
+        The index of the material applied to the mesh, or nil if the mesh does not have a material.
+      ]]
+    }
+  }
+}

+ 32 - 0
api/lovr/data/ModelData/getMeshVertex.lua

@@ -0,0 +1,32 @@
+return {
+  summary = 'Get the data for a single vertex in a mesh.',
+  description = [[
+    Returns the data for a single vertex in a mesh.  The data returned depends on the vertex format
+    of a mesh, which is given by `ModelData:getMeshVertexFormat`.
+  ]],
+  arguments = {
+    {
+      name = 'mesh',
+      type = 'number',
+      description = 'The index of a mesh to get the vertex from.'
+    },
+    {
+      name = 'vertex',
+      type = 'number',
+      description = 'The index of a vertex in the mesh to retrieve.'
+    }
+  },
+  returns = {
+    {
+      name = '...',
+      type = 'number',
+      description = 'The data for all of the attributes of the vertex.'
+    }
+  },
+  related = {
+    'ModelData:getMeshVertexFormat',
+    'ModelData:getMeshVertexCount',
+    'ModelData:getMeshIndex',
+    'ModelData:getTriangles'
+  }
+}

+ 21 - 0
api/lovr/data/ModelData/getMeshVertexCount.lua

@@ -0,0 +1,21 @@
+return {
+  summary = 'Get the number of vertices in a mesh.',
+  description = 'Returns the number of vertices in a mesh.',
+  arguments = {
+    {
+      name = 'mesh',
+      type = 'number',
+      description = 'The index of a mesh.'
+    }
+  },
+  returns = {
+    {
+      name = 'count',
+      type = 'number',
+      description = 'The number of vertices in the mesh.'
+    }
+  },
+  related = {
+    'ModelData:getMeshIndexCount'
+  }
+}

+ 37 - 0
api/lovr/data/ModelData/getMeshVertexFormat.lua

@@ -0,0 +1,37 @@
+return {
+  summary = 'Get the vertex format of a mesh.',
+  description = [[
+    Returns the vertex format of a mesh.  The vertex format defines the properties associated with
+    each vertex (position, color, etc.), including their types and binary data layout.
+  ]],
+  arguments = {
+    {
+      name = 'mesh',
+      type = 'number',
+      description = 'The index of a mesh.'
+    }
+  },
+  returns = {
+    {
+      name = 'format',
+      type = 'table',
+      description = 'The vertex format of the mesh.'
+    }
+  },
+  notes = [[
+    The format is given as a table of vertex attributes.  Each attribute is a table containing the
+    following:
+
+        { name, type, components, blob, offset, stride }
+
+    - The `name` will be a `DefaultAttribute`.
+    - The `type` will be an `AttributeType`.
+    - The `component` count will be 1-4.
+    - The `blob` is an index of one of the Blobs in the model (see `ModelData:getBlob`).
+    - The `offset` is a byte offset from the start of the Blob where the attribute's data starts.
+    - The `stride` is the number of bytes between consecutive values.
+  ]],
+  related = {
+    'ModelData:getIndexFormat'
+  }
+}

+ 16 - 0
api/lovr/data/ModelData/getSkinCount.lua

@@ -0,0 +1,16 @@
+return {
+  summary = 'Get the number of skins in the model.',
+  description = [[
+    Returns the number of skins in the model.  A skin is a collection of joints targeted by an
+    animation.
+  ]],
+  arguments = {},
+  returns = {
+    {
+      name = 'count',
+      type = 'number',
+      description = 'The number of skins in the model.'
+    }
+  },
+  notes = 'There is currently a maximum of 256 skins.'
+}

+ 23 - 0
api/lovr/data/ModelData/getSkinInverseBindMatrix.lua

@@ -0,0 +1,23 @@
+return {
+  summary = 'Get the inverse bind matrix for a joint in the skin.',
+  description = 'Returns the inverse bind matrix for a joint in the skin.',
+  arguments = {
+    {
+      name = 'skin',
+      type = 'number',
+      description = 'The index of a skin.'
+    },
+    {
+      name = 'joint',
+      type = 'number',
+      description = 'The index of a joint in the skin.'
+    }
+  },
+  returns = {
+    {
+      name = '...',
+      type = 'number',
+      description = 'The 16 components of the 4x4 inverse bind matrix, in column-major order.'
+    }
+  }
+}

+ 18 - 0
api/lovr/data/ModelData/getSkinJoints.lua

@@ -0,0 +1,18 @@
+return {
+  summary = 'Get the joints in a skin.',
+  description = 'Returns a table with the node indices of the joints in a skin.',
+  arguments = {
+    {
+      name = 'skin',
+      type = 'number',
+      description = 'The index of a skin.'
+    }
+  },
+  returns = {
+    {
+      name = 'joints',
+      type = 'table',
+      description = 'The joints in the skin.'
+    }
+  }
+}

+ 20 - 0
api/lovr/data/ModelData/getTriangleCount.lua

@@ -0,0 +1,20 @@
+return {
+  summary = 'Get the total number of triangles in the model.',
+  description = [[
+    Returns the total number of triangles in the model.  This count includes meshes that are
+    attached to multiple nodes, and the count corresponds to the triangles returned by
+    `ModelData:getTriangles`.
+  ]],
+  arguments = {},
+  returns = {
+    {
+      name = 'count',
+      type = 'number',
+      description = 'The total number of triangles in the model.'
+    }
+  },
+  related = {
+    'ModelData:getTriangles',
+    'ModelData:getVertexCount'
+  }
+}

+ 34 - 0
api/lovr/data/ModelData/getTriangles.lua

@@ -0,0 +1,34 @@
+return {
+  summary = 'Get all the triangles in a mesh.',
+  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`:
+
+    - 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.
+    - If a mesh is attached to more than one node, its vertices will be in the table multiple times.
+    - Vertex indices will be relative to the whole triangle list instead of a mesh.
+  ]],
+  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 ModelData once, the result is cached.',
+  related = {
+    'ModelData:getTriangleCount',
+    'ModelData:getVertexCount'
+  }
+}

+ 19 - 0
api/lovr/data/ModelData/getVertexCount.lua

@@ -0,0 +1,19 @@
+return {
+  summary = 'Get the total vertex count of the model.',
+  description = [[
+    Returns the total vertex count of a model.  This count includes meshes that are attached to
+    multiple nodes, and the count corresponds to the vertices returned by `ModelData:getTriangles`.
+  ]],
+  arguments = {},
+  returns = {
+    {
+      name = 'count',
+      type = 'number',
+      description = 'The total number of vertices in the model.'
+    }
+  },
+  related = {
+    'ModelData:getTriangles',
+    'ModelData:getTriangleCount'
+  }
+}

+ 19 - 0
api/lovr/data/ModelData/getWidth.lua

@@ -0,0 +1,19 @@
+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 = {
+    'ModelData:getHeight',
+    'ModelData:getDepth',
+    'ModelData:getDimensions',
+    'ModelData:getCenter',
+    'ModelData:getBoundingBox'
+  }
+}

+ 18 - 0
api/lovr/data/SmoothMode.lua

@@ -0,0 +1,18 @@
+return {
+  summary = 'Different ways to interpolate between animation keyframes.',
+  description = 'Different ways to interpolate between animation keyframes.',
+  values = {
+    {
+      name = 'step',
+      description = 'The animated property will snap to the nearest keyframe.'
+    },
+    {
+      name = 'linear',
+      description = 'The animated property will linearly interpolate between keyframes.'
+    },
+    {
+      name = 'cubic',
+      description = 'The animated property will follow a smooth curve between nearby keyframes.'
+    }
+  }
+}

+ 4 - 0
api/main.lua

@@ -137,11 +137,15 @@ local function processFunction(path, parent)
 
     variant.description = unwrap(variant.description)
 
+    assert(variant.arguments, string.format('Variant for %q is missing arguments', fn.key))
+
     for _, arg in ipairs(variant.arguments) do
       arg.description = unwrap(arg.description)
       processTable(arg.table)
     end
 
+    assert(variant.returns, string.format('Variant for %q is missing returns', fn.key))
+
     for _, ret in ipairs(variant.returns) do
       ret.description = unwrap(ret.description)
       processTable(ret.table)

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor