Преглед на файлове

Clarify vector object return behavior;

bjorn преди 2 години
родител
ревизия
267b1c37a7
променени са 38 файла, в които са добавени 264 реда и са изтрити 266 реда
  1. 125 125
      api/init.lua
  2. 3 3
      api/lovr/math/Mat4/fov.lua
  3. 3 3
      api/lovr/math/Mat4/identity.lua
  4. 3 3
      api/lovr/math/Mat4/invert.lua
  5. 3 3
      api/lovr/math/Mat4/lookAt.lua
  6. 3 3
      api/lovr/math/Mat4/mul.lua
  7. 4 4
      api/lovr/math/Mat4/orthographic.lua
  8. 3 3
      api/lovr/math/Mat4/perspective.lua
  9. 3 3
      api/lovr/math/Mat4/reflect.lua
  10. 4 4
      api/lovr/math/Mat4/rotate.lua
  11. 4 4
      api/lovr/math/Mat4/scale.lua
  12. 3 3
      api/lovr/math/Mat4/target.lua
  13. 4 4
      api/lovr/math/Mat4/translate.lua
  14. 3 3
      api/lovr/math/Mat4/transpose.lua
  15. 3 3
      api/lovr/math/Quat/conjugate.lua
  16. 4 4
      api/lovr/math/Quat/mul.lua
  17. 4 6
      api/lovr/math/Quat/normalize.lua
  18. 8 8
      api/lovr/math/Quat/set.lua
  19. 3 3
      api/lovr/math/Quat/slerp.lua
  20. 4 4
      api/lovr/math/Vec2/add.lua
  21. 4 4
      api/lovr/math/Vec2/div.lua
  22. 4 4
      api/lovr/math/Vec2/lerp.lua
  23. 4 4
      api/lovr/math/Vec2/mul.lua
  24. 3 3
      api/lovr/math/Vec2/normalize.lua
  25. 4 4
      api/lovr/math/Vec2/sub.lua
  26. 4 4
      api/lovr/math/Vec3/add.lua
  27. 4 4
      api/lovr/math/Vec3/cross.lua
  28. 4 4
      api/lovr/math/Vec3/div.lua
  29. 4 4
      api/lovr/math/Vec3/lerp.lua
  30. 4 4
      api/lovr/math/Vec3/mul.lua
  31. 3 3
      api/lovr/math/Vec3/normalize.lua
  32. 4 4
      api/lovr/math/Vec3/sub.lua
  33. 4 4
      api/lovr/math/Vec4/add.lua
  34. 4 4
      api/lovr/math/Vec4/div.lua
  35. 5 5
      api/lovr/math/Vec4/lerp.lua
  36. 4 4
      api/lovr/math/Vec4/mul.lua
  37. 3 3
      api/lovr/math/Vec4/normalize.lua
  38. 4 4
      api/lovr/math/Vec4/sub.lua

+ 125 - 125
api/init.lua

@@ -22543,9 +22543,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix."
+                      description = "The modified matrix."
                     }
                   }
                 }
@@ -22565,9 +22565,9 @@ return {
                   arguments = {},
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix."
+                      description = "The modified matrix."
                     }
                   }
                 }
@@ -22584,9 +22584,9 @@ return {
                   arguments = {},
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix, with its values inverted."
+                      description = "The inverted matrix."
                     }
                   }
                 }
@@ -22624,9 +22624,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix."
+                      description = "The modified matrix."
                     }
                   }
                 }
@@ -22650,9 +22650,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix, containing the result."
+                      description = "The modified matrix."
                     }
                   }
                 },
@@ -22742,9 +22742,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix."
+                      description = "The modified matrix."
                     }
                   }
                 },
@@ -22773,9 +22773,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix."
+                      description = "The modified matrix."
                     }
                   }
                 }
@@ -22819,9 +22819,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix."
+                      description = "The modified matrix."
                     }
                   }
                 }
@@ -22849,9 +22849,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix, with modified values."
+                      description = "The reflected matrix."
                     }
                   }
                 }
@@ -22879,9 +22879,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix."
+                      description = "The rotated matrix."
                     }
                   }
                 },
@@ -22913,9 +22913,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix."
+                      description = "The rotated matrix."
                     }
                   }
                 }
@@ -22943,9 +22943,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix."
+                      description = "The modified matrix."
                     }
                   }
                 },
@@ -22971,9 +22971,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix."
+                      description = "The modified matrix."
                     }
                   }
                 }
@@ -23241,9 +23241,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix."
+                      description = "The modified matrix."
                     }
                   }
                 }
@@ -23271,9 +23271,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix."
+                      description = "The translated matrix."
                     }
                   }
                 },
@@ -23297,9 +23297,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix."
+                      description = "The translated matrix."
                     }
                   }
                 }
@@ -23316,9 +23316,9 @@ return {
                   arguments = {},
                   returns = {
                     {
-                      name = "m",
+                      name = "self",
                       type = "Mat4",
-                      description = "The original matrix."
+                      description = "The transposed matrix."
                     }
                   }
                 }
@@ -23382,9 +23382,9 @@ return {
                   arguments = {},
                   returns = {
                     {
-                      name = "q",
+                      name = "self",
                       type = "Quat",
-                      description = "The original quaternion."
+                      description = "The inverted quaternion."
                     }
                   }
                 }
@@ -23482,9 +23482,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "q",
+                      name = "self",
                       type = "quat",
-                      description = "The original quaternion."
+                      description = "The modified quaternion."
                     }
                   }
                 },
@@ -23500,7 +23500,7 @@ return {
                     {
                       name = "v3",
                       type = "vec3",
-                      description = "Vector rotated by quaternion."
+                      description = "The rotated vector."
                     }
                   }
                 }
@@ -23518,9 +23518,9 @@ return {
                   arguments = {},
                   returns = {
                     {
-                      name = "q",
+                      name = "self",
                       type = "Quat",
-                      description = "The original quaternion."
+                      description = "The normalized quaternion."
                     }
                   }
                 }
@@ -23574,9 +23574,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "q",
+                      name = "self",
                       type = "quat",
-                      description = "The original quaternion."
+                      description = "The modified quaternion."
                     }
                   }
                 },
@@ -23590,9 +23590,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "q",
+                      name = "self",
                       type = "quat",
-                      description = "The original quaternion."
+                      description = "The modified quaternion."
                     }
                   }
                 },
@@ -23607,9 +23607,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "q",
+                      name = "self",
                       type = "quat",
-                      description = "The original quaternion."
+                      description = "The modified quaternion."
                     }
                   }
                 },
@@ -23629,9 +23629,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "q",
+                      name = "self",
                       type = "quat",
-                      description = "The original quaternion."
+                      description = "The modified quaternion."
                     }
                   }
                 },
@@ -23645,9 +23645,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "q",
+                      name = "self",
                       type = "quat",
-                      description = "The original quaternion."
+                      description = "The modified quaternion."
                     }
                   }
                 },
@@ -23656,9 +23656,9 @@ return {
                   arguments = {},
                   returns = {
                     {
-                      name = "q",
+                      name = "self",
                       type = "quat",
-                      description = "The original quaternion."
+                      description = "The modified quaternion."
                     }
                   }
                 }
@@ -23689,9 +23689,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "q",
+                      name = "self",
                       type = "Quat",
-                      description = "The original quaternion, containing the new lerped values."
+                      description = "The modified quaternion, containing the new lerped values."
                     }
                   }
                 }
@@ -23995,9 +23995,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec2",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 },
@@ -24017,9 +24017,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec2",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 }
@@ -24148,9 +24148,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec2",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 },
@@ -24170,9 +24170,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec2",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 }
@@ -24327,9 +24327,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec2",
-                      description = "The original vector, containing the new lerped values."
+                      description = "The interpolated vector."
                     }
                   }
                 },
@@ -24353,9 +24353,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec2",
-                      description = "The original vector, containing the new lerped values."
+                      description = "The interpolated vector."
                     }
                   }
                 }
@@ -24383,9 +24383,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec2",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 },
@@ -24405,9 +24405,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec2",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 }
@@ -24427,9 +24427,9 @@ return {
                   arguments = {},
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec2",
-                      description = "The original vector."
+                      description = "The normalized vector."
                     }
                   }
                 }
@@ -24508,9 +24508,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec2",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 },
@@ -24530,9 +24530,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec2",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 }
@@ -24605,9 +24605,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec3",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 },
@@ -24633,9 +24633,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec3",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 }
@@ -24715,9 +24715,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec3",
-                      description = "The original vector, with the cross product as its values."
+                      description = "The modified vector."
                     }
                   }
                 },
@@ -24741,9 +24741,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec3",
-                      description = "The original vector, with the cross product as its values."
+                      description = "The modified vector."
                     }
                   }
                 }
@@ -24829,9 +24829,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec3",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 },
@@ -24857,9 +24857,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec3",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 }
@@ -25027,9 +25027,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec3",
-                      description = "The original vector, containing the new lerped values."
+                      description = "The interpolated vector."
                     }
                   }
                 },
@@ -25058,9 +25058,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec3",
-                      description = "The original vector, containing the new lerped values."
+                      description = "The interpolated vector."
                     }
                   }
                 }
@@ -25088,9 +25088,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec3",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 },
@@ -25116,9 +25116,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec3",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 }
@@ -25138,9 +25138,9 @@ return {
                   arguments = {},
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec3",
-                      description = "The original vector."
+                      description = "The normalized vector."
                     }
                   }
                 }
@@ -25241,9 +25241,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec3",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 },
@@ -25269,9 +25269,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec3",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 }
@@ -25349,9 +25349,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec4",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 },
@@ -25383,9 +25383,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec4",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 }
@@ -25534,9 +25534,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec4",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 },
@@ -25568,9 +25568,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec4",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 }
@@ -25745,9 +25745,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec4",
-                      description = "The original vector, containing the new lerped values."
+                      description = "The interpolated vector."
                     }
                   }
                 },
@@ -25781,9 +25781,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec4",
-                      description = "The original vector, containing the new lerped values."
+                      description = "The interpolated vector."
                     }
                   }
                 }
@@ -25811,9 +25811,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec4",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 },
@@ -25845,9 +25845,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec4",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 }
@@ -25867,9 +25867,9 @@ return {
                   arguments = {},
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec4",
-                      description = "The original vector."
+                      description = "The normalized vector."
                     }
                   }
                 }
@@ -25960,9 +25960,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec4",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 },
@@ -25994,9 +25994,9 @@ return {
                   },
                   returns = {
                     {
-                      name = "v",
+                      name = "self",
                       type = "Vec4",
-                      description = "The original vector."
+                      description = "The modified vector."
                     }
                   }
                 }

+ 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 = {

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

@@ -15,15 +15,15 @@ return {
     }
   },
   returns = {
-    m = {
+    self = {
       type = 'Mat4',
-      description = 'The original matrix, with modified values.'
+      description = 'The reflected matrix.'
     }
   },
   variants = {
     {
       arguments = { 'position', 'normal' },
-      returns = { 'm' }
+      returns = { 'self' }
     }
   }
 }

+ 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 = {