Browse Source

Write some 0.10.0 docs;

bjorn 7 years ago
parent
commit
780cefe29b
45 changed files with 961 additions and 540 deletions
  1. 472 321
      api/init.lua
  2. 0 0
      api/lovr/audio/Source/getChannelCount.lua
  3. 1 1
      api/lovr/callbacks/conf.lua
  4. 18 0
      api/lovr/callbacks/mount.lua
  5. 28 0
      api/lovr/callbacks/threaderror.lua
  6. 15 0
      api/lovr/data/Blob/getName.lua
  7. 0 0
      api/lovr/data/Blob/getPointer.lua
  8. 0 0
      api/lovr/data/Blob/getSize.lua
  9. 0 0
      api/lovr/data/Blob/getString.lua
  10. 15 0
      api/lovr/data/Blob/init.lua
  11. 8 0
      api/lovr/data/init.lua
  12. 48 0
      api/lovr/data/newBlob.lua
  13. 19 8
      api/lovr/event/quit.lua
  14. 0 15
      api/lovr/filesystem/Blob/getFilename.lua
  15. 0 11
      api/lovr/filesystem/Blob/init.lua
  16. 21 0
      api/lovr/filesystem/getRequirePath.lua
  17. 15 0
      api/lovr/filesystem/getWorkingDirectory.lua
  18. 8 11
      api/lovr/filesystem/newBlob.lua
  19. 21 0
      api/lovr/filesystem/setRequirePath.lua
  20. 5 0
      api/lovr/graphics/Canvas/renderTo.lua
  21. 23 0
      api/lovr/graphics/Material/getScalar.lua
  22. 22 0
      api/lovr/graphics/Material/setScalar.lua
  23. 5 0
      api/lovr/graphics/MaterialColor.lua
  24. 21 0
      api/lovr/graphics/MaterialScalar.lua
  25. 21 0
      api/lovr/graphics/MaterialTexture.lua
  26. 0 25
      api/lovr/graphics/MatrixType.lua
  27. 50 6
      api/lovr/graphics/clear.lua
  28. 1 1
      api/lovr/graphics/createWindow.lua
  29. 13 0
      api/lovr/graphics/fill.lua
  30. 23 5
      api/lovr/graphics/getDepthTest.lua
  31. 9 13
      api/lovr/graphics/plane.lua
  32. 8 19
      api/lovr/graphics/rotate.lua
  33. 6 18
      api/lovr/graphics/scale.lua
  34. 25 14
      api/lovr/graphics/setDepthTest.lua
  35. 0 15
      api/lovr/graphics/transform.lua
  36. 6 18
      api/lovr/graphics/translate.lua
  37. 0 4
      api/lovr/headset/ControllerButton.lua
  38. 0 16
      api/lovr/headset/getBoundsGeometry.lua
  39. 16 0
      api/lovr/headset/isMounted.lua
  40. 0 16
      api/lovr/headset/isPresent.lua
  41. 1 1
      api/lovr/physics/Collider/addShape.lua
  42. 15 0
      api/lovr/physics/Collider/getJoints.lua
  43. 0 0
      api/lovr/physics/Collider/getShapes.lua
  44. 1 1
      api/lovr/physics/Collider/removeShape.lua
  45. 1 1
      api/lovr/timer/getFPS.lua

File diff suppressed because it is too large
+ 472 - 321
api/init.lua


+ 0 - 0
api/lovr/audio/Source/getChannels.lua → api/lovr/audio/Source/getChannelCount.lua


+ 1 - 1
api/lovr/callbacks/conf.lua

