Browse Source

Describe threshold for damping setters & getters

Josip Miskovic 4 years ago
parent
commit
9272ec62e4

+ 7 - 2
api/lovr/physics/Collider/getAngularDamping.lua

@@ -1,8 +1,8 @@
 return {
   summary = 'Get the angular damping of the Collider.',
   description = [[
-    Returns the angular damping of the Collider.  Angular damping makes things less "spinny",
-    causing them them slow down their angular velocity over time.
+    Returns the angular damping parameters of the Collider.  Angular damping makes things less
+    "spinny", making them slow down their angular velocity over time.
   ]],
   arguments = {},
   returns = {
@@ -10,6 +10,11 @@ return {
       name = 'damping',
       type = 'number',
       description = 'The angular damping.'
+    },
+    {
+      name = 'threshold',
+      type = 'number',
+      description = 'Velocity limit below which the damping is not applied.'
     }
   },
   notes = 'Angular damping can also be set on the World.',

+ 6 - 1
api/lovr/physics/Collider/getLinearDamping.lua

@@ -1,7 +1,7 @@
 return {
   summary = 'Get the linear damping of the Collider.',
   description = [[
-    Returns the Collider's linear damping parameter.  Linear damping is similar to drag or air
+    Returns the Collider's linear damping parameters.  Linear damping is similar to drag or air
     resistance, slowing the Collider down over time.
   ]],
   arguments = {},
@@ -10,6 +10,11 @@ return {
       name = 'damping',
       type = 'number',
       description = 'The linear damping.'
+    },
+    {
+      name = 'threshold',
+      type = 'number',
+      description = 'Velocity limit below which the damping is not applied.'
     }
   },
   notes = [[

+ 8 - 1
api/lovr/physics/Collider/setAngularDamping.lua

@@ -2,13 +2,20 @@ return {
   summary = 'Set the angular damping of the Collider.',
   description = [[
     Sets the angular damping of the Collider.  Angular damping makes things less "spinny", causing
-    them them slow down their angular velocity over time.
+    them to slow down their angular velocity over time. Damping is only applied when angular
+    velocity is over the threshold value.
   ]],
   arguments = {
     {
       name = 'damping',
       type = 'number',
       description = 'The angular damping.'
+    },
+    {
+      name = 'threshold',
+      type = 'number',
+      default = '0',
+      description = 'Velocity limit below which the damping is not applied.'
     }
   },
   returns = {},

+ 8 - 1
api/lovr/physics/Collider/setLinearDamping.lua

@@ -2,13 +2,20 @@ return {
   summary = 'Set the linear damping of the Collider.',
   description = [[
     Sets the Collider's linear damping parameter.  Linear damping is similar to drag or air
-    resistance, slowing the Collider down over time.
+    resistance, slowing the Collider down over time. Damping is only applied when linear
+    velocity is over the threshold value.
   ]],
   arguments = {
     {
       name = 'damping',
       type = 'number',
       description = 'The linear damping.'
+    },
+    {
+      name = 'threshold',
+      type = 'number',
+      default = '0',
+      description = 'Velocity limit below which the damping is not applied.'
     }
   },
   returns = {},

+ 7 - 2
api/lovr/physics/World/getAngularDamping.lua

@@ -2,8 +2,8 @@ return {
   tag = 'worldProperties',
   summary = 'Get the angular damping of the World.',
   description = [[
-    Returns the angular damping of the World.  Angular damping makes things less "spinny", making
-    them slow down their angular velocity over time.
+    Returns the angular damping parameters of the World.  Angular damping makes things less
+    "spinny", making them slow down their angular velocity over time.
   ]],
   arguments = {},
   returns = {
@@ -11,6 +11,11 @@ return {
       name = 'damping',
       type = 'number',
       description = 'The angular damping.'
+    },
+    {
+      name = 'threshold',
+      type = 'number',
+      description = 'Velocity limit below which the damping is not applied.'
     }
   },
   notes = 'Angular damping can also be set on individual colliders.',

+ 7 - 2
api/lovr/physics/World/getLinearDamping.lua

@@ -2,8 +2,8 @@ return {
   tag = 'worldProperties',
   summary = 'Get the linear damping of the World.',
   description = [[
-    Returns the linear damping of the World.  Linear damping is similar to drag or air resistance,
-    slowing down colliders over time as they move.
+    Returns the linear damping parameters of the World.  Linear damping is similar to drag or air
+    resistance, slowing down colliders over time as they move.
   ]],
   arguments = {},
   returns = {
@@ -11,6 +11,11 @@ return {
       name = 'damping',
       type = 'number',
       description = 'The linear damping.'
+    },
+    {
+      name = 'threshold',
+      type = 'number',
+      description = 'Velocity limit below which the damping is not applied.'
     }
   },
   notes = [[

+ 8 - 1
api/lovr/physics/World/setAngularDamping.lua

@@ -3,13 +3,20 @@ return {
   summary = 'Set the angular damping of the World.',
   description = [[
     Sets the angular damping of the World.  Angular damping makes things less "spinny", making them
-    slow down their angular velocity over time.
+    slow down their angular velocity over time. Damping is only applied when angular velocity
+    is over the threshold value.
   ]],
   arguments = {
     {
       name = 'damping',
       type = 'number',
       description = 'The angular damping.'
+    },
+    {
+      name = 'threshold',
+      type = 'number',
+      default = '0',
+      description = 'Velocity limit below which the damping is not applied.'
     }
   },
   returns = {},

+ 8 - 1
api/lovr/physics/World/setLinearDamping.lua

@@ -3,13 +3,20 @@ return {
   summary = 'Set the linear damping of the World.',
   description = [[
     Sets the linear damping of the World.  Linear damping is similar to drag or air resistance,
-    slowing down colliders over time as they move.
+    slowing down colliders over time as they move. Damping is only applied when linear velocity
+    is over the threshold value.
   ]],
   arguments = {
     {
       name = 'damping',
       type = 'number',
       description = 'The linear damping.'
+    },
+    {
+      name = 'threshold',
+      type = 'number',
+      default = '0',
+      description = 'Velocity limit below which the damping is not applied.'
     }
   },
   returns = {},