Browse Source

Adjust; Rebuild;

bjorn 10 months ago
parent
commit
eee6773ac2
3 changed files with 94 additions and 16 deletions
  1. 64 0
      api/init.lua
  2. 14 7
      api/lovr/math/Quat/getEuler.lua
  3. 16 9
      api/lovr/math/Quat/setEuler.lua

+ 64 - 0
api/init.lua

@@ -29796,6 +29796,35 @@ return {
                 }
               }
             },
+            {
+              name = "getEuler",
+              summary = "Get the euler angles of the quaternion.",
+              description = "Returns the euler angles of the quaternion, in YXZ order.",
+              key = "Quat:getEuler",
+              module = "lovr.math",
+              variants = {
+                {
+                  arguments = {},
+                  returns = {
+                    {
+                      name = "pitch",
+                      type = "number",
+                      description = "The pitch (x axis rotation)."
+                    },
+                    {
+                      name = "yaw",
+                      type = "number",
+                      description = "The yaw (y axis rotation)."
+                    },
+                    {
+                      name = "roll",
+                      type = "number",
+                      description = "The roll (z axis rotation)."
+                    }
+                  }
+                }
+              }
+            },
             {
               name = "length",
               summary = "Get the length of the quaternion.",
@@ -30017,6 +30046,41 @@ return {
                 }
               }
             },
+            {
+              name = "setEuler",
+              summary = "Set the value of the quaternion using euler angles.",
+              description = "Sets the value of the quaternion using euler angles.  The rotation order is YXZ.",
+              key = "Quat:setEuler",
+              module = "lovr.math",
+              variants = {
+                {
+                  arguments = {
+                    {
+                      name = "pitch",
+                      type = "number",
+                      description = "The pitch (x axis rotation)."
+                    },
+                    {
+                      name = "yaw",
+                      type = "number",
+                      description = "The yaw (y axis rotation)."
+                    },
+                    {
+                      name = "roll",
+                      type = "number",
+                      description = "The roll (z axis rotation)."
+                    }
+                  },
+                  returns = {
+                    {
+                      name = "self",
+                      type = "Quat",
+                      description = "The modified quaternion."
+                    }
+                  }
+                }
+              }
+            },
             {
               name = "slerp",
               summary = "Moves this quaternion some amount towards another one.",

+ 14 - 7
api/lovr/math/Quat/getEuler.lua

@@ -1,18 +1,25 @@
 return {
   summary = 'Get the euler angles of the quaternion.',
-  description = [[
-    Rotation order is YXZ
-  ]],
+  description = 'Returns the euler angles of the quaternion, in YXZ order.',
   arguments = {},
   returns = {
-    pitch = { type = 'number', },
-    yaw = { type = 'number' },
-    roll = { type = 'number' }
+    pitch = {
+      type = 'number',
+      description = 'The pitch (x axis rotation).'
+    },
+    yaw = {
+      type = 'number',
+      description = 'The yaw (y axis rotation).'
+    },
+    roll = {
+      type = 'number',
+      description = 'The roll (z axis rotation).'
+    }
   },
   variants = {
     {
       arguments = {},
       returns = { 'pitch', 'yaw', 'roll' }
     }
-  },
+  }
 }

+ 16 - 9
api/lovr/math/Quat/setEuler.lua

@@ -1,23 +1,30 @@
 return {
-  summary = 'Set the quaternion by euler angles.',
-  description = [[
-    Rotation order is YXZ
-  ]],
+  summary = 'Set the value of the quaternion using euler angles.',
+  description = 'Sets the value of the quaternion using euler angles.  The rotation order is YXZ.',
   arguments = {
-    pitch = { type = 'number', },
-    yaw = { type = 'number' },
-    roll = { type = 'number' }
+    pitch = {
+      type = 'number',
+      description = 'The pitch (x axis rotation).'
+    },
+    yaw = {
+      type = 'number',
+      description = 'The yaw (y axis rotation).'
+    },
+    roll = {
+      type = 'number',
+      description = 'The roll (z axis rotation).'
+    }
   },
   returns = {
     self = {
       type = 'Quat',
       description = 'The modified quaternion.'
-    },
+    }
   },
   variants = {
     {
       arguments = { 'pitch', 'yaw', 'roll' },
       returns = { 'self' }
     }
-  },
+  }
 }