@@ -175,7 +175,7 @@ return {
           t.gammacorrect = false
           t.gammacorrect = false
 
 
           -- Configure the desktop window
           -- Configure the desktop window
-          t.window.width = 800
+          t.window.width = 1080
           t.window.height = 600
           t.window.height = 600
           t.window.fullscreen = false
           t.window.fullscreen = false
           t.window.msaa = 0
           t.window.msaa = 0

+ 18 - 0
api/lovr/callbacks/mount.lua

@@ -0,0 +1,18 @@
+return {
+  tag = 'callbacks',
+  summary = 'Called when the headset is put on or taken off.',
+  description = [[
+    The `lovr.mount` callback is called when the headset is put on or taken off.  This hardware
+    feature is sometimes called a "proximity sensor" and it not supported by all headsets.  You can
+    use it to pause the app or show a message in the window if the headset isn't put on yet.
+  ]],
+  arguments = {
+    {
+      name = 'mounted',
+      type = 'boolean',
+      description = 'Whether the headset is mounted.'
+    }
+  },
+  returns = {},
+  related = {}
+}

+ 28 - 0
api/lovr/callbacks/threaderror.lua

@@ -0,0 +1,28 @@
+return {
+  tag = 'callbacks',
+  summary = 'Called when an error occurs in a thread.',
+  description = [[
+    The `lovr.threaderror` callback is called whenever an error occurs in a Thread.  It receives a
+    the Thread object where the error occurred and an error message.
+
+    The default implementation of this callback will call `lovr.errhand` with the error.
+  ]],
+  arguments = {
+    {
+      name = 'thread',
+      type = 'Thread',
+      description = 'The Thread that errored.'
+    },
+    {
+      name = 'message',
+      type = 'string',
+      description = 'The error message.'
+    }
+  },
+  returns = {},
+  related = {
+    'Thread',
+    'Thread:getError',
+    'lovr.errhand'
+  }
+}

+ 15 - 0
api/lovr/data/Blob/getName.lua

@@ -0,0 +1,15 @@
+return {
+  summary = 'Get the label the Blob.',
+  description = [[
+    Returns the filename the Blob was loaded from, or the custom name given to it when it was
+    created.  This label is also used in error messages.
+  ]],
+  arguments = {},
+  returns = {
+    {
+      name = 'name',
+      type = 'string',
+      description = 'The name of the Blob.'
+    }
+  }
+}

+ 0 - 0
api/lovr/filesystem/Blob/getPointer.lua → api/lovr/data/Blob/getPointer.lua


+ 0 - 0
api/lovr/filesystem/Blob/getSize.lua → api/lovr/data/Blob/getSize.lua


+ 0 - 0
api/lovr/filesystem/Blob/getString.lua → api/lovr/data/Blob/getString.lua


+ 15 - 0
api/lovr/data/Blob/init.lua

@@ -0,0 +1,15 @@
+return {
+  summary = 'A chunk of binary data.',
+  description = [[
+    A Blob is an object that holds binary data.  It can be passed to most functions that take
+    filename arguments, like `lovr.graphics.newModel` or `lovr.audio.newSource`.  Blobs aren't
+    usually necessary for simple projects, but they can be really helpful if:
+
+    - You need to work with low level binary data, potentially using the LuaJIT FFI for increased
+      performance.
+    - You are working with data that isn't stored as a file, such as programmatically generated data
+      or a string from a network request.
+    - You want to load data from a file once and then use it to create many different objects.
+  ]],
+  constructor = 'lovr.filesystem.newBlob'
+}

+ 8 - 0
api/lovr/data/init.lua

@@ -0,0 +1,8 @@
+return {
+  tag = 'modules',
+  summary = 'Exposes low level functions for working with data.',
+  description = [[
+    The `lovr.data` module provides functions for accessing underlying data representations for
+    several LÖVR objects.
+  ]]
+}

+ 48 - 0
api/lovr/data/newBlob.lua

@@ -0,0 +1,48 @@
+return {
+  summary = 'Create a new Blob.',
+  description = 'Creates a new Blob.  A Blob is a piece of binary data.',
+  arguments = {
+    size = {
+      type = 'number',
+      description = [[
+        The amount of data to allocate for the Blob, in bytes.  Its content will be set to zero.
+      ]]
+    },
+    contents = {
+      type = 'string',
+      description = 'A string containing the Blob\'s contents.'
+    },
+    source = {
+      type = 'Blob',
+      description = 'A Blob to copy the contents from.'
+    },
+    name = {
+      type = 'string',
+      default = [['']],
+      description = 'A name for the Blob (used in error messages)',
+    }
+  },
+  returns = {
+    blob = {
+      type = 'Blob',
+      description = 'The new Blob.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'size', 'name' },
+      returns = { 'blob' }
+    },
+    {
+      arguments = { 'contents', 'name' },
+      returns = { 'blob' }
+    },
+    {
+      arguments = { 'source', 'name' },
+      returns = { 'blob' }
+    }
+  },
+  notes = [[
+    Note that `VertexData` and `TextureData` are Blobs and can be cloned using this function.
+  ]]
+}

+ 19 - 8
api/lovr/event/quit.lua

@@ -1,23 +1,34 @@
 return {
 return {
   summary = 'Quit the application.',
   summary = 'Quit the application.',
   description = [[
   description = [[
-    Pushes an event to quit the game.  An optional number can be passed to set the exit code for the
-    application.  An exit code of zero indicates normal termination, whereas a nonzero exit code
-    indicates that an error occurred.
+    Pushes an event to quit or restart the application.  An optional number can be passed to set the
+    exit code for the application.  An exit code of zero indicates normal termination, whereas a
+    nonzero exit code indicates that an error occurred.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'code',
+    code = {
       type = 'number',
       type = 'number',
       default = '0',
       default = '0',
       description = 'The exit code of the program.'
       description = 'The exit code of the program.'
+    },
+    ["'restart'"] = {
+      type = 'string',
+      description = 'Restart instead of quitting.'
     }
     }
   },
   },
   returns = {},
   returns = {},
+  variants = {
+    {
+      arguments = { 'code' },
+      returns = {}
+    },
+    {
+      arguments = { [['restart']] },
+      returns = {}
+    }
+  },
   notes = [[
   notes = [[
-    This function is equivalent to:
-
-        lovr.event.push('quit', code)
+    This function is equivalent to calling `lovr.event.push('quit', <args>)`.
 
 
     The program won't actually exit until the next time `lovr.event.poll` is called.
     The program won't actually exit until the next time `lovr.event.poll` is called.
   ]],
   ]],

+ 0 - 15
api/lovr/filesystem/Blob/getFilename.lua

@@ -1,15 +0,0 @@
-return {
-  summary = 'Get the file the Blob was loaded from.',
-  description = [[
-    Returns the name of the file used to load the Blob, or the custom name given to it when it was
-    created.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'filename',
-      type = 'string',
-      description = 'The name of the Blob.'
-    }
-  }
-}

+ 0 - 11
api/lovr/filesystem/Blob/init.lua

@@ -1,11 +0,0 @@
-return {
-  summary = 'A loaded file object.',
-  description = [[
-    A Blob is an object that loads and holds the contents of a file.  It can be passed to most
-    functions that take filename arguments, like `lovr.graphics.newModel` or `lovr.audio.newSource`.
-    Loading many objects this way is often faster because the file data only needs to be read once
-    and can be reused.  It can also be useful if file data is retrieved from some non-filesystem
-    source, such as a network request.
-  ]],
-  constructor = 'lovr.filesystem.newBlob'
-}

+ 21 - 0
api/lovr/filesystem/getRequirePath.lua

@@ -0,0 +1,21 @@
+return {
+  summary = 'Get the require path.',
+  description = [[
+    Returns the require path.  The require path is a semicolon-separated list of patterns that LÖVR
+    will use to search for files when they are `require`d.  Any question marks in the pattern will
+    be replaced with the module that is being required.  It is similar to Lua\'s `package.path`
+    variable, but the main difference is that the patterns are relative to the save directory and
+    the project directory.
+  ]],
+  arguments = {},
+  returns = {
+    {
+      name = 'path',
+      type = 'string',
+      description = 'The semicolon separated list of search patterns.'
+    }
+  },
+  notes = [[
+    The default reqiure path is '?.lua;?/init.lua'.
+  ]]
+}

+ 15 - 0
api/lovr/filesystem/getWorkingDirectory.lua

@@ -0,0 +1,15 @@
+return {
+  summary = 'Get the current working directory.',
+  description = [[
+    Returns the absolute path of the working directory.  Usually this is where the executable was
+    started from.
+  ]],
+  arguments = {},
+  returns = {
+    {
+      name = 'path',
+      type = 'string',
+      description = 'The current working directory.'
+    }
+  }
+}

+ 8 - 11
api/lovr/filesystem/newBlob.lua

@@ -1,18 +1,11 @@
 return {
 return {
-  summary = 'Create a new Blob.',
-  description = 'Creates a new Blob from a file.',
+  summary = 'Create a new Blob from a file.',
+  description = 'Creates a new Blob that contains the contents of a file.',
   arguments = {
   arguments = {
-    filename = {
+    {
+      name = 'filename',
       type = 'string',
       type = 'string',
       description = 'The file to load.'
       description = 'The file to load.'
-    },
-    str = {
-      type = 'string',
-      description = 'A string containing the Blob\'s contents.'
-    },
-    name = {
-      type = 'string',
-      description = 'A name for the Blob (used in error messages)',
     }
     }
   },
   },
   returns = {
   returns = {
@@ -21,5 +14,9 @@ return {
       type = 'Blob',
       type = 'Blob',
       description = 'The new Blob.'
       description = 'The new Blob.'
     }
     }
+  },
+  related = {
+    'lovr.data.newBlob',
+    'Blob'
   }
   }
 }
 }

+ 21 - 0
api/lovr/filesystem/setRequirePath.lua

@@ -0,0 +1,21 @@
+return {
+  summary = 'Set the require path.',
+  description = [[
+    Sets the require path.  The require path is a semicolon-separated list of patterns that LÖVR
+    will use to search for files when they are `require`d.  Any question marks in the pattern will
+    be replaced with the module that is being required.  It is similar to Lua\'s `package.path`
+    variable, but the main difference is that the patterns are relative to the save directory and
+    the project directory.
+  ]],
+  arguments = {
+    {
+      name = 'path',
+      type = 'string',
+      description = 'The semicolon separated list of search patterns.'
+    }
+  },
+  returns = {},
+  notes = [[
+    The default reqiure path is '?.lua;?/init.lua'.
+  ]]
+}

+ 5 - 0
api/lovr/graphics/Canvas/renderTo.lua

@@ -10,6 +10,11 @@ return {
       name = 'callback',
       name = 'callback',
       type = 'function',
       type = 'function',
       description = 'The function to use to render to the Canvas.'
       description = 'The function to use to render to the Canvas.'
+    },
+    {
+      name = '...',
+      type = '*',
+      description = 'Additional arguments to pass to the callback.'
     }
     }
   },
   },
   returns = {},
   returns = {},

