Prechádzať zdrojové kódy

Finish converting types;

bjorn 2 dní pred
rodič
commit
630325de9c
55 zmenil súbory, kde vykonal 213 pridanie a 569 odobranie
  1. 106 372
      api/init.lua
  2. 2 2
      api/lovr/graphics/Pass/draw.lua
  3. 1 1
      api/lovr/graphics/Pass/line.lua
  4. 1 1
      api/lovr/graphics/Pass/points.lua
  5. 1 1
      api/lovr/graphics/Pass/polygon.lua
  6. 1 1
      api/lovr/graphics/Pass/setColor.lua
  7. 2 10
      api/lovr/graphics/Pass/setMaterial.lua
  8. 7 11
      api/lovr/graphics/Pass/setSampler.lua
  9. 3 12
      api/lovr/graphics/Pass/setShader.lua
  10. 4 11
      api/lovr/graphics/Pass/setStencilWrite.lua
  11. 1 1
      api/lovr/graphics/Texture/clear.lua
  12. 4 8
      api/lovr/graphics/Texture/setPixels.lua
  13. 1 1
      api/lovr/headset/Layer/setColor.lua
  14. 1 1
      api/lovr/headset/getAxis.lua
  15. 1 0
      api/lovr/headset/getBoundsDepth.lua
  16. 1 0
      api/lovr/headset/getBoundsDimensions.lua
  17. 1 0
      api/lovr/headset/getBoundsWidth.lua
  18. 1 1
      api/lovr/headset/getHands.lua
  19. 1 1
      api/lovr/headset/getLayers.lua
  20. 1 2
      api/lovr/headset/getName.lua
  21. 1 1
      api/lovr/headset/getPass.lua
  22. 1 1
      api/lovr/headset/getRefreshRate.lua
  23. 1 1
      api/lovr/headset/getRefreshRates.lua
  24. 1 1
      api/lovr/headset/getSkeleton.lua
  25. 1 1
      api/lovr/headset/getTexture.lua
  26. 4 4
      api/lovr/headset/getViewAngles.lua
  27. 7 7
      api/lovr/headset/getViewPose.lua
  28. 1 1
      api/lovr/headset/isDown.lua
  29. 1 1
      api/lovr/headset/isTouched.lua
  30. 7 30
      api/lovr/headset/setBackground.lua
  31. 1 6
      api/lovr/headset/wasPressed.lua
  32. 1 1
      api/lovr/math/Curve/render.lua
  33. 1 1
      api/lovr/math/gammaToLinear.lua
  34. 1 1
      api/lovr/math/linearToGamma.lua
  35. 5 3
      api/lovr/physics/Collider/getShape.lua
  36. 1 1
      api/lovr/physics/Collider/getTag.lua
  37. 2 0
      api/lovr/physics/Collider/setDegreesOfFreedom.lua
  38. 1 1
      api/lovr/physics/Shape/raycast.lua
  39. 4 4
      api/lovr/physics/World/getCallbacks.lua
  40. 1 1
      api/lovr/physics/World/getColliders.lua
  41. 1 1
      api/lovr/physics/World/getJoints.lua
  42. 1 1
      api/lovr/physics/World/getTags.lua
  43. 1 0
      api/lovr/physics/World/overlapShape.lua
  44. 1 0
      api/lovr/physics/World/queryBox.lua
  45. 1 0
      api/lovr/physics/World/querySphere.lua
  46. 2 1
      api/lovr/physics/World/raycast.lua
  47. 1 1
      api/lovr/physics/World/setCallbacks.lua
  48. 4 20
      api/lovr/physics/newConvexShape.lua
  49. 4 23
      api/lovr/physics/newMeshShape.lua
  50. 2 2
      api/lovr/system/getClipboardText.lua
  51. 1 1
      api/lovr/thread/Channel/pop.lua
  52. 1 1
      api/lovr/thread/Channel/push.lua
  53. 1 1
      api/lovr/thread/Thread/getError.lua
  54. 4 1
      api/lovr/thread/Thread/start.lua
  55. 4 12
      api/lovr/thread/newThread.lua

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 106 - 372
api/init.lua


