Browse Source

Merge pull request #43 from jmiskovic/add/damping-threshold

Describe threshold for damping setters
Bjorn 4 years ago
parent
commit
a0daf05f60

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

@@ -1,8 +1,8 @@
 return {
 return {
   summary = 'Get the angular damping of the Collider.',
   summary = 'Get the angular damping of the Collider.',
   description = [[
   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 = {},
   arguments = {},
   returns = {
   returns = {
@@ -10,6 +10,11 @@ return {
       name = 'damping',
       name = 'damping',
       type = 'number',
       type = 'number',
       description = 'The angular damping.'
       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.',
   notes = 'Angular damping can also be set on the World.',

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

@@ -1,7 +1,7 @@
 return {
 return {
   summary = 'Get the linear damping of the Collider.',
   summary = 'Get the linear damping of the Collider.',
   description = [[
   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.
     resistance, slowing the Collider down over time.
   ]],
   ]],
   arguments = {},
   arguments = {},
@@ -10,6 +10,11 @@ return {
       name = 'damping',
       name = 'damping',
       type = 'number',
       type = 'number',
       description = 'The linear damping.'
       description = 'The linear damping.'
+    },
+    {
+      name = 'threshold',
+      type = 'number',
+      description = 'Velocity limit below which the damping is not applied.'
     }
     }
   },
   },
   notes = [[
   notes = [[

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

@@ -2,13 +2,20 @@ return {
   summary = 'Set the angular damping of the Collider.',
   summary = 'Set the angular damping of the Collider.',
   description = [[
   description = [[
     Sets the angular damping of the Collider.  Angular damping makes things less "spinny", causing
     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 = {
   arguments = {
     {
     {
       name = 'damping',
       name = 'damping',
       type = 'number',
       type = 'number',
       description = 'The angular damping.'
       description = 'The angular damping.'
+    },
+    {
+      name = 'threshold',
+      type = 'number',
+      default = '0',
+      description = 'Velocity limit below which the damping is not applied.'
     }
     }
   },
   },
   returns = {},
   returns = {},

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

@@ -2,13 +2,20 @@ return {
   summary = 'Set the linear damping of the Collider.',
   summary = 'Set the linear damping of the Collider.',
   description = [[
   description = [[
     Sets the Collider's linear damping parameter.  Linear damping is similar to drag or air
     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 = {
   arguments = {
     {
     {
       name = 'damping',
       name = 'damping',
       type = 'number',
       type = 'number',
       description = 'The linear damping.'
       description = 'The linear damping.'
+    },
+    {
+      name = 'threshold',
+      type = 'number',
+      default = '0',
+      description = 'Velocity limit below which the damping is not applied.'
     }
     }
   },
   },
   returns = {},
   returns = {},

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

@@ -2,8 +2,8 @@ return {
   tag = 'worldProperties',
   tag = 'worldProperties',
   summary = 'Get the angular damping of the World.',
   summary = 'Get the angular damping of the World.',
   description = [[
   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 = {},
   arguments = {},
   returns = {
   returns = {
@@ -11,6 +11,11 @@ return {
       name = 'damping',
       name = 'damping',
       type = 'number',
       type = 'number',
       description = 'The angular damping.'
       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.',
   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',
   tag = 'worldProperties',
   summary = 'Get the linear damping of the World.',
   summary = 'Get the linear damping of the World.',
   description = [[
   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 = {},
   arguments = {},
   returns = {
   returns = {
@@ -11,6 +11,11 @@ return {
       name = 'damping',
       name = 'damping',
       type = 'number',
       type = 'number',
       description = 'The linear damping.'
       description = 'The linear damping.'
+    },
+    {
+      name = 'threshold',
+      type = 'number',
+      description = 'Velocity limit below which the damping is not applied.'
     }
     }
   },
   },
   notes = [[
   notes = [[

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

@@ -3,13 +3,20 @@ return {
   summary = 'Set the angular damping of the World.',
   summary = 'Set the angular damping of the World.',
   description = [[
   description = [[
     Sets the angular damping of the World.  Angular damping makes things less "spinny", making them
     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 = {
   arguments = {
     {
     {
       name = 'damping',
       name = 'damping',
       type = 'number',
       type = 'number',
       description = 'The angular damping.'
       description = 'The angular damping.'
+    },
+    {
+      name = 'threshold',
+      type = 'number',
+      default = '0',
+      description = 'Velocity limit below which the damping is not applied.'
     }
     }
   },
   },
   returns = {},
   returns = {},

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

@@ -3,13 +3,20 @@ return {
   summary = 'Set the linear damping of the World.',
   summary = 'Set the linear damping of the World.',
   description = [[
   description = [[
     Sets the linear damping of the World.  Linear damping is similar to drag or air resistance,
     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 = {
   arguments = {
     {
     {
       name = 'damping',
       name = 'damping',
       type = 'number',
       type = 'number',
       description = 'The linear damping.'
       description = 'The linear damping.'
+    },
+    {
+      name = 'threshold',
+      type = 'number',
+      default = '0',
+      description = 'Velocity limit below which the damping is not applied.'
     }
     }
   },
   },
   returns = {},
   returns = {},