Explorar o código

Fix getAnimationDuration;

bjorn %!s(int64=3) %!d(string=hai) anos
pai
achega
6d5fb88997
Modificáronse 2 ficheiros con 53 adicións e 432 borrados
  1. 43 432
      api/init.lua
  2. 10 0
      api/lovr/graphics/Model/getAnimationDuration.lua

+ 43 - 432
api/init.lua

@@ -6465,17 +6465,31 @@ return {
               variants = {
                 {
                   arguments = {
-                    name = {
+                    {
+                      name = "name",
                       type = "string",
                       description = "The name of the animation."
-                    },
-                    index = {
+                    }
+                  },
+                  returns = {
+                    {
+                      name = "duration",
+                      type = "number",
+                      description = "The duration of the animation, in seconds."
+                    }
+                  }
+                },
+                {
+                  arguments = {
+                    {
+                      name = "index",
                       type = "number",
                       description = "The animation index."
                     }
                   },
                   returns = {
-                    duration = {
+                    {
+                      name = "duration",
                       type = "number",
                       description = "The duration of the animation, in seconds."
                     }
@@ -16999,13 +17013,7 @@ return {
                     {
                       name = "x",
                       type = "number",
-                      description = "A value to add to x component."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value to add to y component.",
-                      default = "x"
+                      description = "A number to add to each component."
                     }
                   },
                   returns = {
@@ -17043,27 +17051,6 @@ return {
                       description = "The distance to `u`."
                     }
                   }
-                },
-                {
-                  arguments = {
-                    {
-                      name = "x",
-                      type = "number",
-                      description = "A value of x component to measure distance to."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value of y component to measure distance to."
-                    }
-                  },
-                  returns = {
-                    {
-                      name = "distance",
-                      type = "number",
-                      description = "The distance to `u`."
-                    }
-                  }
                 }
               }
             },
@@ -17100,13 +17087,7 @@ return {
                     {
                       name = "x",
                       type = "number",
-                      description = "A value to divide x component by."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value to divide y component by.",
-                      default = "x"
+                      description = "The number to divide each component by."
                     }
                   },
                   returns = {
@@ -17125,7 +17106,7 @@ return {
               description = "Returns the dot product between this vector and another one.",
               key = "Vec2:dot",
               module = "lovr.math",
-              notes = "This is computed as:\n\n    dot = v.x * u.x + v.y * u.y\n\nThe vectors are not normalized before computing the dot product.",
+              notes = "This is computed as:\n\n    dot = v.x * u.x + v.y * u.y + v.z * u.z\n\nThe vectors are not normalized before computing the dot product.",
               variants = {
                 {
                   arguments = {
@@ -17142,27 +17123,6 @@ return {
                       description = "The dot product between `v` and `u`."
                     }
                   }
-                },
-                {
-                  arguments = {
-                    {
-                      name = "x",
-                      type = "number",
-                      description = "A value of x component to compute the dot product with."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value of y component to compute the dot product with."
-                    }
-                  },
-                  returns = {
-                    {
-                      name = "dot",
-                      type = "number",
-                      description = "The dot product between `v` and `u`."
-                    }
-                  }
                 }
               }
             },
@@ -17200,27 +17160,17 @@ return {
                 "Quat:slerp"
               },
               variants = {
-                {
-                  arguments = {},
-                  returns = {
-                    {
-                      name = "v",
-                      type = "Vec2",
-                      description = "The original vector, containing the new lerped values."
-                    }
-                  }
-                },
                 {
                   arguments = {
                     {
-                      name = "x",
-                      type = "number",
-                      description = "A value of x component to lerp towards."
+                      name = "u",
+                      type = "Vec2",
+                      description = "The vector to lerp towards."
                     },
                     {
-                      name = "y",
+                      name = "t",
                       type = "number",
-                      description = "A value of y component to lerp towards."
+                      description = "The lerping parameter."
                     }
                   },
                   returns = {
@@ -17266,13 +17216,7 @@ return {
                     {
                       name = "x",
                       type = "number",
-                      description = "A value to multiply x component by."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value to multiply y component by.",
-                      default = "x"
+                      description = "The number to multiply each component by."
                     }
                   },
                   returns = {
@@ -17391,13 +17335,7 @@ return {
                     {
                       name = "x",
                       type = "number",
-                      description = "A value to subtract from x component."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value to subtract from y component.",
-                      default = "x"
+                      description = "A number to subtract from each component."
                     }
                   },
                   returns = {
@@ -17487,19 +17425,7 @@ return {
                     {
                       name = "x",
                       type = "number",
-                      description = "A value to add to x component."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value to add to y component.",
-                      default = "x"
-                    },
-                    {
-                      name = "z",
-                      type = "number",
-                      description = "A value to add to z component.",
-                      default = "x"
+                      description = "A number to add to each component."
                     }
                   },
                   returns = {
@@ -17535,32 +17461,6 @@ return {
                       description = "The original vector, with the cross product as its values."
                     }
                   }
-                },
-                {
-                  arguments = {
-                    {
-                      name = "x",
-                      type = "number",
-                      description = "A value of x component to compute cross product with."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value of y component to compute cross product with."
-                    },
-                    {
-                      name = "z",
-                      type = "number",
-                      description = "A value of z component to compute cross product with."
-                    }
-                  },
-                  returns = {
-                    {
-                      name = "v",
-                      type = "Vec3",
-                      description = "The original vector, with the cross product as its values."
-                    }
-                  }
                 }
               },
               related = {
@@ -17592,32 +17492,6 @@ return {
                       description = "The distance to `u`."
                     }
                   }
-                },
-                {
-                  arguments = {
-                    {
-                      name = "x",
-                      type = "number",
-                      description = "A value of x component to measure distance to."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value of y component to measure distance to."
-                    },
-                    {
-                      name = "z",
-                      type = "number",
-                      description = "A value of z component to measure distance to."
-                    }
-                  },
-                  returns = {
-                    {
-                      name = "distance",
-                      type = "number",
-                      description = "The distance to `u`."
-                    }
-                  }
                 }
               }
             },
@@ -17654,19 +17528,7 @@ return {
                     {
                       name = "x",
                       type = "number",
-                      description = "A value to divide x component by."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value to divide y component by.",
-                      default = "x"
-                    },
-                    {
-                      name = "z",
-                      type = "number",
-                      description = "A value to divide z component by.",
-                      default = "x"
+                      description = "The number to divide each component by."
                     }
                   },
                   returns = {
@@ -17702,32 +17564,6 @@ return {
                       description = "The dot product between `v` and `u`."
                     }
                   }
-                },
-                {
-                  arguments = {
-                    {
-                      name = "x",
-                      type = "number",
-                      description = "A value of x component to compute the dot product with."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value of y component to compute the dot product with."
-                    },
-                    {
-                      name = "z",
-                      type = "number",
-                      description = "A value of z component to compute the dot product with."
-                    }
-                  },
-                  returns = {
-                    {
-                      name = "dot",
-                      type = "number",
-                      description = "The dot product between `v` and `u`."
-                    }
-                  }
                 }
               },
               related = {
@@ -17788,37 +17624,6 @@ return {
                       description = "The original vector, containing the new lerped values."
                     }
                   }
-                },
-                {
-                  arguments = {
-                    {
-                      name = "x",
-                      type = "number",
-                      description = "A value of x component to lerp towards."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value of y component to lerp towards."
-                    },
-                    {
-                      name = "z",
-                      type = "number",
-                      description = "A value of z component to lerp towards."
-                    },
-                    {
-                      name = "t",
-                      type = "number",
-                      description = "The lerping parameter."
-                    }
-                  },
-                  returns = {
-                    {
-                      name = "v",
-                      type = "Vec3",
-                      description = "The original vector, containing the new lerped values."
-                    }
-                  }
                 }
               }
             },
