Browse Source

Fix mat4:scale;

bjorn 6 years ago
parent
commit
dffb780a2b
2 changed files with 30 additions and 8 deletions
  1. 18 5
      api/init.lua
  2. 12 3
      api/lovr/math/mat4/scale.lua

+ 18 - 5
api/init.lua

@@ -17370,11 +17370,8 @@ return {
               variants = {
               variants = {
                 {
                 {
                   arguments = {
                   arguments = {
-                    x = {
-                      type = "number",
-                      description = "A uniform scale to apply."
-                    },
-                    scale = {
+                    {
+                      name = "scale",
                       type = "vec3",
                       type = "vec3",
                       description = "The 3D scale to apply."
                       description = "The 3D scale to apply."
                     }
                     }
@@ -17386,6 +17383,22 @@ return {
                       description = "The original matrix."
                       description = "The original matrix."
                     }
                     }
                   }
                   }
+                },
+                {
+                  arguments = {
+                    {
+                      name = "s",
+                      type = "number",
+                      description = "A uniform scale to apply."
+                    }
+                  },
+                  returns = {
+                    {
+                      name = "m",
+                      type = "mat4",
+                      description = "The original matrix."
+                    }
+                  }
                 }
                 }
               }
               }
             },
             },

+ 12 - 3
api/lovr/math/mat4/scale.lua

@@ -6,18 +6,27 @@ return {
       type = 'vec3',
       type = 'vec3',
       description = 'The 3D scale to apply.'
       description = 'The 3D scale to apply.'
     },
     },
-    x = {
+    s = {
       type = 'number',
       type = 'number',
       description = 'A uniform scale to apply.'
       description = 'A uniform scale to apply.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'm',
+    m = {
       type = 'mat4',
       type = 'mat4',
       description = 'The original matrix.'
       description = 'The original matrix.'
     }
     }
   },
   },
+  variants = {
+    {
+      arguments = { 'scale' },
+      returns = { 'm' }
+    },
+    {
+      arguments = { 's' },
+      returns = { 'm' }
+    }
+  },
   related = {
   related = {
     'mat4:translate',
     'mat4:translate',
     'mat4:rotate',
     'mat4:rotate',