+ 23 - 0
api/lovr/graphics/Material/getScalar.lua

@@ -0,0 +1,23 @@
+return {
+  summary = 'Get a scalar property of the Material.',
+  description = [[
+    Returns a numeric property of a Material.  Scalar properties default to 1.0.
+  ]],
+  arguments = {
+    {
+      name = 'scalarType',
+      type = 'MaterialScalar',
+      description = 'The type of property to get.'
+    }
+  },
+  returns = {
+    {
+      name = 'x',
+      type = 'number',
+      description = 'The value of the property.'
+    }
+  },
+  related = {
+    'MaterialScalar'
+  }
+}

+ 22 - 0
api/lovr/graphics/Material/setScalar.lua

@@ -0,0 +1,22 @@
+return {
+  summary = 'Set a scalar property of the Material.',
+  description = [[
+    Sets a numeric property of a Material.  Scalar properties default to 1.0.
+  ]],
+  arguments = {
+    {
+      name = 'scalarType',
+      type = 'MaterialScalar',
+      description = 'The type of property to get.'
+    },
+    {
+      name = 'x',
+      type = 'number',
+      description = 'The value of the property.'
+    }
+  },
+  returns = {},
+  related = {
+    'MaterialScalar'
+  }
+}

+ 5 - 0
api/lovr/graphics/MaterialColor.lua

