Browse Source

Add number/vector overloads for everything;

bjorn 2 years ago
parent
commit
3657d082e8

File diff suppressed because it is too large
+ 944 - 100
api/init.lua


+ 2 - 2
api/lovr/audio/setOrientation.lua

@@ -27,12 +27,12 @@ return {
   returns = {},
   variants = {
     {
-      description = 'Set the listener position using numbers.',
+      description = 'Set the listener orientation using numbers.',
       arguments = { 'angle', 'ax', 'ay', 'az' },
       returns = {}
     },
     {
-      description = 'Set the listener position using a vector.',
+      description = 'Set the listener orientation using a vector.',
       arguments = { 'orientation' },
       returns = {}
     }

+ 71 - 4
api/lovr/graphics/Pass/box.lua

@@ -5,12 +5,71 @@ return {
     Draw a box.  This is like `Pass:cube`, except it takes 3 separate values for the scale.
   ]],
   arguments = {
+    x = {
+      type = 'number',
+      default = '0',
+      description = 'The x coordinate of the center of the box.'
+    },
+    y = {
+      type = 'number',
+      default = '0',
+      description = 'The y coordinate of the center of the box.'
+    },
+    z = {
+      type = 'number',
+      default = '0',
+      description = 'The z coordinate of the center of the box.'
+    },
+    width = {
+      type = 'number',
+      default = '1',
+      description = 'The width of the box.'
+    },
+    height = {
+      type = 'number',
+      default = '1',
+      description = 'The height of the box.'
+    },
+    depth = {
+      type = 'number',
+      default = '1',
+      description = 'The depth of the box.'
+    },
+    angle = {
+      type = 'number',
+      default = '0',
+      description = 'The rotation of the box around its rotation axis, in radians.'
+    },
+    ax = {
+      type = 'number',
+      default = '0',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      default = '1',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      default = '0',
+      description = 'The z component of the axis of rotation.'
+    },
+    position = {
+      type = 'Vec3',
+      description = 'The position of the box.'
+    },
+    size = {
+      type = 'Vec3',
+      description = 'The size of the box.'
+    },
+    orientation = {
+      type = 'Quat',
+      description = 'The orientation of the box.'
+    },
     transform = {
       type = 'Mat4',
-      description = [[
-        The transform of the box.  Can also be provided as position, 3-component scale, and rotation
-        using a mix of `Vectors` or numbers.
-      ]]
+      description = 'The transform of the box.'
     },
     style = {
       type = 'DrawStyle',
@@ -20,6 +79,14 @@ return {
   },
   returns = {},
   variants = {
+    {
+      arguments = { 'x', 'y', 'z', 'width', 'height', 'depth', 'angle', 'ax', 'ay', 'az', 'style' },
+      returns = {}
+    },
+    {
+      arguments = { 'position', 'size', 'orientation', 'style' },
+      returns = {}
+    },
     {
       arguments = { 'transform', 'style' },
       returns = {}

+ 66 - 6
api/lovr/graphics/Pass/capsule.lua

@@ -5,14 +5,66 @@ return {
     Draws a capsule.  A capsule is shaped like a cylinder with a hemisphere on each end.
   ]],
   arguments = {
+    x = {
+      type = 'number',
+      default = '0',
+      description = 'The x coordinate of the center of the capsule.'
+    },
+    y = {
+      type = 'number',
+      default = '0',
+      description = 'The y coordinate of the center of the capsule.'
+    },
+    z = {
+      type = 'number',
+      default = '0',
+      description = 'The z coordinate of the center of the capsule.'
+    },
+    radius = {
+      type = 'number',
+      default = '1',
+      description = 'The radius of the capsule.'
+    },
+    length = {
+      type = 'number',
+      default = '1',
+      description = 'The length of the capsule.'
+    },
+    angle = {
+      type = 'number',
+      default = '0',
+      description = 'The rotation of the capsule around its rotation axis, in radians.'
+    },
+    ax = {
+      type = 'number',
+      default = '0',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      default = '1',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      default = '0',
+      description = 'The z component of the axis of rotation.'
+    },
+    position = {
+      type = 'Vec3',
+      description = 'The position of the center of the capsule.'
+    },
+    scale = {
+      type = 'Vec3',
+      description = 'The size of the capsule (x and y scale the radius, z is the length).'
+    },
+    orientation = {
+      type = 'Quat',
+      description = 'The orientation of the capsule.'
+    },
     transform = {
       type = 'Mat4',
-      description = [[
-        The transform of the capsule.  Can also be provided as position, scale, and rotation using a
-        mix of `Vectors` or numbers.  When using numbers for the scale, 2 should be provided: one
-        for the radius and one for the length.  When using a matrix or a vector for the scale, the X
-        and Y components are the radius and the Z component is the length.
-      ]]
+      description = 'The transform of the capsule.'
     },
     p1 = {
       type = 'Vec3',
@@ -35,6 +87,14 @@ return {
   },
   returns = {},
   variants = {
+    {
+      arguments = { 'x', 'y', 'z', 'radius', 'length', 'angle', 'ax', 'ay', 'az', 'segments' },
+      returns = {}
+    },
+    {
+      arguments = { 'position', 'scale', 'orientation', 'segments' },
+      returns = {}
+    },
     {
       arguments = { 'transform', 'segments' },
       returns = {}

+ 59 - 6
api/lovr/graphics/Pass/circle.lua

@@ -3,12 +3,57 @@ return {
   summary = 'Draw a circle.',
   description = 'Draws a circle.',
   arguments = {
+    x = {
+      type = 'number',
+      default = '0',
+      description = 'The x coordinate of the center of the circle.'
+    },
+    y = {
+      type = 'number',
+      default = '0',
+      description = 'The y coordinate of the center of the circle.'
+    },
+    z = {
+      type = 'number',
+      default = '0',
+      description = 'The z coordinate of the center of the circle.'
+    },
+    radius = {
+      type = 'number',
+      default = '1',
+      description = 'The radius of the circle.'
+    },
+    angle = {
+      type = 'number',
+      default = '0',
+      description = 'The rotation of the circle around its rotation axis, in radians.'
+    },
+    ax = {
+      type = 'number',
+      default = '0',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      default = '1',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      default = '0',
+      description = 'The z component of the axis of rotation.'
+    },
+    position = {
+      type = 'Vec3',
+      description = 'The position of the circle.'
+    },
+    orientation = {
+      type = 'Quat',
+      description = 'The orientation of the circle.'
+    },
     transform = {
       type = 'Mat4',
-      description = [[
-        The transform of the circle.  Can also be provided as position, radius, and rotation, using
-        a mix of `Vectors` or numbers.
-      ]]
+      description = 'The transform of the circle.'
     },
     style = {
       type = 'DrawStyle',
@@ -33,13 +78,21 @@ return {
   },
   returns = {},
   variants = {
+    {
+      arguments = { 'x', 'y', 'z', 'radius', 'angle', 'ax', 'ay', 'az', 'style', 'angle1', 'angle2', 'segments' },
+      returns = {}
+    },
+    {
+      arguments = { 'position', 'radius', 'orientation', 'style', 'angle1', 'angle2', 'segments' },
+      returns = {}
+    },
     {
       arguments = { 'transform', 'style', 'angle1', 'angle2', 'segments' },
       returns = {}
     }
   },
   notes = [[
-    The local origin of the circle is in its center.  The local z axis is perpendicular to plane of
-    the circle.
+    The local origin of the circle is in its center.  The local z axis is perpendicular to the
+    circle.
   ]]
 }

+ 66 - 6
api/lovr/graphics/Pass/cone.lua

@@ -3,14 +3,66 @@ return {
   summary = 'Draw a cone.',
   description = 'Draws a cone.',
   arguments = {
+    x = {
+      type = 'number',
+      default = '0',
+      description = 'The x coordinate of the center of the base of the cone.'
+    },
+    y = {
+      type = 'number',
+      default = '0',
+      description = 'The y coordinate of the center of the base of the cone.'
+    },
+    z = {
+      type = 'number',
+      default = '0',
+      description = 'The z coordinate of the center of the base of the cone.'
+    },
+    radius = {
+      type = 'number',
+      default = '1',
+      description = 'The radius of the cone.'
+    },
+    length = {
+      type = 'number',
+      default = '1',
+      description = 'The length of the cone.'
+    },
+    angle = {
+      type = 'number',
+      default = '0',
+      description = 'The rotation of the cone around its rotation axis, in radians.'
+    },
+    ax = {
+      type = 'number',
+      default = '0',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      default = '1',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      default = '0',
+      description = 'The z component of the axis of rotation.'
+    },
+    position = {
+      type = 'Vec3',
+      description = 'The position of the center of the base of the cone.'
+    },
+    scale = {
+      type = 'Vec3',
+      description = 'The size of the cone (x and y scale the radius, z is the length).'
+    },
+    orientation = {
+      type = 'Quat',
+      description = 'The orientation of the cone.'
+    },
     transform = {
       type = 'Mat4',
-      description = [[
-        The transform of the cone.  Can also be provided as position, scale, and rotation using a
-        mix of `Vectors` or numbers.  When using numbers for the scale, 2 should be provided: one
-        for the radius and one for the length.  When using a matrix or a vector for the scale, the X
-        and Y components are the radius and the Z component is the length.
-      ]]
+      description = 'The transform of the cone.'
     },
     segments = {
       type = 'number',
@@ -20,6 +72,14 @@ return {
   },
   returns = {},
   variants = {
+    {
+      arguments = { 'x', 'y', 'z', 'radius', 'length', 'angle', 'ax', 'ay', 'az', 'segments' },
+      returns = {}
+    },
+    {
+      arguments = { 'position', 'scale', 'orientation', 'segments' },
+      returns = {}
+    },
     {
       arguments = { 'transform', 'segments' },
       returns = {}

+ 57 - 4
api/lovr/graphics/Pass/cube.lua

@@ -3,12 +3,57 @@ return {
   summary = 'Draw a cube.',
   description = 'Draws a cube.',
   arguments = {
+    x = {
+      type = 'number',
+      default = '0',
+      description = 'The x coordinate of the center of the cube.'
+    },
+    y = {
+      type = 'number',
+      default = '0',
+      description = 'The y coordinate of the center of the cube.'
+    },
+    z = {
+      type = 'number',
+      default = '0',
+      description = 'The z coordinate of the center of the cube.'
+    },
+    size = {
+      type = 'number',
+      default = '1',
+      description = 'The size of the cube.'
+    },
+    angle = {
+      type = 'number',
+      default = '0',
+      description = 'The rotation of the cube around its rotation axis, in radians.'
+    },
+    ax = {
+      type = 'number',
+      default = '0',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      default = '1',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      default = '0',
+      description = 'The z component of the axis of rotation.'
+    },
+    position = {
+      type = 'Vec3',
+      description = 'The position of the cube.'
+    },
+    orientation = {
+      type = 'Quat',
+      description = 'The orientation of the cube.'
+    },
     transform = {
       type = 'Mat4',
-      description = [[
-        The transform of the cube.  Can also be provided as position, 1-component scale, and
-        rotation using a mix of `Vectors` or numbers.
-      ]]
+      description = 'The transform of the cube.'
     },
     style = {
       type = 'DrawStyle',
@@ -18,6 +63,14 @@ return {
   },
   returns = {},
   variants = {
+    {
+      arguments = { 'x', 'y', 'z', 'size', 'angle', 'ax', 'ay', 'az', 'style' },
+      returns = {}
+    },
+    {
+      arguments = { 'position', 'size', 'orientation', 'style' },
+      returns = {}
+    },
     {
       arguments = { 'transform', 'style' },
       returns = {}

+ 66 - 10
api/lovr/graphics/Pass/cylinder.lua

@@ -3,14 +3,66 @@ return {
   summary = 'Draw a cylinder.',
   description = 'Draws a cylinder.',
   arguments = {
+    x = {
+      type = 'number',
+      default = '0',
+      description = 'The x coordinate of the center of the cylinder.'
+    },
+    y = {
+      type = 'number',
+      default = '0',
+      description = 'The y coordinate of the center of the cylinder.'
+    },
+    z = {
+      type = 'number',
+      default = '0',
+      description = 'The z coordinate of the center of the cylinder.'
+    },
+    radius = {
+      type = 'number',
+      default = '1',
+      description = 'The radius of the cylinder.'
+    },
+    length = {
+      type = 'number',
+      default = '1',
+      description = 'The length of the cylinder.'
+    },
+    angle = {
+      type = 'number',
+      default = '0',
+      description = 'The rotation of the cylinder around its rotation axis, in radians.'
+    },
+    ax = {
+      type = 'number',
+      default = '0',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      default = '1',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      default = '0',
+      description = 'The z component of the axis of rotation.'
+    },
+    position = {
+      type = 'Vec3',
+      description = 'The position of the center of the cylinder.'
+    },
+    scale = {
+      type = 'Vec3',
+      description = 'The size of the cylinder (x and y scale the radius, z is the length).'
+    },
+    orientation = {
+      type = 'Quat',
+      description = 'The orientation of the cylinder.'
+    },
     transform = {
       type = 'Mat4',
-      description = [[
-        The transform of the cylinder.  Can also be provided as position, scale, and rotation using
-        a mix of `Vectors` or numbers.  When using numbers for the scale, 2 should be provided: one
-        for the radius and one for the length.  When using a matrix or a vector for the scale, the X
-        and Y components are the radius and the Z component is the length.
-      ]]
+      description = 'The transform of the cylinder.'
     },
     p1 = {
       type = 'Vec3',
@@ -20,10 +72,6 @@ return {
       type = 'Vec3',
       description = 'The ending point of the cylinder.'
     },
-    radius = {
-      type = 'number',
-      description = 'The radius of the cylinder.'
-    },
     capped = {
       type = 'boolean',
       default = 'true',
@@ -46,6 +94,14 @@ return {
     }
   },
   variants = {
+    {
+      arguments = { 'x', 'y', 'z', 'radius', 'length', 'angle', 'ax', 'ay', 'az', 'capped', 'angle1', 'angle2', 'segments' },
+      returns = {}
+    },
+    {
+      arguments = { 'position', 'scale', 'orientation', 'capped', 'angle1', 'angle2', 'segments' },
+      returns = {}
+    },
     {
       arguments = { 'transform', 'capped', 'angle1', 'angle2', 'segments' },
       returns = {}

+ 65 - 4
api/lovr/graphics/Pass/draw.lua

@@ -7,12 +7,57 @@ return {
       type = 'Model',
       description = 'The model to draw.'
     },
+    x = {
+      type = 'number',
+      default = '0',
+      description = 'The x coordinate to draw the model at.'
+    },
+    y = {
+      type = 'number',
+      default = '0',
+      description = 'The y coordinate to draw the model at.'
+    },
+    z = {
+      type = 'number',
+      default = '0',
+      description = 'The z coordinate to draw the model at.'
+    },
+    scale = {
+      type = 'number',
+      default = '1',
+      description = 'The scale of the model.'
+    },
+    angle = {
+      type = 'number',
+      default = '0',
+      description = 'The rotation of the model around its rotation axis, in radians.'
+    },
+    ax = {
+      type = 'number',
+      default = '0',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      default = '1',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      default = '0',
+      description = 'The z component of the axis of rotation.'
+    },
+    position = {
+      type = 'Vec3',
+      description = 'The position to draw the model at.'
+    },
+    orientation = {
+      type = 'Quat',
+      description = 'The orientation of the model.'
+    },
     transform = {
       type = 'Mat4',
-      description = [[
-        The transform of the model.  Can also be provided as a position, 1-component scale, and
-        rotation using a combination of `Vectors` and numbers.
-      ]]
+      description = 'The transform of the model.'
     },
     nodeindex = {
       type = 'number',
@@ -37,10 +82,26 @@ return {
   },
   returns = {},
   variants = {
+    {
+      arguments = { 'model', 'x', 'y', 'z', 'scale', 'angle', 'ax', 'ay', 'az', 'nodeindex', 'children', 'instances' },
+      returns = {}
+    },
+    {
+      arguments = { 'model', 'position', 'scale', 'orientation', 'nodeindex', 'children', 'instances' },
+      returns = {}
+    },
     {
       arguments = { 'model', 'transform', 'nodeindex', 'children', 'instances' },
       returns = {}
     },
+    {
+      arguments = { 'model', 'x', 'y', 'z', 'scale', 'angle', 'ax', 'ay', 'az', 'nodename', 'children', 'instances' },
+      returns = {}
+    },
+    {
+      arguments = { 'model', 'position', 'scale', 'orientation', 'nodename', 'children', 'instances' },
+      returns = {}
+    },
     {
       arguments = { 'model', 'transform', 'nodename', 'children', 'instances' },
       returns = {}

+ 91 - 10
api/lovr/graphics/Pass/mesh.lua

@@ -28,12 +28,61 @@ return {
       type = 'number',
       description = 'The number of bytes between consecutive elements in the draw buffer.'
     },
+    x = {
+      type = 'number',
+      default = '0',
+      description = 'The x coordinate of the position to draw the mesh at.'
+    },
+    y = {
+      type = 'number',
+      default = '0',
+      description = 'The y coordinate of the position to draw the mesh at.'
+    },
+    z = {
+      type = 'number',
+      default = '0',
+      description = 'The z coordinate of the position to draw the mesh at.'
+    },
+    scale = {
+      type = 'number',
+      default = '1',
+      description = 'The scale of the mesh.'
+    },
+    angle = {
+      type = 'number',
+      default = '0',
+      description = 'The number of radians the mesh is rotated around its rotational axis.'
+    },
+    ax = {
+      type = 'number',
+      default = '0',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      default = '1',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      default = '0',
+      description = 'The z component of the axis of rotation.'
+    },
+    position = {
+      type = 'Vec3',
+      description = 'The position to draw the mesh at.'
+    },
+    scales = {
+      type = 'Vec3',
+      description = 'The scale of the mesh.'
+    },
+    orientation = {
+      type = 'Quat',
+      description = 'The orientation of the mesh.'
+    },
     transform = {
       type = 'Mat4',
-      description = [[
-        The transform to apply to the mesh.  Can also be provided as a position, 1-component scale,
-        and rotation using a combination of `Vectors` and numbers.
-      ]]
+      description = 'The transform to apply to the mesh.'
     },
     start = {
       type = 'number',
@@ -54,7 +103,11 @@ return {
     },
     vertexcount = {
       type = 'number',
-      description = 'The number of vertices or indices to draw.'
+      description = 'The number of vertices to draw.'
+    },
+    indexcount = {
+      type = 'number',
+      description = 'The number of indices to draw.'
     },
     instances = {
       type = 'number',
@@ -70,23 +123,47 @@ return {
   returns = {},
   variants = {
     {
-      arguments = { 'vertices', 'transform', 'start', 'count', 'instances', 'base' },
+      description = 'Draw a range of vertices from a Buffer, using numbers for the transform.',
+      arguments = { 'vertices', 'x', 'y', 'z', 'scale', 'angle', 'ax', 'ay', 'az', 'start', 'count', 'instances' },
       returns = {}
     },
     {
-      arguments = { 'vertices', 'indices', 'transform', 'start', 'count', 'instances', 'base' },
+      description = 'Draw a range of vertices from a Buffer, using vector types for the transform.',
+      arguments = { 'vertices', 'position', 'scales', 'orientation', 'start', 'count', 'instances' },
       returns = {}
     },
     {
-      arguments = { 'vertices', 'indices', 'draws', 'drawcount', 'offset', 'stride' },
+      description = 'Draw a range of vertices from a Buffer, using a matrix for the transform.',
+      arguments = { 'vertices', 'transform', 'start', 'count', 'instances' },
       returns = {}
     },
     {
-      arguments = { 'vertexcount', 'transform' },
+      description = [[
+        Draw a mesh using a vertex buffer and an index buffer, using numbers for the transform.
+      ]],
+      arguments = { 'vertices', 'indices', 'x', 'y', 'z', 'scale', 'angle', 'ax', 'ay', 'az', 'start', 'count', 'instances', 'base' },
       returns = {}
     },
     {
-      arguments = { 'vertexcount', 'indices', 'transform' },
+      description = [[
+        Draw a mesh using a vertex buffer and an index buffer, using vector types for the transform.
+      ]],
+      arguments = { 'vertices', 'indices', 'position', 'scales', 'orientation', 'start', 'count', 'instances', 'base' },
+      returns = {}
+    },
+    {
+      description = [[
+        Draw a mesh using a vertex buffer and an index buffer, using a matrix for the transform.
+      ]],
+      arguments = { 'vertices', 'indices', 'transform', 'start', 'count', 'instances', 'base' },
+      returns = {}
+    },
+    {
+      description = [[
+        Perform indirect draws.  `drawcount` meshes from the vertex and index buffer will be drawn,
+        using parameters starting from `offset` bytes in the `draws` buffer.
+      ]],
+      arguments = { 'vertices', 'indices', 'draws', 'drawcount', 'offset', 'stride' },
       returns = {}
     }
   },
@@ -94,6 +171,10 @@ return {
     The index buffer defines the order the vertices are drawn in.  It can be used to reorder, reuse,
     or omit vertices from the mesh.
 
+    When drawing without a vertex buffer, the `VertexIndex` variable can be used in shaders to
+    compute the position of each vertex, possibly by reading data from other `Buffer` or `Texture`
+    resources.
+
     The active `MeshMode` controls whether the vertices are drawn as points, lines, or triangles.
 
     The active `Material` is applied to the mesh.

+ 66 - 4
api/lovr/graphics/Pass/plane.lua

@@ -3,12 +3,66 @@ return {
   summary = 'Draw a plane.',
   description = 'Draws a plane.',
   arguments = {
+    x = {
+      type = 'number',
+      default = '0',
+      description = 'The x coordinate of the center of the plane.'
+    },
+    y = {
+      type = 'number',
+      default = '0',
+      description = 'The y coordinate of the center of the plane.'
+    },
+    z = {
+      type = 'number',
+      default = '0',
+      description = 'The z coordinate of the center of the plane.'
+    },
+    width = {
+      type = 'number',
+      default = '1',
+      description = 'The width of the plane.'
+    },
+    height = {
+      type = 'number',
+      default = '1',
+      description = 'The height of the plane.'
+    },
+    angle = {
+      type = 'number',
+      default = '0',
+      description = 'The rotation of the plane around its rotation axis, in radians.'
+    },
+    ax = {
+      type = 'number',
+      default = '0',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      default = '1',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      default = '0',
+      description = 'The z component of the axis of rotation.'
+    },
+    position = {
+      type = 'Vec3',
+      description = 'The position of the plane.'
+    },
+    size = {
+      type = 'Vec2',
+      description = 'The size of the plane.'
+    },
+    orientation = {
+      type = 'Quat',
+      description = 'The orientation of the plane.'
+    },
     transform = {
       type = 'Mat4',
-      description = [[
-        The transform of the plane.  Can also be provided as a position, 2-component scale, and
-        rotation using a combination of `Vectors`, and numbers.
-      ]]
+      description = 'The transform of the plane.'
     },
     style = {
       type = 'DrawStyle',
@@ -28,6 +82,14 @@ return {
   },
   returns = {},
   variants = {
+    {
+      arguments = { 'x', 'y', 'z', 'width', 'height', 'angle', 'ax', 'ay', 'az', 'style', 'columns', 'rows' },
+      returns = {}
+    },
+    {
+      arguments = { 'position', 'size', 'orientation', 'style', 'columns', 'rows' },
+      returns = {}
+    },
     {
       arguments = { 'transform', 'style', 'columns', 'rows' },
       returns = {}

+ 57 - 4
api/lovr/graphics/Pass/sphere.lua

@@ -3,12 +3,57 @@ return {
   summary = 'Draw a sphere.',
   description = 'Draws a sphere',
   arguments = {
+    x = {
+      type = 'number',
+      default = '0',
+      description = 'The x coordinate of the center of the sphere.'
+    },
+    y = {
+      type = 'number',
+      default = '0',
+      description = 'The y coordinate of the center of the sphere.'
+    },
+    z = {
+      type = 'number',
+      default = '0',
+      description = 'The z coordinate of the center of the sphere.'
+    },
+    radius = {
+      type = 'number',
+      default = '1',
+      description = 'The radius of the sphere.'
+    },
+    angle = {
+      type = 'number',
+      default = '0',
+      description = 'The rotation of the sphere around its rotation axis, in radians.'
+    },
+    ax = {
+      type = 'number',
+      default = '0',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      default = '1',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      default = '0',
+      description = 'The z component of the axis of rotation.'
+    },
+    position = {
+      type = 'Vec3',
+      description = 'The position of the sphere.'
+    },
+    orientation = {
+      type = 'Quat',
+      description = 'The orientation of the sphere.'
+    },
     transform = {
       type = 'Mat4',
-      description = [[
-        The transform of the sphere.  Can also be provided as a position, radius, and rotation using
-        a mix of `Vectors and numbers.'
-      ]]
+      description = 'The transform of the sphere.'
     },
     longitudes = {
       type = 'number',
@@ -23,6 +68,14 @@ return {
   },
   returns = {},
   variants = {
+    {
+      arguments = { 'x', 'y', 'z', 'radius', 'angle', 'ax', 'ay', 'az', 'longitudes', 'latitudes' },
+      returns = {}
+    },
+    {
+      arguments = { 'position', 'radius', 'orientation', 'longitudes', 'latitudes' },
+      returns = {}
+    },
     {
       arguments = { 'transform', 'longitudes', 'latitudes' },
       returns = {}

+ 70 - 7
api/lovr/graphics/Pass/text.lua

@@ -17,12 +17,57 @@ return {
         of numbers.
       ]]
     },
+    x = {
+      type = 'number',
+      default = '0',
+      description = 'The x coordinate of the text origin.'
+    },
+    y = {
+      type = 'number',
+      default = '0',
+      description = 'The y coordinate of the text origin.'
+    },
+    z = {
+      type = 'number',
+      default = '0',
+      description = 'The z coordinate of the text origin.'
+    },
+    scale = {
+      type = 'number',
+      default = '1',
+      description = 'The scale of the text (with the default pixel density, units are meters).'
+    },
+    angle = {
+      type = 'number',
+      default = '0',
+      description = 'The rotation of the text around its rotation axis, in radians.'
+    },
+    ax = {
+      type = 'number',
+      default = '0',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      default = '1',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      default = '0',
+      description = 'The z component of the axis of rotation.'
+    },
+    position = {
+      type = 'Vec3',
+      description = 'The position of the text.'
+    },
+    orientation = {
+      type = 'Quat',
+      description = 'The orientation of the text.'
+    },
     transform = {
       type = 'Mat4',
-      description = [[
-        The transform of the text.  Can also be provided as position, 1-component scale, and
-        rotation using a mix of `Vectors` or numbers.
-      ]]
+      description = 'The transform of the text.'
     },
     wrap = {
       type = 'number',
@@ -35,22 +80,40 @@ return {
     halign = {
       type = 'HorizontalAlign',
       default = [['center']],
-      description = 'The horizontal alignment.'
+      description = 'The horizontal alignment relative to the text origin.'
     },
     valign = {
       type = 'VerticalAlign',
       default = [['middle']],
-      description = 'The vertical alignment.'
+      description = 'The vertical alignment relative to the text origin.'
     }
   },
   returns = {},
   variants = {
+    {
+      arguments = { 'text', 'x', 'y', 'z', 'scale', 'angle', 'ax', 'ay', 'az', 'wrap', 'halign', 'valign' },
+      returns = {}
+    },
+    {
+      arguments = { 'text', 'position', 'scale', 'orientation', 'wrap', 'halign', 'valign' },
+      returns = {}
+    },
     {
       arguments = { 'text', 'transform', 'wrap', 'halign', 'valign' },
       returns = {}
     },
     {
-      description = 'Renders multicolor text with a single draw call.',
+      description = 'Renders multicolor text.',
+      arguments = { 'colortext', 'x', 'y', 'z', 'scale', 'angle', 'ax', 'ay', 'az', 'wrap', 'halign', 'valign' },
+      returns = {}
+    },
+    {
+      description = 'Renders multicolor text.',
+      arguments = { 'colortext', 'position', 'scale', 'orientation', 'wrap', 'halign', 'valign' },
+      returns = {}
+    },
+    {
+      description = 'Renders multicolor text.',
       arguments = { 'colortext', 'transform', 'wrap', 'halign', 'valign' },
       returns = {}
     }

+ 66 - 6
api/lovr/graphics/Pass/torus.lua

@@ -3,14 +3,66 @@ return {
   summary = 'Draw a donut.',
   description = 'Draws a torus.',
   arguments = {
+    x = {
+      type = 'number',
+      default = '0',
+      description = 'The x coordinate of the center of the torus.'
+    },
+    y = {
+      type = 'number',
+      default = '0',
+      description = 'The y coordinate of the center of the torus.'
+    },
+    z = {
+      type = 'number',
+      default = '0',
+      description = 'The z coordinate of the center of the torus.'
+    },
+    radius = {
+      type = 'number',
+      default = '1',
+      description = 'The radius of the torus.'
+    },
+    thickness = {
+      type = 'number',
+      default = '1',
+      description = 'The thickness of the torus.'
+    },
+    angle = {
+      type = 'number',
+      default = '0',
+      description = 'The rotation of the torus around its rotation axis, in radians.'
+    },
+    ax = {
+      type = 'number',
+      default = '0',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      default = '1',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      default = '0',
+      description = 'The z component of the axis of rotation.'
+    },
+    position = {
+      type = 'Vec3',
+      description = 'The position of the center of the torus.'
+    },
+    scale = {
+      type = 'Vec3',
+      description = 'The size of the torus (x and y scale the radius, z is the thickness).'
+    },
+    orientation = {
+      type = 'Quat',
+      description = 'The orientation of the torus.'
+    },
     transform = {
       type = 'Mat4',
-      description = [[
-        The transform of the torus.  Can also be provided as position, scale, and rotation using a
-        mix of `Vectors` or numbers.  When using numbers for the scale, 2 should be provided: one
-        for the radius and one for the thickness.  When using a matrix or a vector for the scale,
-        the X and Y components are the radius and the Z component is the thickness.
-      ]]
+      description = 'The transform of the torus.'
     },
     tsegments = {
       type = 'number',
@@ -25,6 +77,14 @@ return {
   },
   returns = {},
   variants = {
+    {
+      arguments = { 'x', 'y', 'z', 'radius', 'thickness', 'angle', 'ax', 'ay', 'az', 'tsegments', 'psegments' },
+      returns = {}
+    },
+    {
+      arguments = { 'position', 'scale', 'orientation', 'tsegments', 'psegments' },
+      returns = {}
+    },
     {
       arguments = { 'transform', 'tsegments', 'psegments' },
       returns = {}

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

@@ -45,7 +45,7 @@ return {
     },
     translation = {
       type = 'Vec3',
-      description = 'The translation.'
+      description = 'The translation to apply.'
     },
     scale = {
       type = 'Vec3',

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