+ 2 - 2
api/lovr/graphics/Pass/draw.lua

@@ -4,8 +4,8 @@ return {
   description = 'Draws a `Model`, `Mesh`, or `Texture`.',
   arguments = {
     object = {
-      type = '*',
-      description = 'The Model, Mesh, or Texture to draw.'
+      type = 'Model | Mesh | Texture',
+      description = 'The object to draw.'
     },
     x = {
       type = 'number',

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

@@ -31,7 +31,7 @@ return {
       description = 'The z coordinate of the next point.'
     },
     t = {
-      type = 'table',
+      type = '{number | Vec3}',
       description = [[
         A table of numbers or `Vec3` objects (not a mix) representing points of the line.
       ]]

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

@@ -16,7 +16,7 @@ return {
       description = 'The z coordinate of the first point.'
     },
     t = {
-      type = 'table',
+      type = '{number | Vec3}',
       description = 'A table of numbers or Vec3 objects (not both) representing point positions.'
     },
     v = {

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

@@ -32,7 +32,7 @@ return {
       description = 'The z coordinate of the next vertex.'
     },
     t = {
-      type = 'table',
+      type = '{number | Vec3}',
       description = [[
         A table of numbers or `Vec3` objects (not a mix) representing vertices of the polygon.
       ]]

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

@@ -21,7 +21,7 @@ return {
       description = 'The alpha component of the color.'
     },
     t = {
-      type = 'table',
+      type = '{number}',
       description = 'A table of 3 or 4 color components.'
     },
     hex = {

+ 2 - 10
api/lovr/graphics/Pass/setMaterial.lua

@@ -7,12 +7,8 @@ return {
   ]],
   arguments = {
     material = {
-      type = 'Material',
-      description = 'The material to use for drawing.'
-    },
-    texture = {
-      type = 'Texture',
-      description = 'The texture to use as the material.'
+      type = 'Texture | Material',
+      description = 'The texture or material to apply to surfaces.'
     }
   },
   returns = {},
@@ -21,10 +17,6 @@ return {
       arguments = { 'material' },
       returns = {}
     },
-    {
-      arguments = { 'texture' },
-      returns = {}
-    },
     {
       description = 'Use the default material.',
       arguments = {},

+ 7 - 11
api/lovr/graphics/Pass/setSampler.lua

@@ -8,23 +8,16 @@ return {
   ]],
   arguments = {
     sampler = {
-      type = 'Sampler',
-      description = 'The default sampler shaders will use when reading from textures.'
-    },
-    filter = {
-      type = 'FilterMode',
+      type = 'Sampler | FilterMode',
       default = [['linear']],
       description = [[
-        The default filter mode to use when sampling textures (the `repeat` wrap mode will be used).
-      ]]
+        The Sampler shaders will use when reading from textures.  It can also be a `FilterMode`, for
+        convenience (other sampler settings will use their defaults).
+      ]],
     }
   },
   returns = {},
   variants = {
-    {
-      arguments = { 'filter' },
-      returns = {}
-    },
     {
       arguments = { 'sampler' },
       returns = {}
@@ -36,6 +29,9 @@ return {
     When a Pass is reset, its sampler will be reset to `linear`.
 
     The sampler applies to all draws in the pass on submit, regardless of when the sampler is set.
+
+    If you need different samplers for each draw, currently you have to send a `Sampler` object to a
+    Shader (this is not ideal).
   ]],
   example = [[
     function lovr.draw(pass)

+ 3 - 12
api/lovr/graphics/Pass/setShader.lua

@@ -2,17 +2,13 @@ return {
   tag = 'shaders',
   summary = 'Set the active Shader.',
   description = [[
-    Sets the active shader.  In a render pass, the Shader will affect all drawing operations until
-    it is changed again.  In a compute pass, the Shader will be run when `Pass:compute` is called.
+    Sets the active shader.  The Shader will affect all drawing operations until it is changed
+    again.
   ]],
   arguments = {
     shader = {
-      type = 'Shader',
+      type = 'Shader | DefaultShader',
       description = 'The shader to use.'
-    },
-    defaultshader = {
-      type = 'DefaultShader',
-      description = 'One of the default shaders to use.'
     }
   },
   returns = {},
@@ -21,11 +17,6 @@ return {
       arguments = { 'shader' },
       returns = {}
     },
-    {
-      description = 'Use one of the default shaders for drawing.',
-      arguments = { 'defaultshader' },
-      returns = {}
-    },
     {
       description = 'Switch back to using an automatic shader for drawing.',
       arguments = {},

+ 4 - 11
api/lovr/graphics/Pass/setStencilWrite.lua

@@ -7,14 +7,11 @@ return {
   ]],
   arguments = {
     action = {
-      type = 'StencilAction',
-      description = 'How pixels drawn will update the stencil buffer.'
-    },
-    actions = {
-      type = 'table',
+      type = 'StencilAction | {StencilAction}',
       description = [[
-        A list of 3 stencil actions, used when a pixel fails the stencil test, fails
-        the depth test, or passes the stencil test, respectively.
+        How pixels should update the stencil buffer when they are drawn.  Can also be a list of 3
+        stencil actions, used when a pixel fails the stencil test, fails the depth test, or passes
+        the stencil test, respectively.
       ]]
     },
     value = {
@@ -34,10 +31,6 @@ return {
       arguments = { 'action', 'value', 'mask' },
       returns = {}
     },
-    {
-      arguments = { 'actions', 'value', 'mask' },
-      returns = {}
-    },
     {
       description = 'Disables stencil writing.',
       arguments = {},

+ 1 - 1
api/lovr/graphics/Texture/clear.lua

@@ -29,7 +29,7 @@ return {
       description = 'The alpha component of the clear color.'
     },
     t = {
-      type = 'table',
+      type = '{number}',
       description = 'A table with color components.'
     },
     v3 = {

+ 4 - 8
api/lovr/graphics/Texture/setPixels.lua

@@ -6,9 +6,9 @@ return {
     another `Texture` object to copy from.
   ]],
   arguments = {
-    image = {
-      type = 'Image',
-      description = 'The image to copy to the texture.'
+    source = {
+      type = 'Texture | Image',
+      description = 'The source texture or image to copy to this texture.'
     },
     texture = {
       type = 'Texture',
@@ -107,11 +107,7 @@ return {
   returns = {},
   variants = {
     {
-      arguments = { 'image', 'dstx', 'dsty', 'dstlayer', 'dstmipmap', 'srcx', 'srcy', 'srclayer', 'srcmipmap', 'width', 'height', 'layers' },
-      returns = {}
-    },
-    {
-      arguments = { 'texture', 'dstx', 'dsty', 'dstlayer', 'dstmipmap', 'srcx', 'srcy', 'srclayer', 'srcmipmap', 'width', 'height', 'layers', 'srcwidth', 'srcheight', 'srcdepth', 'filter' },
+      arguments = { 'source', 'dstx', 'dsty', 'dstlayer', 'dstmipmap', 'srcx', 'srcy', 'srclayer', 'srcmipmap', 'width', 'height', 'layers' },
       returns = {}
     }
   },

+ 1 - 1
api/lovr/headset/Layer/setColor.lua

@@ -24,7 +24,7 @@ return {
       description = 'The alpha component of the color.'
     },
     t = {
-      type = 'table',
+      type = '{number}',
       description = 'A table of 3 or 4 color components.'
     },
     hex = {

+ 1 - 1
api/lovr/headset/getAxis.lua

@@ -19,7 +19,7 @@ return {
   },
   returns = {
     ['...'] = {
-      type = 'number',
+      type = 'number | nil',
       description = [[
         The current state of the components of the axis, or `nil` if the device does not have any
         information about the axis.

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

@@ -15,6 +15,7 @@ return {
       returns = { 'depth' }
     }
   },
+  notes = 'If the VR system is not roomscale, this will return zero.',
   related = {
     'lovr.headset.getBoundsWidth',
     'lovr.headset.getBoundsDimensions'

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

@@ -19,6 +19,7 @@ return {
       returns = { 'width', 'depth' }
     }
   },
+  notes = 'If the VR system is not roomscale, this will return zero.',
   related = {
     'lovr.headset.getBoundsWidth',
     'lovr.headset.getBoundsDepth',

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

@@ -15,6 +15,7 @@ return {
       returns = { 'width' }
     }
   },
+  notes = 'If the VR system is not roomscale, this will return zero.',
   related = {
     'lovr.headset.getBoundsDepth',
     'lovr.headset.getBoundsDimensions'

+ 1 - 1
api/lovr/headset/getHands.lua

@@ -5,7 +5,7 @@ return {
   arguments = {},
   returns = {
     hands = {
-      type = 'table',
+      type = '{Device}',
       arguments = {},
       returns = {},
       description = 'The currently tracked hand devices.'

+ 1 - 1
api/lovr/headset/getLayers.lua

@@ -8,7 +8,7 @@ return {
   arguments = {},
   returns = {
     layers = {
-      type = 'table',
+      type = '{Layer}',
       description = 'The list of layers.'
     }
   },

+ 1 - 2
api/lovr/headset/getName.lua

@@ -17,6 +17,5 @@ return {
       arguments = {},
       returns = { 'name' }
     }
-  },
-  notes = 'When headset simulator is used this function returns `nil`.'
+  }
 }

+ 1 - 1
api/lovr/headset/getPass.lua

@@ -5,7 +5,7 @@ return {
   arguments = {},
   returns = {
     pass = {
-      type = 'Pass',
+      type = 'Pass | nil',
       description = 'The pass.'
     }
   },

+ 1 - 1
api/lovr/headset/getRefreshRate.lua

@@ -5,7 +5,7 @@ return {
   arguments = {},
   returns = {
     rate = {
-      type = 'number',
+      type = 'number | nil',
       description = 'The refresh rate of the display, or `nil` if I have no idea what it is.'
     }
   },

+ 1 - 1
api/lovr/headset/getRefreshRates.lua

@@ -7,7 +7,7 @@ return {
   arguments = {},
   returns = {
     rates = {
-      type = 'table',
+      type = 'table | nil',
       description = [[
         A flat table of the refresh rates supported by the headset display, or nil if not supported.
       ]]

+ 1 - 1
api/lovr/headset/getSkeleton.lua

@@ -17,7 +17,7 @@ return {
   },
   returns = {
     transforms = {
-      type = 'table',
+      type = '{{number}} | nil',
       description = [[
         A list of joint transforms for the device.  Each transform is a table with 3 numbers for the
         position of the joint, 1 number for the joint radius (in meters), and 4 numbers for the

+ 1 - 1
api/lovr/headset/getTexture.lua

@@ -9,7 +9,7 @@ return {
   arguments = {},
   returns = {
     texture = {
-      type = 'Texture',
+      type = 'Texture | nil',
       description = 'The headset texture.'
     }
   },

+ 4 - 4
api/lovr/headset/getViewAngles.lua

@@ -16,19 +16,19 @@ return {
   },
   returns = {
     left = {
-      type = 'number',
+      type = 'number | nil',
       description = 'The left view angle, in radians.'
     },
     right = {
-      type = 'number',
+      type = 'number | nil',
       description = 'The right view angle, in radians.'
     },
     top = {
-      type = 'number',
+      type = 'number | nil',
       description = 'The top view angle, in radians.'
     },
     bottom = {
-      type = 'number',
+      type = 'number | nil',
       description = 'The bottom view angle, in radians.'
     }
   },

+ 7 - 7
api/lovr/headset/getViewPose.lua

@@ -15,31 +15,31 @@ return {
   },
   returns = {
     x = {
-      type = 'number',
+      type = 'number | nil',
       description = 'The x coordinate of the view position, in meters.'
     },
     y = {
-      type = 'number',
+      type = 'number | nil',
       description = 'The y coordinate of the view position, in meters.'
     },
     z = {
-      type = 'number',
+      type = 'number | nil',
       description = 'The z coordinate of the view position, in meters.'
     },
     angle = {
-      type = 'number',
+      type = 'number | nil',
       description = 'The amount of rotation around the rotation axis, in radians.'
     },
     ax = {
-      type = 'number',
+      type = 'number | nil',
       description = 'The x component of the axis of rotation.'
     },
     ay = {
-      type = 'number',
+      type = 'number | nil',
       description = 'The y component of the axis of rotation.'
     },
     az = {
-      type = 'number',
+      type = 'number | nil',
       description = 'The z component of the axis of rotation.'
     }
   },

+ 1 - 1
api/lovr/headset/isDown.lua

@@ -14,7 +14,7 @@ return {
   },
   returns = {
     down = {
-      type = 'boolean',
+      type = 'boolean | nil',
       description = [[
         Whether the button on the device is currently pressed, or `nil` if the device does not have
         the specified button.

+ 1 - 1
api/lovr/headset/isTouched.lua

@@ -14,7 +14,7 @@ return {
   },
   returns = {
     touched = {
-      type = 'boolean',
+      type = 'boolean | nil',
       description = [[
         Whether the button on the device is currently touched, or `nil` if the device does not have
         the button or it isn't touch-sensitive.

+ 7 - 30
api/lovr/headset/setBackground.lua

@@ -11,44 +11,21 @@ return {
     tracked smoothly even if LÖVR is struggling to render at a high frame rate.
   ]],
   arguments = {
-    texture = {
-      type = 'Texture',
+    background = {
+      type = 'Image | {Image} | Texture',
       description = [[
-        The Texture to use for the background.  It can be a `cube` texture which will be rendered as
-        a cubemap, or a `2d` texture interpreted as equirectangular (sometimes called panoramic or
-        spherical) coordinates.
+        The image(s) or texture to use for the background.  Backgrounds can either be cubemaps (6
+        images) or equirectangular (a single panoramic 2D image).
 
-        The texture can have any color format, but it will be converted to `rgba8` before getting
-        copied to the VR runtime.
-      ]]
-    },
-    image = {
-      type = 'Image',
-      description = [[
-        The Image to use for the background.  It can have 1 layer for an equirectangular background,
-        or 6 layers for a cubemap.  Currently, it must have a format of `rgba8`.
-      ]]
-    },
-    images = {
-      type = 'table',
-      description = [[
-        A table of 1 or 6 images to use for the background.  They must be the same size and they
-        currently must use the `rgba8` format.
+        Textures can have any color format, but it will be converted to `rgba8` before getting
+        copied to the VR runtime.  Images currently have to be `rgba8`.
       ]]
     }
   },
   returns = {},
   variants = {
     {
-      arguments = { 'texture' },
-      returns = {}
-    },
-    {
-      arguments = { 'image' },
-      returns = {}
-    },
-    {
-      arguments = { 'images' },
+      arguments = { 'background' },
       returns = {}
     },
     {

+ 1 - 6
api/lovr/headset/wasPressed.lua

@@ -24,12 +24,7 @@ return {
       returns = { 'pressed' }
     }
   },
-  notes = [[
-    Some headset backends are not able to return pressed/released information.  These drivers will
-    always return false for `lovr.headset.wasPressed` and `lovr.headset.wasReleased`.
-
-    Typically the internal `lovr.headset.update` function will update pressed/released status.
-  ]],
+  notes = 'The internal `lovr.headset.update` function updates pressed/released status.',
   related = {
     'DeviceButton',
     'lovr.headset.isDown',

+ 1 - 1
api/lovr/math/Curve/render.lua

@@ -23,7 +23,7 @@ return {
   },
   returns = {
     t = {
-      type = 'table',
+      type = '{number}',
       description = 'A (flat) table of 3D points along the curve.'
     }
   },

+ 1 - 1
api/lovr/math/gammaToLinear.lua

@@ -16,7 +16,7 @@ return {
       description = 'The blue component of the gamma-space color.'
     },
     color = {
-      type = 'table',
+      type = '{number}',
       description = 'A table containing the components of a gamma-space color.'
     },
     x = {

+ 1 - 1
api/lovr/math/linearToGamma.lua

@@ -16,7 +16,7 @@ return {
       description = 'The blue component of the linear-space color.'
     },
     color = {
-      type = 'table',
+      type = '{number}',
       description = 'A table containing the components of a linear-space color.'
     },
     x = {

+ 5 - 3
api/lovr/physics/Collider/getShape.lua

@@ -10,8 +10,11 @@ return {
   arguments = {},
   returns = {
     shape = {
-      type = 'Shape',
-      description = 'One of the `Shape` objects attached to the Collider.'
+      type = 'Shape | nil',
+      description = [[
+        One of the `Shape` objects attached to the Collider, or `nil` if the Collider doesn't have
+        any shapes attached to it.
+      ]]
     }
   },
   variants = {
@@ -20,7 +23,6 @@ return {
       returns = { 'shape' }
     }
   },
-  notes = 'This may return `nil` if the Collider doesn\'t have any shapes attached to it.',
   example = [[
     function drawBoxCollider(pass, collider)
       local position = vec3(collider:getPosition())

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

@@ -12,7 +12,7 @@ return {
   arguments = {},
   returns = {
     tag = {
-      type = 'string',
+      type = 'string | nil',
       description = 'The Collider\'s tag.'
     }
   },

+ 2 - 0
api/lovr/physics/Collider/setDegreesOfFreedom.lua

@@ -4,6 +4,7 @@ return {
   arguments = {
     translation = {
       type = 'string',
+      default = [['']],
       description = [[
         A string containing the world-space axes the Collider is allowed to move on.  The string
         should have 'x', 'y', and 'z' letters representing the axes to enable.  Use nil or an empty
@@ -12,6 +13,7 @@ return {
     },
     rotation = {
       type = 'string',
+      default = [['']],
       description = [[
         A string containing the world-space axes the Collider is allowed to rotate on.  The string
         should have 'x', 'y', and 'z' letters representing the axes to enable.  Use nil or an empty

+ 1 - 1
api/lovr/physics/Shape/raycast.lua

@@ -66,7 +66,7 @@ return {
       description = 'The z component of the normal vector.'
     },
     triangle = {
-      type = 'number',
+      type = 'number | nil',
       description = 'The index of the triangle that was hit, or `nil` if this is not a MeshShape.'
     }
   },

+ 4 - 4
api/lovr/physics/World/getCallbacks.lua

@@ -12,22 +12,22 @@ return {
       table = {
         {
           name = 'filter',
-          type = 'function',
+          type = 'function | nil',
           description = 'The function used to filter collisions.'
         },
         {
           name = 'enter',
-          type = 'function',
+          type = 'function | nil',
           description = 'The function called when 2 colliders start touching.'
         },
         {
           name = 'exit',
-          type = 'function',
+          type = 'function | nil',
           description = 'The function called when 2 colliders stop touching.'
         },
         {
           name = 'contact',
-          type = 'function',
+          type = 'function | nil',
           description = 'The function called every frame while 2 colliders are in contact.'
         }
       }

+ 1 - 1
api/lovr/physics/World/getColliders.lua

@@ -6,7 +6,7 @@ return {
   arguments = {},
   returns = {
     colliders = {
-      type = 'table',
+      type = '{Collider}',
       description = 'The list of `Collider` objects in the World.'
     }
   },

+ 1 - 1
api/lovr/physics/World/getJoints.lua

@@ -6,7 +6,7 @@ return {
   arguments = {},
   returns = {
     joints = {
-      type = 'table',
+      type = '{Joint}',
       description = 'The list of `Joint` objects in the World.'
     }
   },

+ 1 - 1
api/lovr/physics/World/getTags.lua

@@ -8,7 +8,7 @@ return {
   arguments = {},
   returns = {
     tags = {
-      type = 'table',
+      type = '{string}',
       description = 'A table of collision tags (strings).'
     }
   },

+ 1 - 0
api/lovr/physics/World/overlapShape.lua

@@ -71,6 +71,7 @@ return {
     },
     callback = {
       type = 'function',
+      default = 'nil',
       description = 'The callback to call for each intersection detected.'
     }
   },

+ 1 - 0
api/lovr/physics/World/queryBox.lua

@@ -53,6 +53,7 @@ return {
     },
     callback = {
       type = 'function',
+      default = 'nil',
       description = [[
         A function to call when a collider is detected.  The function will be called with a single
         `Collider` argument.

+ 1 - 0
api/lovr/physics/World/querySphere.lua

@@ -41,6 +41,7 @@ return {
     },
     callback = {
       type = 'function',
+      default = 'nil',
       description = [[
         A function to call when an intersection is detected.  The function will be called with a
         single `Collider` argument.

+ 2 - 1
api/lovr/physics/World/raycast.lua

@@ -48,6 +48,7 @@ return {
     },
     callback = {
       type = 'function',
+      default = 'nil',
       arguments = {
         {
           name = 'collider',
@@ -134,7 +135,7 @@ return {
       description = 'The z component of the normal vector.'
     },
     triangle = {
-      type = 'number',
+      type = 'number | nil',
       description = 'The index of the triangle that was hit, or nil if a MeshShape was not hit.'
     }
   },

+ 1 - 1
api/lovr/physics/World/setCallbacks.lua

@@ -33,7 +33,7 @@ return {
   arguments = {
     callbacks = {
       type = 'table',
-      description = 'The World collision callbacks.',
+      description = 'The World collision callbacks.  All of them are optional.',
       table = {
         {
           name = 'filter',

+ 4 - 20
api/lovr/physics/newConvexShape.lua

@@ -9,17 +9,9 @@ return {
         numbers) or a table of numbers (every 3 numbers form a 3D point).
       ]]
     },
-    modelData = {
-      type = 'ModelData',
-      description = 'The ModelData to compute a convex hull from.'
-    },
-    model = {
-      type = 'Model',
-      description = 'The Model to compute a convex hull from.'
-    },
-    mesh = {
-      type = 'Mesh',
-      description = 'The Mesh to compute a convex hull from.  It must use the `cpu` storage mode.'
+    object = {
+      type = 'ModelData | Model | Mesh',
+      description = 'An object to use for the points of the convex hull.'
     },
     template = {
       type = 'ConvexShape',
@@ -43,15 +35,7 @@ return {
       returns = { 'shape' }
     },
     {
-      arguments = { 'modelData', 'scale' },
-      returns = { 'shape' }
-    },
-    {
-      arguments = { 'model', 'scale' },
-      returns = { 'shape' }
-    },
-    {
-      arguments = { 'mesh', 'scale' },
+      arguments = { 'object', 'scale' },
       returns = { 'shape' }
     },
     {

+ 4 - 23
api/lovr/physics/newMeshShape.lua

@@ -12,20 +12,9 @@ return {
         A table of triangle indices representing how the vertices are connected in the Mesh.
       ]]
     },
-    modelData = {
-      type = 'ModelData',
-      description = 'The ModelData to use the vertices from.'
-    },
-    model = {
-      type = 'Model',
-      description = [[
-        A Model to use for the mesh data.  Similar to calling `Model:getTriangles` and passing it to
-        this function, but has better performance.
-      ]]
-    },
-    mesh = {
-      type = 'Mesh',
-      description = 'The Mesh to use the vertices from.  It must use the `cpu` storage mode.'
+    object = {
+      type = 'ModelData | Model | Mesh',
+      description = 'An object to use the triangles from.  Meshes must use the `cpu` storage mode.'
     },
     template = {
       type = 'MeshShape',
@@ -49,15 +38,7 @@ return {
       returns = { 'mesh' }
     },
     {
-      arguments = { 'modelData', 'scale' },
-      returns = { 'mesh' }
-    },
-    {
-      arguments = { 'model', 'scale' },
-      returns = { 'mesh' }
-    },
-    {
-      arguments = { 'mesh', 'scale' },
+      arguments = { 'object', 'scale' },
       returns = { 'mesh' }
     },
     {

+ 2 - 2
api/lovr/system/getClipboardText.lua

@@ -5,8 +5,8 @@ return {
   arguments = {},
   returns = {
     text = {
-      type = 'string',
-      description = 'The clipboard text (may be nil).'
+      type = 'string | nil',
+      description = 'The clipboard text.'
     }
   },
   variants = {

+ 1 - 1
api/lovr/thread/Channel/pop.lua

@@ -6,7 +6,7 @@ return {
   ]],
   arguments = {
     wait = {
-      type = 'number',
+      type = 'number | boolean',
       default = 'false',
       description = [[
         How long to wait for a message to be popped, in seconds.  `true` can be used to wait forever

+ 1 - 1
api/lovr/thread/Channel/push.lua

@@ -10,7 +10,7 @@ return {
       description = 'The message to push.'
     },
     wait = {
-      type = 'number',
+      type = 'number | boolean',
       default = 'false',
       description = [[
         How long to wait for the message to be popped, in seconds.  `true` can be used to wait

+ 1 - 1
api/lovr/thread/Thread/getError.lua

@@ -6,7 +6,7 @@ return {
   arguments = {},
   returns = {
     error = {
-      type = 'string',
+      type = 'string | nil',
       description = 'The error message, or `nil` if no error has occurred on the Thread.'
     }
   },

+ 4 - 1
api/lovr/thread/Thread/start.lua

@@ -14,7 +14,10 @@ return {
       returns = {}
     }
   },
-  notes = 'The arguments can be nil, booleans, numbers, strings, or LÖVR objects.',
+  notes = [[
+    The arguments can be nil, booleans, numbers, strings, lightuserdata, tables, vectors, or LÖVR
+    objects.
+  ]],
   example = [=[
     function lovr.load()
       lovr.thread.newThread([[

+ 4 - 12
api/lovr/thread/newThread.lua

@@ -6,13 +6,9 @@ return {
       type = 'string',
       description = 'The code to run in the Thread.'
     },
-    filename = {
-      type = 'string',
-      description = 'A file containing code to run in the Thread.'
-    },
-    blob = {
-      type = 'Blob',
-      description = 'The code to run in the Thread.'
+    file = {
+      type = 'string | Blob',
+      description = 'A filename or Blob containing code to run in the Thread.'
     }
   },
   returns = {
@@ -27,11 +23,7 @@ return {
       returns = { 'thread' }
     },
     {
-      arguments = { 'filename' },
-      returns = { 'thread' }
-    },
-    {
-      arguments = { 'blob' },
+      arguments = { 'file' },
       returns = { 'thread' }
     }
   },

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov