Browse Source

Add note about extending vector objects;

bjorn 6 years ago
parent
commit
188f6c1244
4 changed files with 21 additions and 5 deletions
  1. 3 3
      api/init.lua
  2. 7 1
      api/lovr/math/mat4.lua
  3. 4 0
      api/lovr/math/quat.lua
  4. 7 1
      api/lovr/math/vec3.lua

+ 3 - 3
api/init.lua

@@ -14534,7 +14534,7 @@ return {
         {
           name = "quat",
           summary = "Create a new `quat`.",
-          description = "Creates a new `quat`.  Have a look at `quat:set` for more information about how all these variants can be used.",
+          description = "Creates a new `quat`.  Have a look at `quat:set` for more information about how all these variants can be used.\n\nNote that this function is also a table containing the `__index` key of the quat metatable. This means that you can add your own functions onto the `lovr.math.quat` table to extend the built-in functionality.",
           key = "lovr.math.quat",
           module = "lovr.math",
           variants = {
@@ -15177,7 +15177,7 @@ return {
         {
           name = "mat4",
           summary = "Create a new `mat4`.",
-          description = "Creates a new `mat4`.",
+          description = "Creates a new `mat4`.\n\nNote that this function is also a table containing the `__index` key of the mat4 metatable. This means that you can add your own functions onto the `lovr.math.mat4` table to extend the built-in functionality.",
           key = "mat4",
           module = "lovr.math",
           related = {
@@ -15743,7 +15743,7 @@ return {
         {
           name = "vec3",
           summary = "Create a new `vec3`.",
-          description = "Creates a new `vec3`.",
+          description = "Creates a new `vec3`.\n\nNote that this function is also a table containing the `__index` key of the vec3 metatable. This means that you can add your own functions onto the `lovr.math.vec3` table to extend the built-in functionality.",
           key = "vec3",
           module = "lovr.math",
           related = {

+ 7 - 1
api/lovr/math/mat4.lua

@@ -1,6 +1,12 @@
 return {
   summary = 'Create a new `mat4`.',
-  description = 'Creates a new `mat4`.',
+  description = [[
+    Creates a new `mat4`.
+
+    Note that this function is also a table containing the `__index` key of the mat4 metatable.
+    This means that you can add your own functions onto the `lovr.math.mat4` table to extend the
+    built-in functionality.
+  ]],
   arguments = {
     n = {
       type = 'mat4',

+ 4 - 0
api/lovr/math/quat.lua

@@ -3,6 +3,10 @@ return {
   description = [[
     Creates a new `quat`.  Have a look at `quat:set` for more information about how all these
     variants can be used.
+
+    Note that this function is also a table containing the `__index` key of the quat metatable.
+    This means that you can add your own functions onto the `lovr.math.quat` table to extend the
+    built-in functionality.
   ]],
   arguments = {
     angle = {

+ 7 - 1
api/lovr/math/vec3.lua

@@ -1,6 +1,12 @@
 return {
   summary = 'Create a new `vec3`.',
-  description = 'Creates a new `vec3`.',
+  description = [[
+    Creates a new `vec3`.
+
+    Note that this function is also a table containing the `__index` key of the vec3 metatable.
+    This means that you can add your own functions onto the `lovr.math.vec3` table to extend the
+    built-in functionality.
+  ]],
   arguments = {
     x = {
       type = 'number',