@@ -5,11 +5,16 @@ return {
     {
     {
       name = 'diffuse',
       name = 'diffuse',
       description = 'The diffuse color.'
       description = 'The diffuse color.'
+    },
+    {
+      name = 'emissive',
+      description = 'The emissive color.'
     }
     }
   },
   },
   related = {
   related = {
     'Material:getColor',
     'Material:getColor',
     'Material:setColor',
     'Material:setColor',
+    'MaterialScalar',
     'MaterialTexture',
     'MaterialTexture',
     'Material'
     'Material'
   }
   }

+ 21 - 0
api/lovr/graphics/MaterialScalar.lua

@@ -0,0 +1,21 @@
+return {
+  summary = 'Different material parameters.',
+  description = 'The different types of float parameters `Material`s can hold.',
+  values = {
+    {
+      name = 'metalness',
+      description = 'The constant metalness factor.'
+    },
+    {
+      name = 'roughness',
+      description = 'The constant roughness factor.'
+    }
+  },
+  related = {
+    'Material:getScalar',
+    'Material:setScalar',
+    'MaterialColor',
+    'MaterialTexture',
+    'Material'
+  }
+}

+ 21 - 0
api/lovr/graphics/MaterialTexture.lua

@@ -6,6 +6,26 @@ return {
       name = 'diffuse',
       name = 'diffuse',
       description = 'The diffuse texture.'
       description = 'The diffuse texture.'
     },
     },
+    {
+      name = 'emissive',
+      description = 'The emissive texture.'
+    },
+    {
+      name = 'metalness',
+      description = 'The metalness texture.'
+    },
+    {
+      name = 'roughness',
+      description = 'The roughness texture.'
+    },
+    {
+      name = 'occlusion',
+      description = 'The ambient occlusion texture.'
+    },
+    {
+      name = 'normal',
+      description = 'The normal map.'
+    },
     {
     {
       name = 'environment',
       name = 'environment',
       description = 'The environment map, should be specified as a cubemap texture.'
       description = 'The environment map, should be specified as a cubemap texture.'
@@ -15,6 +35,7 @@ return {
     'Material:getTexture',
     'Material:getTexture',
     'Material:setTexture',
     'Material:setTexture',
     'MaterialColor',
     'MaterialColor',
+    'MaterialScalar',
     'Material'
     'Material'
   }
   }
 }
 }

+ 0 - 25
api/lovr/graphics/MatrixType.lua

@@ -1,25 +0,0 @@
-return {
-  summary = 'Types of matrix on the transform stack.',
-  description = [[
-    When modifying the coordinate system using functions like `lovr.graphics.translate`, you can
-    modify either the model matrix or the view matrix.  The model matrix is meant to represent the
-    transform of the object being rendered, whereas the view matrix is meant to represent the
-    transform of the camera.  By default, the model matrix is manipulated.
-  ]],
-  values = {
-    {
-      name = 'model',
-      description = 'The model matrix.'
-    },
-    {
-      name = 'view',
-      description = 'The view matrix.'
-    }
-  },
-  related = {
-    'lovr.graphics.translate',
-    'lovr.graphics.rotate',
-    'lovr.graphics.scale',
-    'lovr.graphics.transform'
-  }
-}

