Browse Source

Add SliderJoint:getPosition;

bjorn 2 years ago
parent
commit
8f91ae7572
1 changed files with 27 additions and 0 deletions
  1. 27 0
      api/lovr/physics/SliderJoint/getPosition.lua

+ 27 - 0
api/lovr/physics/SliderJoint/getPosition.lua

@@ -0,0 +1,27 @@
+return {
+  summary = 'Get how far the SliderJoint is extended.',
+  description = [[
+    Returns how far the slider joint is extended (zero is the position the slider was created at,
+    positive values are further apart).
+  ]],
+  arguments = {},
+  returns = {
+    position = {
+      type = 'number',
+      description = 'The joint position along its axis.'
+    }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'position' }
+    }
+  },
+  related = {
+    'SliderJoint:getAxis',
+    'SliderJoint:getLowerLimit',
+    'SliderJoint:setLowerLimit',
+    'SliderJoint:getUpperLimit',
+    'SliderJoint:setUpperLimit'
+  }
+}