Browse Source

Clarify vector object return behavior;

bjorn 2 years ago
parent
commit
3dd2a9d478

File diff suppressed because it is too large
+ 123 - 330
api/init.lua


+ 3 - 3
api/lovr/math/Mat4/fov.lua

@@ -36,15 +36,15 @@ return {
     }
   },
   returns = {
-    m = {
+    self = {
       type = 'Mat4',
-      description = 'The original matrix.'
+      description = 'The modified matrix.'
     }
   },
   variants = {
     {
       arguments = { 'left', 'right', 'up', 'down', 'near', 'far' },
-      returns = { 'm' }
+      returns = { 'self' }
     }
   },
   related = {

+ 3 - 3
api/lovr/math/Mat4/identity.lua

@@ -6,15 +6,15 @@ return {
   ]],
   arguments = {},
   returns = {
-    m = {
+    self = {
       type = 'Mat4',
-      description = 'The original matrix.'
+      description = 'The modified matrix.'
     }
   },
   variants = {
     {
       arguments = {},
-      returns = { 'm' }
+      returns = { 'self' }
     }
   },
   related = {

+ 3 - 3
api/lovr/math/Mat4/invert.lua

@@ -3,15 +3,15 @@ return {
   description = 'Inverts the matrix, causing it to represent the opposite of its old transform.',
   arguments = {},
   returns = {
-    m = {
+    self = {
       type = 'Mat4',
-      description = 'The original matrix, with its values inverted.'
+      description = 'The inverted matrix.'
     }
   },
   variants = {
     {
       arguments = {},
-      returns = { 'm' }
+      returns = { 'self' }
     }
   }
 }

+ 3 - 3
api/lovr/math/Mat4/lookAt.lua

@@ -24,15 +24,15 @@ return {
     }
   },
   returns = {
-    m = {
+    self = {
       type = 'Mat4',
-      description = 'The original matrix.'
+      description = 'The modified matrix.'
     }
   },
   variants = {
     {
       arguments = { 'from', 'to', 'up' },
-      returns = { 'm' }
+      returns = { 'self' }
     }
   },
   related = {

+ 3 - 3
api/lovr/math/Mat4/mul.lua

@@ -20,9 +20,9 @@ return {
     }
   },
   returns = {
-    m = {
+    self = {
       type = 'Mat4',
-      description = 'The original matrix, containing the result.'
+      description = 'The modified matrix.'
     },
     v3 = {
       type = 'Vec3',
@@ -36,7 +36,7 @@ return {
   variants = {
     {
       arguments = { 'n' },
-      returns = { 'm' }
+      returns = { 'self' }
     },
     {
       arguments = { 'v3' },

+ 4 - 4
api/lovr/math/Mat4/orthographic.lua

@@ -41,19 +41,19 @@ return {
     }
   },
   returns = {
-    m = {
+    self = {
       type = 'Mat4',
-      description = 'The original matrix.'
+      description = 'The modified matrix.'
     }
   },
   variants = {
     {
       arguments = { 'left', 'right', 'bottom', 'top', 'near', 'far' },
-      returns = { 'm' }
+      returns = { 'self' }
     },
     {
       arguments = { 'width', 'height', 'near', 'far' },
-      returns = { 'm' }
+      returns = { 'self' }
     }
   },
   related = {

+ 3 - 3
api/lovr/math/Mat4/perspective.lua

@@ -29,15 +29,15 @@ return {
     },
   },
   returns = {
-    m = {
+    self = {
       type = 'Mat4',
-      description = 'The original matrix.'
+      description = 'The modified matrix.'
     }
   },
   variants = {
     {
       arguments = { 'fov', 'aspect', 'near', 'far' },
-      returns = { 'm' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Mat4/rotate.lua

@@ -27,19 +27,19 @@ return {
     }
   },
   returns = {
-    m = {
+    self = {
       type = 'Mat4',
-      description = 'The original matrix.'
+      description = 'The rotated matrix.'
     }
   },
   variants = {
     {
       arguments = { 'q' },
-      returns = { 'm' }
+      returns = { 'self' }
     },
     {
       arguments = { 'angle', 'ax', 'ay', 'az' },
-      returns = { 'm' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Mat4/scale.lua

@@ -22,19 +22,19 @@ return {
     }
   },
   returns = {
-    m = {
+    self = {
       type = 'Mat4',
-      description = 'The original matrix.'
+      description = 'The modified matrix.'
     }
   },
   variants = {
     {
       arguments = { 'scale' },
-      returns = { 'm' }
+      returns = { 'self' }
     },
     {
       arguments = { 'sx', 'sy', 'sz' },
-      returns = { 'm' }
+      returns = { 'self' }
     }
   },
   related = {

+ 3 - 3
api/lovr/math/Mat4/target.lua

@@ -24,15 +24,15 @@ return {
     }
   },
   returns = {
-    m = {
+    self = {
       type = 'Mat4',
-      description = 'The original matrix.'
+      description = 'The modified matrix.'
     }
   },
   variants = {
     {
       arguments = { 'from', 'to', 'up' },
-      returns = { 'm' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Mat4/translate.lua

@@ -20,19 +20,19 @@ return {
     }
   },
   returns = {
-    m = {
+    self = {
       type = 'Mat4',
-      description = 'The original matrix.'
+      description = 'The translated matrix.'
     }
   },
   variants = {
     {
       arguments = { 'v' },
-      returns = { 'm' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y', 'z' },
-      returns = { 'm' }
+      returns = { 'self' }
     }
   },
   related = {

+ 3 - 3
api/lovr/math/Mat4/transpose.lua

@@ -3,15 +3,15 @@ return {
   description = 'Transposes the matrix, mirroring its values along the diagonal.',
   arguments = {},
   returns = {
-    m = {
+    self = {
       type = 'Mat4',
-      description = 'The original matrix.'
+      description = 'The transposed matrix.'
     }
   },
   variants = {
     {
       arguments = {},
-      returns = { 'm' }
+      returns = { 'self' }
     }
   }
 }

+ 3 - 3
api/lovr/math/Quat/conjugate.lua

@@ -6,15 +6,15 @@ return {
   ]],
   arguments = {},
   returns = {
-    q = {
+    self = {
       type = 'Quat',
-      description = 'The original quaternion.'
+      description = 'The inverted quaternion.'
     }
   },
   variants = {
     {
       arguments = {},
-      returns = { 'q' }
+      returns = { 'self' }
     }
   }
 }

+ 4 - 4
api/lovr/math/Quat/mul.lua

@@ -16,19 +16,19 @@ return {
     }
   },
   returns = {
-    q = {
+    self = {
       type = 'quat',
-      description = 'The original quaternion.'
+      description = 'The modified quaternion.'
     },
     v3 = {
       type = 'vec3',
-      description = 'Vector rotated by quaternion.'
+      description = 'The rotated vector.'
     }
   },
   variants = {
     {
       arguments = { 'r' },
-      returns = { 'q' }
+      returns = { 'self' }
     },
     {
       arguments = { 'v3' },

+ 4 - 6
api/lovr/math/Quat/normalize.lua

@@ -1,19 +1,17 @@
 return {
   summary = 'Normalize the length of the quaternion to 1.',
-  description = [[
-    Adjusts the values in the quaternion so that its length becomes 1.
-  ]],
+  description = 'Adjusts the values in the quaternion so that its length becomes 1.',
   arguments = {},
   returns = {
-    q = {
+    self = {
       type = 'Quat',
-      description = 'The original quaternion.'
+      description = 'The normalized quaternion.'
     }
   },
   variants = {
     {
       arguments = {},
-      returns = { 'q' }
+      returns = { 'self' }
     }
   },
   notes = [[

+ 8 - 8
api/lovr/math/Quat/set.lua

@@ -57,38 +57,38 @@ return {
     }
   },
   returns = {
-    q = {
+    self = {
       type = 'quat',
-      description = 'The original quaternion.'
+      description = 'The modified quaternion.'
     }
   },
   variants = {
     {
       arguments = { 'angle', 'ax', 'ay', 'az', 'raw' },
-      returns = { 'q' }
+      returns = { 'self' }
     },
     {
       arguments = { 'r' },
-      returns = { 'q' }
+      returns = { 'self' }
     },
     {
       description = 'Sets the values from a direction vector.',
       arguments = { 'v' },
-      returns = { 'q' }
+      returns = { 'self' }
     },
     {
       description = 'Sets the values to represent the rotation between two vectors.',
       arguments = { 'v', 'u' },
-      returns = { 'q' }
+      returns = { 'self' }
     },
     {
       arguments = { 'm' },
-      returns = { 'q' }
+      returns = { 'self' }
     },
     {
       description = 'Reset the quaternion to the identity (0, 0, 0, 1).',
       arguments = {},
-      returns = { 'q' }
+      returns = { 'self' }
     }
   },
   related = {

+ 3 - 3
api/lovr/math/Quat/slerp.lua

@@ -20,15 +20,15 @@ return {
     }
   },
   returns = {
-    q = {
+    self = {
       type = 'Quat',
-      description = 'The original quaternion, containing the new lerped values.'
+      description = 'The modified quaternion, containing the new lerped values.'
     }
   },
   variants = {
     {
       arguments = { 'r', 't' },
-      returns = { 'q' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Vec2/add.lua

@@ -17,19 +17,19 @@ return {
     }
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec2',
-      description = 'The original vector.'
+      description = 'The modified vector.'
     }
   },
   variants = {
     {
       arguments = { 'u' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Vec2/div.lua

@@ -17,19 +17,19 @@ return {
     }
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec2',
-      description = 'The original vector.'
+      description = 'The modified vector.'
     }
   },
   variants = {
     {
       arguments = { 'u' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Vec2/lerp.lua

@@ -25,19 +25,19 @@ return {
     }
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec2',
-      description = 'The original vector, containing the new lerped values.'
+      description = 'The interpolated vector.'
     }
   },
   variants = {
     {
       arguments = { 'u', 't' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y', 't' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Vec2/mul.lua

@@ -17,19 +17,19 @@ return {
     }
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec2',
-      description = 'The original vector.'
+      description = 'The modified vector.'
     }
   },
   variants = {
     {
       arguments = { 'u' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 3 - 3
api/lovr/math/Vec2/normalize.lua

@@ -5,15 +5,15 @@ return {
   ]],
   arguments = {},
   returns = {
-    v = {
+    self = {
       type = 'Vec2',
-      description = 'The original vector.'
+      description = 'The normalized vector.'
     }
   },
   variants = {
     {
       arguments = {},
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Vec2/sub.lua

@@ -17,19 +17,19 @@ return {
     },
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec2',
-      description = 'The original vector.'
+      description = 'The modified vector.'
     }
   },
   variants = {
     {
       arguments = { 'u' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Vec3/add.lua

@@ -22,19 +22,19 @@ return {
     }
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec3',
-      description = 'The original vector.'
+      description = 'The modified vector.'
     }
   },
   variants = {
     {
       arguments = { 'u' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y', 'z' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Vec3/cross.lua

@@ -23,19 +23,19 @@ return {
     }
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec3',
-      description = 'The original vector, with the cross product as its values.'
+      description = 'The modified vector.'
     }
   },
   variants = {
     {
       arguments = { 'u' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y', 'z' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   notes = 'The vectors are not normalized before or after computing the cross product.',

+ 4 - 4
api/lovr/math/Vec3/div.lua

@@ -22,19 +22,19 @@ return {
     }
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec3',
-      description = 'The original vector.'
+      description = 'The modified vector.'
     }
   },
   variants = {
     {
       arguments = { 'u' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y', 'z' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Vec3/lerp.lua

@@ -29,19 +29,19 @@ return {
     }
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec3',
-      description = 'The original vector, containing the new lerped values.'
+      description = 'The interpolated vector.'
     }
   },
   variants = {
     {
       arguments = { 'u', 't' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y', 'z', 't' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Vec3/mul.lua

@@ -22,19 +22,19 @@ return {
     }
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec3',
-      description = 'The original vector.'
+      description = 'The modified vector.'
     }
   },
   variants = {
     {
       arguments = { 'u' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y', 'z' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 3 - 3
api/lovr/math/Vec3/normalize.lua

@@ -5,15 +5,15 @@ return {
   ]],
   arguments = {},
   returns = {
-    v = {
+    self = {
       type = 'Vec3',
-      description = 'The original vector.'
+      description = 'The normalized vector.'
     }
   },
   variants = {
     {
       arguments = {},
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Vec3/sub.lua

@@ -22,19 +22,19 @@ return {
     }
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec3',
-      description = 'The original vector.'
+      description = 'The modified vector.'
     }
   },
   variants = {
     {
       arguments = { 'u' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y', 'z' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Vec4/add.lua

@@ -27,19 +27,19 @@ return {
     }
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec4',
-      description = 'The original vector.'
+      description = 'The modified vector.'
     }
   },
   variants = {
     {
       arguments = { 'u' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y', 'z', 'w' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Vec4/div.lua

@@ -27,19 +27,19 @@ return {
     }
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec4',
-      description = 'The original vector.'
+      description = 'The modified vector.'
     }
   },
   variants = {
     {
       arguments = { 'u' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y', 'z', 'w' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 5 - 5
api/lovr/math/Vec4/lerp.lua

@@ -26,26 +26,26 @@ return {
     w = {
       type = 'number',
       description = 'A value of w component to lerp towards.'
-    },    
+    },
     t = {
       type = 'number',
       description = 'The lerping parameter.'
     }
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec4',
-      description = 'The original vector, containing the new lerped values.'
+      description = 'The interpolated vector.'
     }
   },
   variants = {
     {
       arguments = { 'u', 't' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y', 'z', 'w', 't' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Vec4/mul.lua

@@ -27,19 +27,19 @@ return {
     }
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec4',
-      description = 'The original vector.'
+      description = 'The modified vector.'
     }
   },
   variants = {
     {
       arguments = { 'u' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y', 'z', 'w' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 3 - 3
api/lovr/math/Vec4/normalize.lua

@@ -5,15 +5,15 @@ return {
   ]],
   arguments = {},
   returns = {
-    v = {
+    self = {
       type = 'Vec4',
-      description = 'The original vector.'
+      description = 'The normalized vector.'
     }
   },
   variants = {
     {
       arguments = {},
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

+ 4 - 4
api/lovr/math/Vec4/sub.lua

@@ -27,19 +27,19 @@ return {
     }
   },
   returns = {
-    v = {
+    self = {
       type = 'Vec4',
-      description = 'The original vector.'
+      description = 'The modified vector.'
     }
   },
   variants = {
     {
       arguments = { 'u' },
-      returns = { 'v' }
+      returns = { 'self' }
     },
     {
       arguments = { 'x', 'y', 'z', 'w' },
-      returns = { 'v' }
+      returns = { 'self' }
     }
   },
   related = {

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