+ 50 - 6
api/lovr/graphics/clear.lua

@@ -2,24 +2,68 @@ return {
   tag = 'window',
   tag = 'window',
   summary = 'Clear the screen.',
   summary = 'Clear the screen.',
   description = [[
   description = [[
-    Clears the screen to the background color.  This function is called automatically by
-    `lovr.step`.
+    Clears the screen, resetting the color, depth, and stencil information to default values.  This
+    function is called automatically by `lovr.step` at the beginning of each frame to clear out the
+    data from the previous frame.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'color',
+    color = {
       type = 'boolean',
       type = 'boolean',
       default = 'true',
       default = 'true',
       description = 'Whether or not to clear color information on the screen.'
       description = 'Whether or not to clear color information on the screen.'
     },
     },
-    {
-      name = 'depth',
+    depth = {
       type = 'boolean',
       type = 'boolean',
       default = 'true',
       default = 'true',
       description = 'Whether or not to clear the depth information on the screen.'
       description = 'Whether or not to clear the depth information on the screen.'
+    },
+    stencil = {
+      type = 'boolean',
+      default = 'true',
+      description = 'Whether or not to clear the stencil information on the screen.'
+    },
+    r = {
+      type = 'number',
+      description = 'The value to clear the red channel to, from 0.0 to 1.0.'
+    },
+    g = {
+      type = 'number',
+      description = 'The value to clear the green channel to, from 0.0 to 1.0.'
+    },
+    b = {
+      type = 'number',
+      description = 'The value to clear the blue channel to, from 0.0 to 1.0.'
+    },
+    a = {
+      type = 'number',
+      description = 'The value to clear the alpha channel to, from 0.0 to 1.0.'
+    },
+    z = {
+      type = 'number',
+      default = '1.0',
+      description = 'The value to clear the depth buffer to.'
+    },
+    s = {
+      type = 'number',
+      default = '0',
+      description = 'The integer value to clear the stencil buffer to.'
     }
     }
   },
   },
   returns = {},
   returns = {},
+  variants = {
+    {
+      arguments = { 'color', 'depth', 'stencil' },
+      returns = {}
+    },
+    {
+      arguments = { 'r', 'g', 'b', 'a', 'z', 's' },
+      returns = {}
+    }
+  },
+  notes = [[
+    The two variants of this function can be mixed and matched, meaning you can use booleans for
+    some of the values and numeric values for others.
+  ]],
   related = {
   related = {
     'lovr.graphics.setBackgroundColor'
     'lovr.graphics.setBackgroundColor'
   }
   }

+ 1 - 1
api/lovr/graphics/createWindow.lua

@@ -6,7 +6,7 @@ return {
     {
     {
       name = 'width',
       name = 'width',
       type = 'number',
       type = 'number',
-      default = '800',
+      default = '1080',
       description = 'The width of the window.'
       description = 'The width of the window.'
     },
     },
     {
     {

+ 13 - 0
api/lovr/graphics/fill.lua

@@ -0,0 +1,13 @@
+return {
+  tag = 'graphicsPrimitives',
+  summary = 'Fill the screen with a texture.',
+  description = 'Draws a fullscreen textured quad.',
+  arguments = {
+    {
+      name = 'texture',
+      type = 'Texture',
+      description = 'The texture to use.'
+    }
+  },
+  returns = {}
+}

+ 23 - 5
api/lovr/graphics/getDepthTest.lua

@@ -1,16 +1,34 @@
 return {
 return {
   tag = 'graphicsState',
   tag = 'graphicsState',
   summary = 'Get the depth test mode.',
   summary = 'Get the depth test mode.',
-  description = [[
-    Returns the current depth test.  The depth test controls how overlapping objects are rendered.
-  ]],
+  description = 'Returns the current depth test settings.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
     {
     {
       name = 'compareMode',
       name = 'compareMode',
       type = 'CompareMode',
       type = 'CompareMode',
-      description = 'The current depth test.'
+      description = 'The current comparison method for depth testing.'
+    },
+    {
+      name = 'write',
+      type = 'boolean',
+      description = 'Whether pixels will have their z value updated when rendered to.'
     }
     }
   },
   },
-  notes = 'The default depth test is `lequal`.'
+  notes = [[
+    The depth test is an advanced technique to control how 3D objects overlap each other when they
+    are rendered.  It works as follows:
+
+    - Each pixel keeps track of its z value as well as its color.
+    - If `write` is enabled when something is drawn, then any pixels that are drawn will have their
+      z values updated.
+    - Additionally, anything drawn will first compare the existing z value of a pixel with the new z
+      value.  The `compareMode` setting determines how this comparison is performed.  If the
+      comparison succeeds, the new pixel will overwrite the previous one, otherwise that pixel won't
+      be rendered to.
+
+    Smaller z values are closer to the camera.
+
+    The default compare mode is `lequal`, which usually gives good results for normal 3D rendering.
+  ]]
 }
 }

+ 9 - 13
api/lovr/graphics/plane.lua

@@ -3,10 +3,6 @@ return {
   summary = 'Draw a plane.',
   summary = 'Draw a plane.',
   description = 'Draws a plane with a given position, size, and orientation.',
   description = 'Draws a plane with a given position, size, and orientation.',
   arguments = {
   arguments = {
-    texture = {
-      type = 'Texture',
-      description = 'The texture to use.'
-    },
     material = {
     material = {
       type = 'Material',
       type = 'Material',
       description = 'The material to apply to the plane.'
       description = 'The material to apply to the plane.'
@@ -31,10 +27,15 @@ return {
       default = '0',
       default = '0',
       description = 'The z coordinate of the center of the plane.'
       description = 'The z coordinate of the center of the plane.'
     },
     },
-    size = {
+    width = {
+      type = 'number',
+      default = '1',
+      description = 'The width of the plane, in meters.'
+    },
+    height = {
       type = 'number',
       type = 'number',
       default = '1',
       default = '1',
-      description = 'The size of the plane, in meters.'
+      description = 'The height of the plane, in meters.'
     },
     },
     angle = {
     angle = {
       type = 'number',
       type = 'number',
@@ -60,17 +61,12 @@ return {
   returns = {},
   returns = {},
   variants = {
   variants = {
     {
     {
-      arguments = { 'mode', 'x', 'y', 'z', 'size', 'angle', 'ax', 'ay', 'az' },
+      arguments = { 'mode', 'x', 'y', 'z', 'width', 'height', 'angle', 'ax', 'ay', 'az' },
       returns = {}
       returns = {}
     },
     },
     {
     {
       description = 'Draw a plane with a custom material.',
       description = 'Draw a plane with a custom material.',
-      arguments = { 'material', 'x', 'y', 'z', 'size', 'angle', 'ax', 'ay', 'az' },
-      returns = {}
-    },
-    {
-      description = 'Draw a fullscreen textured plane.',
-      arguments = { 'texture' },
+      arguments = { 'material', 'x', 'y', 'z', 'width', 'height', 'angle', 'ax', 'ay', 'az' },
       returns = {}
       returns = {}
     }
     }
   }
   }

+ 8 - 19
api/lovr/graphics/rotate.lua

@@ -8,42 +8,31 @@ return {
     transformation stack.
     transformation stack.
   ]],
   ]],
   arguments = {
   arguments = {
-    angle = {
+    {
+      name = 'angle',
       type = 'number',
       type = 'number',
       description = 'The amount to rotate the coordinate system by, in radians.'
       description = 'The amount to rotate the coordinate system by, in radians.'
     },
     },
-    ax = {
+    {
+      name = 'ax',
       type = 'number',
       type = 'number',
       default = '0',
       default = '0',
       description = 'The x component of the axis of rotation.'
       description = 'The x component of the axis of rotation.'
     },
     },
-    ay = {
+    {
+      name = 'ay',
       type = 'number',
       type = 'number',
       default = '1',
       default = '1',
       description = 'The y component of the axis of rotation.'
       description = 'The y component of the axis of rotation.'
     },
     },
-    az = {
+    {
+      name = 'az',
       type = 'number',
       type = 'number',
       default = '0',
       default = '0',
       description = 'The z component of the axis of rotation.'
       description = 'The z component of the axis of rotation.'
-    },
-    matrix = {
-      type = 'MatrixType',
-      default = [['model']],
-      description = 'The matrix to modify.'
     }
     }
   },
   },
   returns = {},
   returns = {},
-  variants = {
-    {
-      arguments = { 'angle', 'ax', 'ay', 'az' },
-      returns = {}
-    },
-    {
-      arguments = { 'matrix', 'angle', 'ax', 'ay', 'az' },
-      returns = {}
-    }
-  },
   notes = 'Order matters when scaling, translating, and rotating the coordinate system.',
   notes = 'Order matters when scaling, translating, and rotating the coordinate system.',
   related = {
   related = {
     'lovr.graphics.scale',
     'lovr.graphics.scale',

+ 6 - 18
api/lovr/graphics/scale.lua

@@ -9,37 +9,25 @@ return {
     transformation stack.
     transformation stack.
   ]],
   ]],
   arguments = {
   arguments = {
-    x = {
+    {
+      name = 'x',
       type = 'number',
       type = 'number',
       description = 'The amount to scale on the x axis.'
       description = 'The amount to scale on the x axis.'
     },
     },
-    y = {
+    {
+      name = 'y',
       type = 'number',
       type = 'number',
       default = 'x',
       default = 'x',
       description = 'The amount to scale on the y axis.'
       description = 'The amount to scale on the y axis.'
     },
     },
-    z = {
+    {
+      name = 'z',
       type = 'number',
       type = 'number',
       default = 'x',
       default = 'x',
       description = 'The amount to scale on the z axis.'
       description = 'The amount to scale on the z axis.'
-    },
-    matrix = {
-      type = 'MatrixType',
-      default = [['model']],
-      description = 'The matrix to modify.'
     }
     }
   },
   },
   returns = {},
   returns = {},
-  variants = {
-    {
-      arguments = { 'x', 'y', 'z' },
-      returns = {}
-    },
-    {
-      arguments = { 'matrix', 'x', 'y', 'z' },
-      returns = {}
-    }
-  },
   notes = 'Order matters when scaling, translating, and rotating the coordinate system.',
   notes = 'Order matters when scaling, translating, and rotating the coordinate system.',
   related = {
   related = {
     'lovr.graphics.rotate',
     'lovr.graphics.rotate',

+ 25 - 14
api/lovr/graphics/setDepthTest.lua

@@ -5,23 +5,34 @@ return {
     Sets the current depth test.  The depth test controls how overlapping objects are rendered.
     Sets the current depth test.  The depth test controls how overlapping objects are rendered.
   ]],
   ]],
   arguments = {
   arguments = {
-    compareMode = {
-      type = 'CompareMode',
-      description = 'The new depth test.'
-    }
-  },
-  returns = {},
-  variants = {
     {
     {
-      description = 'Set a new depth test.',
-      arguments = { 'compareMode' },
-      returns = {}
+      name = 'compareMode',
+      type = 'CompareMode',
+      default = 'nil',
+      description = 'The new depth test.  Use `nil` to disable the depth test.'
     },
     },
     {
     {
-      description = 'Disable the depth test.',
-      arguments = {},
-      returns = {}
+      name = 'write',
+      type = 'boolean',
+      default = 'true',
+      description = 'Whether pixels will have their z value updated when rendered to.'
     }
     }
   },
   },
-  notes = 'The default depth test is `lequal`.'
+  returns = {},
+  notes = [[
+    The depth test is an advanced technique to control how 3D objects overlap each other when they
+    are rendered.  It works as follows:
+
+    - Each pixel keeps track of its z value as well as its color.
+    - If `write` is enabled when something is drawn, then any pixels that are drawn will have their
+      z values updated.
+    - Additionally, anything drawn will first compare the existing z value of a pixel with the new z
+      value.  The `compareMode` setting determines how this comparison is performed.  If the
+      comparison succeeds, the new pixel will overwrite the previous one, otherwise that pixel won't
+      be rendered to.
+
+    Smaller z values are closer to the camera.
+
+    The default compare mode is `lequal`, which usually gives good results for normal 3D rendering.
+  ]]
 }
 }

+ 0 - 15
api/lovr/graphics/transform.lua

@@ -9,11 +9,6 @@ return {
     transformation stack.
     transformation stack.
   ]],
   ]],
   arguments = {
   arguments = {
-    matrix = {
-      type = 'MatrixType',
-      default = [['model']],
-      description = 'The matrix to modify.'
-    },
     transform = {
     transform = {
       type = 'Transform',
       type = 'Transform',
       description = 'The Transform to apply to the coordinate system.'
       description = 'The Transform to apply to the coordinate system.'
@@ -79,16 +74,6 @@ return {
       description = 'Modify the coordinate system using a Transform object.',
       description = 'Modify the coordinate system using a Transform object.',
       arguments = { 'transform' },
       arguments = { 'transform' },
       returns = {}
       returns = {}
-    },
-    {
-      description = 'Modify the model or view matrix.',
-      arguments = { 'matrix', 'x', 'y', 'z', 'sx', 'sy', 'sz', 'angle', 'ax', 'ay', 'az' },
-      returns = {}
-    },
-    {
-      description = 'Modify the model or view matrix using a Transform object.',
-      arguments = { 'matrix', 'transform' },
-      returns = {}
     }
     }
   },
   },
   related = {
   related = {

+ 6 - 18
api/lovr/graphics/translate.lua

@@ -9,35 +9,23 @@ return {
     transformation stack.
     transformation stack.
   ]],
   ]],
   arguments = {
   arguments = {
-    x = {
+    {
+      name = 'x',
       type = 'number',
       type = 'number',
       description = 'The amount to translate on the x axis.'
       description = 'The amount to translate on the x axis.'
     },
     },
-    y = {
+    {
+      name = 'y',
       type = 'number',
       type = 'number',
       description = 'The amount to translate on the y axis.'
       description = 'The amount to translate on the y axis.'
     },
     },
-    z = {
+    {
+      name = 'z',
       type = 'number',
       type = 'number',
       description = 'The amount to translate on the z axis.'
       description = 'The amount to translate on the z axis.'
-    },
-    matrix = {
-      type = 'MatrixType',
-      default = [['model']],
-      description = 'The matrix to modify.'
     }
     }
   },
   },
   returns = {},
   returns = {},
-  variants = {
-    {
-      arguments = { 'x', 'y', 'z' },
-      returns = {}
-    },
-    {
-      arguments = { 'matrix', 'x', 'y', 'z' },
-      returns = {}
-    }
-  },
   notes = 'Order matters when scaling, translating, and rotating the coordinate system.',
   notes = 'Order matters when scaling, translating, and rotating the coordinate system.',
   related = {
   related = {
     'lovr.graphics.rotate',
     'lovr.graphics.rotate',

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

@@ -1,10 +1,6 @@
 return {
 return {
   description = 'Buttons on a Controller.',
   description = 'Buttons on a Controller.',
   values = {
   values = {
-    {
-      name = 'unknown',
-      description = 'An unknown button.'
-    },
     {
     {
       name = 'system',
       name = 'system',
       description = 'The system button.'
       description = 'The system button.'

+ 0 - 16
api/lovr/headset/getBoundsGeometry.lua

@@ -1,16 +0,0 @@
-return {
-  tag = 'playArea',
-  summary = 'Get a list of points that make up the play area boundary.',
-  description = 'Returns a list of points representing the boundaries of the play area.',
-  arguments = {},
-  returns = {
-    {
-      name = 'points',
-      type = 'table',
-      description = [[
-        A list of points representing the play area.  Each point is a table consisting of an x, y,
-        and z coordinate.
-      ]]
-    }
-  }
-}

+ 16 - 0
api/lovr/headset/isMounted.lua

@@ -0,0 +1,16 @@
+return {
+  tag = 'headset',
+  summary = 'Get whether or not the headset is mounted.',
+  description = 'Determine if the headset is on someone\'s head or not.',
+  arguments = {},
+  returns = {
+    {
+      name = 'mounted',
+      type = 'boolean',
+      description = 'Whether or not the headset is mounted.'
+    }
+  },
+  related = {
+    'lovr.mount'
+  }
+}

+ 0 - 16
api/lovr/headset/isPresent.lua

@@ -1,16 +0,0 @@
-return {
-  tag = 'headset',
-  summary = 'Get whether or not a headset is connected.',
-  description = 'Determine if a headset is present and ready to use.',
-  arguments = {},
-  returns = {
-    {
-      name = 'isPresent',
-      type = 'boolean',
-      description = 'Whether or not a headset is present.'
-    }
-  },
-  related = {
-    'Controller:isPresent'
-  }
-}

+ 1 - 1
api/lovr/physics/Collider/addShape.lua

@@ -13,7 +13,7 @@ return {
   returns = {},
   returns = {},
   related = {
   related = {
     'Collider:removeShape',
     'Collider:removeShape',
-    'Collider:getShapeList',
+    'Collider:getShapes',
     'Shape'
     'Shape'
   }
   }
 }
 }

+ 15 - 0
api/lovr/physics/Collider/getJoints.lua

@@ -0,0 +1,15 @@
+return {
+  summary = 'Get a list of Joints attached to the Collider.',
+  description = 'Returns a list of Joints attached to the Collider.',
+  arguments = {},
+  returns = {
+    {
+      name = 'joints',
+      type = 'table',
+      description = 'A list of Joints attached to the Collider.'
+    }
+  },
+  related = {
+    'Joint'
+  }
+}

+ 0 - 0
api/lovr/physics/Collider/getShapeList.lua → api/lovr/physics/Collider/getShapes.lua


+ 1 - 1
api/lovr/physics/Collider/removeShape.lua

@@ -12,7 +12,7 @@ return {
   notes = 'Colliders without any shapes won\'t collide with anything.',
   notes = 'Colliders without any shapes won\'t collide with anything.',
   related = {
   related = {
     'Collider:addShape',
     'Collider:addShape',
-    'Collider:getShapeList',
+    'Collider:getShapes',
     'Shape'
     'Shape'
   }
   }
 }
 }

+ 1 - 1
api/lovr/timer/getFPS.lua

@@ -1,7 +1,7 @@
 return {
 return {
   summary = 'Get the current frames per second.',
   summary = 'Get the current frames per second.',
   description = [[
   description = [[
-    Returns the current frames per second, averaged over the last 60 frames.
+    Returns the current frames per second, averaged over the last 90 frames.
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {

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