@@ -17855,19 +17660,7 @@ return {
                     {
                       name = "x",
                       type = "number",
-                      description = "A value to multiply x component by."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value to multiply y component by.",
-                      default = "x"
-                    },
-                    {
-                      name = "z",
-                      type = "number",
-                      description = "A value to multiply z component by.",
-                      default = "x"
+                      description = "The number to multiply each component by."
                     }
                   },
                   returns = {
@@ -18008,19 +17801,7 @@ return {
                     {
                       name = "x",
                       type = "number",
-                      description = "A value to subtract from x component."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value to subtract from y component.",
-                      default = "x"
-                    },
-                    {
-                      name = "z",
-                      type = "number",
-                      description = "A value to subtract from z component.",
-                      default = "x"
+                      description = "A number to subtract from each component."
                     }
                   },
                   returns = {
@@ -18115,25 +17896,7 @@ return {
                     {
                       name = "x",
                       type = "number",
-                      description = "A value to add to x component."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value to add to y component.",
-                      default = "x"
-                    },
-                    {
-                      name = "z",
-                      type = "number",
-                      description = "A value to add to z component.",
-                      default = "x"
-                    },
-                    {
-                      name = "w",
-                      type = "number",
-                      description = "A value to add to w component.",
-                      default = "x"
+                      description = "A number to add to each component."
                     }
                   },
                   returns = {
@@ -18171,37 +17934,6 @@ return {
                       description = "The distance to `u`."
                     }
                   }
-                },
-                {
-                  arguments = {
-                    {
-                      name = "x",
-                      type = "number",
-                      description = "A value of x component to measure distance to."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value of y component to measure distance to."
-                    },
-                    {
-                      name = "z",
-                      type = "number",
-                      description = "A value of z component to measure distance to."
-                    },
-                    {
-                      name = "w",
-                      type = "number",
-                      description = "A value of w component to measure distance to."
-                    }
-                  },
-                  returns = {
-                    {
-                      name = "distance",
-                      type = "number",
-                      description = "The distance to `u`."
-                    }
-                  }
                 }
               }
             },
