Browse Source

Collider:get/setPose;

bjorn 4 years ago
parent
commit
b1117fe183

+ 118 - 4
api/init.lua

@@ -19762,7 +19762,9 @@ return {
                 "Collider:getAngularVelocity",
                 "Collider:setAngularVelocity",
                 "Collider:getPosition",
-                "Collider:setPosition"
+                "Collider:setPosition",
+                "Collider:getPose",
+                "Collider:setPose"
               },
               variants = {
                 {
@@ -19792,6 +19794,59 @@ return {
                 }
               }
             },
+            {
+              name = "getPose",
+              summary = "Get the pose of the Collider.",
+              description = "Returns the position and orientation of the Collider.",
+              key = "Collider:getPose",
+              module = "lovr.physics",
+              related = {
+                "Collider:getPosition",
+                "Collider:getOrientation"
+              },
+              variants = {
+                {
+                  arguments = {},
+                  returns = {
+                    {
+                      name = "x",
+                      type = "number",
+                      description = "The x position of the Collider, in meters."
+                    },
+                    {
+                      name = "y",
+                      type = "number",
+                      description = "The y position of the Collider, in meters."
+                    },
+                    {
+                      name = "z",
+                      type = "number",
+                      description = "The z position of the Collider, in meters."
+                    },
+                    {
+                      name = "angle",
+                      type = "number",
+                      description = "The number of radians the Collider is rotated around its axis of rotation."
+                    },
+                    {
+                      name = "ax",
+                      type = "number",
+                      description = "The x component of the axis of rotation."
+                    },
+                    {
+                      name = "ay",
+                      type = "number",
+                      description = "The y component of the axis of rotation."
+                    },
+                    {
+                      name = "az",
+                      type = "number",
+                      description = "The z component of the axis of rotation."
+                    }
+                  }
+                }
+              }
+            },
             {
               name = "getPosition",
               summary = "Get the position of the Collider.",
@@ -19803,7 +19858,9 @@ return {
                 "Collider:getLinearVelocity",
                 "Collider:setLinearVelocity",
                 "Collider:getOrientation",
-                "Collider:setOrientation"
+                "Collider:setOrientation",
+                "Collider:getPose",
+                "Collider:setPose"
               },
               variants = {
                 {
@@ -20449,7 +20506,9 @@ return {
                 "Collider:getAngularVelocity",
                 "Collider:setAngularVelocity",
                 "Collider:getPosition",
-                "Collider:setPosition"
+                "Collider:setPosition",
+                "Collider:getPose",
+                "Collider:setPose"
               },
               variants = {
                 {
@@ -20479,6 +20538,59 @@ return {
                 }
               }
             },
+            {
+              name = "setPose",
+              summary = "Set the pose of the Collider.",
+              description = "Sets the position and orientation of the Collider.",
+              key = "Collider:setPose",
+              module = "lovr.physics",
+              related = {
+                "Collider:setPosition",
+                "Collider:setOrientation"
+              },
+              variants = {
+                {
+                  arguments = {
+                    {
+                      name = "x",
+                      type = "number",
+                      description = "The x position of the Collider, in meters."
+                    },
+                    {
+                      name = "y",
+                      type = "number",
+                      description = "The y position of the Collider, in meters."
+                    },
+                    {
+                      name = "z",
+                      type = "number",
+                      description = "The z position of the Collider, in meters."
+                    },
+                    {
+                      name = "angle",
+                      type = "number",
+                      description = "The number of radians the Collider is rotated around its axis of rotation."
+                    },
+                    {
+                      name = "ax",
+                      type = "number",
+                      description = "The x component of the axis of rotation."
+                    },
+                    {
+                      name = "ay",
+                      type = "number",
+                      description = "The y component of the axis of rotation."
+                    },
+                    {
+                      name = "az",
+                      type = "number",
+                      description = "The z component of the axis of rotation."
+                    }
+                  },
+                  returns = {}
+                }
+              }
+            },
             {
               name = "setPosition",
               summary = "Set the position of the Collider.",
@@ -20490,7 +20602,9 @@ return {
                 "Collider:getLinearVelocity",
                 "Collider:setLinearVelocity",
                 "Collider:getOrientation",
-                "Collider:setOrientation"
+                "Collider:setOrientation",
+                "Collider:getPose",
+                "Collider:setPose"
               },
               variants = {
                 {

+ 3 - 1
api/lovr/physics/Collider/getOrientation.lua

@@ -29,6 +29,8 @@ return {
     'Collider:getAngularVelocity',
     'Collider:setAngularVelocity',
     'Collider:getPosition',
-    'Collider:setPosition'
+    'Collider:setPosition',
+    'Collider:getPose',
+    'Collider:setPose'
   }
 }

+ 46 - 0
api/lovr/physics/Collider/getPose.lua

@@ -0,0 +1,46 @@
+return {
+  summary = 'Get the pose of the Collider.',
+  description = 'Returns the position and orientation of the Collider.',
+  arguments = {},
+  returns = {
+    {
+      name = 'x',
+      type = 'number',
+      description = 'The x position of the Collider, in meters.'
+    },
+    {
+      name = 'y',
+      type = 'number',
+      description = 'The y position of the Collider, in meters.'
+    },
+    {
+      name = 'z',
+      type = 'number',
+      description = 'The z position of the Collider, in meters.'
+    },
+    {
+      name = 'angle',
+      type = 'number',
+      description = 'The number of radians the Collider is rotated around its axis of rotation.'
+    },
+    {
+      name = 'ax',
+      type = 'number',
+      description = 'The x component of the axis of rotation.'
+    },
+    {
+      name = 'ay',
+      type = 'number',
+      description = 'The y component of the axis of rotation.'
+    },
+    {
+      name = 'az',
+      type = 'number',
+      description = 'The z component of the axis of rotation.'
+    }
+  },
+  related = {
+    'Collider:getPosition',
+    'Collider:getOrientation'
+  }
+}

+ 3 - 1
api/lovr/physics/Collider/getPosition.lua

@@ -24,6 +24,8 @@ return {
     'Collider:getLinearVelocity',
     'Collider:setLinearVelocity',
     'Collider:getOrientation',
-    'Collider:setOrientation'
+    'Collider:setOrientation',
+    'Collider:getPose',
+    'Collider:setPose'
   }
 }

+ 3 - 1
api/lovr/physics/Collider/setOrientation.lua

@@ -29,6 +29,8 @@ return {
     'Collider:getAngularVelocity',
     'Collider:setAngularVelocity',
     'Collider:getPosition',
-    'Collider:setPosition'
+    'Collider:setPosition',
+    'Collider:getPose',
+    'Collider:setPose'
   }
 }

+ 46 - 0
api/lovr/physics/Collider/setPose.lua

@@ -0,0 +1,46 @@
+return {
+  summary = 'Set the pose of the Collider.',
+  description = 'Sets the position and orientation of the Collider.',
+  arguments = {
+    {
+      name = 'x',
+      type = 'number',
+      description = 'The x position of the Collider, in meters.'
+    },
+    {
+      name = 'y',
+      type = 'number',
+      description = 'The y position of the Collider, in meters.'
+    },
+    {
+      name = 'z',
+      type = 'number',
+      description = 'The z position of the Collider, in meters.'
+    },
+    {
+      name = 'angle',
+      type = 'number',
+      description = 'The number of radians the Collider is rotated around its axis of rotation.'
+    },
+    {
+      name = 'ax',
+      type = 'number',
+      description = 'The x component of the axis of rotation.'
+    },
+    {
+      name = 'ay',
+      type = 'number',
+      description = 'The y component of the axis of rotation.'
+    },
+    {
+      name = 'az',
+      type = 'number',
+      description = 'The z component of the axis of rotation.'
+    }
+  },
+  returns = {},
+  related = {
+    'Collider:setPosition',
+    'Collider:setOrientation'
+  }
+}

+ 3 - 1
api/lovr/physics/Collider/setPosition.lua

@@ -24,6 +24,8 @@ return {
     'Collider:getLinearVelocity',
     'Collider:setLinearVelocity',
     'Collider:getOrientation',
-    'Collider:setOrientation'
+    'Collider:setOrientation',
+    'Collider:getPose',
+    'Collider:setPose'
   }
 }