@@ -18238,25 +17970,7 @@ return {
                     {
                       name = "x",
                       type = "number",
-                      description = "A value to divide x component by."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value to divide y component by.",
-                      default = "x"
-                    },
-                    {
-                      name = "z",
-                      type = "number",
-                      description = "A value to divide z component by.",
-                      default = "x"
-                    },
-                    {
-                      name = "w",
-                      type = "number",
-                      description = "A value to divide w component by.",
-                      default = "x"
+                      description = "The number to divide each component by."
                     }
                   },
                   returns = {
@@ -18292,37 +18006,6 @@ return {
                       description = "The dot product between `v` and `u`."
                     }
                   }
-                },
-                {
-                  arguments = {
-                    {
-                      name = "x",
-                      type = "number",
-                      description = "A value of x component to compute the dot product with."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value of y component to compute the dot product with."
-                    },
-                    {
-                      name = "z",
-                      type = "number",
-                      description = "A value of z component to compute the dot product with."
-                    },
-                    {
-                      name = "w",
-                      type = "number",
-                      description = "A value of w component to compute the dot product with."
-                    }
-                  },
-                  returns = {
-                    {
-                      name = "dot",
-                      type = "number",
-                      description = "The dot product between `v` and `u`."
-                    }
-                  }
                 }
               }
             },
@@ -18380,42 +18063,6 @@ return {
                       description = "The original vector, containing the new lerped values."
                     }
                   }
-                },
-                {
-                  arguments = {
-                    {
-                      name = "x",
-                      type = "number",
-                      description = "A value of x component to lerp towards."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value of y component to lerp towards."
-                    },
-                    {
-                      name = "z",
-                      type = "number",
-                      description = "A value of z component to lerp towards."
-                    },
-                    {
-                      name = "w",
-                      type = "number",
-                      description = "A value of w component to lerp towards."
-                    },
-                    {
-                      name = "t",
-                      type = "number",
-                      description = "The lerping parameter."
-                    }
-                  },
-                  returns = {
-                    {
-                      name = "v",
-                      type = "Vec4",
-                      description = "The original vector, containing the new lerped values."
-                    }
-                  }
                 }
               }
             },
@@ -18452,25 +18099,7 @@ return {
                     {
                       name = "x",
                       type = "number",
-                      description = "A value to multiply x component by."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value to multiply y component by.",
-                      default = "x"
-                    },
-                    {
-                      name = "z",
-                      type = "number",
-                      description = "A value to multiply z component by.",
-                      default = "x"
-                    },
-                    {
-                      name = "w",
-                      type = "number",
-                      description = "A value to multiply w component by.",
-                      default = "x"
+                      description = "The number to multiply each component by."
                     }
                   },
                   returns = {
@@ -18575,23 +18204,23 @@ return {
               key = "Vec4:sub",
               module = "lovr.math",
               related = {
-                "Vec4:add",
-                "Vec4:mul",
-                "Vec4:div"
+                "Vec2:add",
+                "Vec2:mul",
+                "Vec2:div"
               },
               variants = {
                 {
                   arguments = {
                     {
                       name = "u",
-                      type = "Vec4",
+                      type = "Vec2",
                       description = "The other vector."
                     }
                   },
                   returns = {
                     {
                       name = "v",
-                      type = "Vec4",
+                      type = "Vec2",
                       description = "The original vector."
                     }
                   }
@@ -18601,31 +18230,13 @@ return {
                     {
                       name = "x",
                       type = "number",
-                      description = "A value to subtract from x component."
-                    },
-                    {
-                      name = "y",
-                      type = "number",
-                      description = "A value to subtract from y component.",
-                      default = "x"
-                    },
-                    {
-                      name = "z",
-                      type = "number",
-                      description = "A value to subtract from z component.",
-                      default = "x"
-                    },
-                    {
-                      name = "w",
-                      type = "number",
-                      description = "A value to subtract from w component.",
-                      default = "x"
+                      description = "A number to subtract from each component."
                     }
                   },
                   returns = {
                     {
                       name = "v",
-                      type = "Vec4",
+                      type = "Vec2",
                       description = "The original vector."
                     }
                   }
@@ -25643,7 +25254,7 @@ return {
               description = "The id of the key (ignores keyboard layout, may vary between keyboards)."
             },
             {
-              name = "repeating",
+              name = "repeat",
               type = "boolean",
               description = "Whether the event is the result of a key repeat instead of an actual press."
             }

+ 10 - 0
api/lovr/graphics/Model/getAnimationDuration.lua

@@ -17,6 +17,16 @@ return {
       description = 'The duration of the animation, in seconds.'
     }
   },
+  variants = {
+    {
+      arguments = { 'name' },
+      returns = { 'duration' }
+    },
+    {
+      arguments = { 'index' },
+      returns = { 'duration' }
+    }
+  },
   related = {
     'Model:getAnimationCount',
     'Model:getAnimationName',