Browse Source

Update newWorld settings;

bjorn 1 year ago
parent
commit
3520107e1f
2 changed files with 26 additions and 46 deletions
  1. 8 14
      api/init.lua
  2. 18 32
      api/lovr/physics/newWorld.lua

+ 8 - 14
api/init.lua

@@ -33542,25 +33542,25 @@ return {
                     {
                     {
                       name = "tags",
                       name = "tags",
                       type = "table",
                       type = "table",
-                      description = "A list of collision tags (strings).  Colliders can be assigned a tag, and collision can be enabled and disabled between different tags.  There is a maximum of 31 tags.",
+                      description = "The list of collision tags (strings).  Colliders can be assigned a tag, and collision can be enabled and disabled between different tags.  There is a maximum of 31 tags.",
                       default = "{}"
                       default = "{}"
                     },
                     },
                     {
                     {
                       name = "staticTags",
                       name = "staticTags",
                       type = "table",
                       type = "table",
-                      description = "An optional list of collision tags that should be \"static\".  Colliders with one of these tags will be kinematic and will not move from velocities or forces, but they can still be manually repositioned.  The physics engine puts static colliders in their own collision tree, which optimizes performance.  It's meant to be used for static environment objects in a level that will never move.",
+                      description = "An optional list of collision tags that are \"static\".  Colliders with a static tag will not move, and the physics engine uses this for optimization.",
                       default = "{}"
                       default = "{}"
                     },
                     },
                     {
                     {
-                      name = "tickRate",
+                      name = "timestep",
                       type = "number",
                       type = "number",
-                      description = "The number of physics updates to perform per second for fixed timestep physics simulation, or zero to disable fixed timestep.  When fixed timestep is active, any time passed to `World:update` will be accumulated, and the physics simulation will run only when there's as much time as the fixed timestep.  This decouples the physics update rate from the rendering rate, which improves stability.  Collider poses will be interpolated between the two most recent ticks.  Higher values result in more accurate simulation, at the cost of CPU usage.  Use zero to disable fixed timestep and directly update the physics simulation when `World:update` is called.",
-                      default = "60"
+                      description = "The physics timestep, or zero to disable fixed timestep.  When fixed timestep is active, any time passed to `World:update` will be accumulated, and the physics simulation will run only when there's as much time as the fixed timestep.  This decouples the physics update rate from the rendering rate, which improves stability. Collider poses will be interpolated between the two most recent ticks.  Lower values result in more accurate simulation, at the cost of CPU usage.  Use zero to disable fixed timestep and directly update the physics simulation when `World:update` is called.",
+                      default = "1 / 60"
                     },
                     },
                     {
                     {
-                      name = "tickLimit",
+                      name = "maxSteps",
                       type = "number",
                       type = "number",
-                      description = "The maximum number of physics ticks to run during any given call to `World:update`. This can be used to avoid a \"spiral of death\" where the physics engine can't keep up with all the ticks when a large `dt` value is given.  Zero means no limit.",
+                      description = "The maximum number of physics steps to run during any given call to `World:update`. This can be used to avoid a \"spiral of death\" where the physics engine can't keep up when a large `dt` value is given.  Zero means no limit.",
                       default = "0"
                       default = "0"
                     },
                     },
                     {
                     {
@@ -33569,12 +33569,6 @@ return {
                       description = "The maximum number of Colliders in the World.  Increasing this will use more memory. This can't be bigger than 2^23 (around 8 million).",
                       description = "The maximum number of Colliders in the World.  Increasing this will use more memory. This can't be bigger than 2^23 (around 8 million).",
                       default = "16384"
                       default = "16384"
                     },
                     },
-                    {
-                      name = "deterministic",
-                      type = "boolean",
-                      description = "Whether the simulation should be deterministic, meaning it will behave exactly the same given the same starting conditions and inputs.  Disabling this will improve performance slightly.",
-                      default = "true"
-                    },
                     {
                     {
                       name = "threadSafe",
                       name = "threadSafe",
                       type = "boolean",
                       type = "boolean",
@@ -33600,7 +33594,7 @@ return {
                       default = ".01"
                       default = ".01"
                     },
                     },
                     {
                     {
-                      name = "minBounceVelocity",
+                      name = "restitutionThreshold",
                       type = "number",
                       type = "number",
                       description = "A velocity below which restitution (bounciness) will not be applied, in meters per second.  If this is too low then objects may have trouble coming to rest.",
                       description = "A velocity below which restitution (bounciness) will not be applied, in meters per second.  If this is too low then objects may have trouble coming to rest.",
                       default = "1.0"
                       default = "1.0"

+ 18 - 32
api/lovr/physics/newWorld.lua

@@ -12,8 +12,8 @@ return {
           type = 'table',
           type = 'table',
           default = '{}',
           default = '{}',
           description = [[
           description = [[
-            A list of collision tags (strings).  Colliders can be assigned a tag, and collision can
-            be enabled and disabled between different tags.  There is a maximum of 31 tags.
+            The list of collision tags (strings).  Colliders can be assigned a tag, and collision
+            can be enabled and disabled between different tags.  There is a maximum of 31 tags.
           ]]
           ]]
         },
         },
         {
         {
@@ -21,36 +21,32 @@ return {
           type = 'table',
           type = 'table',
           default = '{}',
           default = '{}',
           description = [[
           description = [[
-            An optional list of collision tags that should be "static".  Colliders with one of these
-            tags will be kinematic and will not move from velocities or forces, but they can still
-            be manually repositioned.  The physics engine puts static colliders in their own
-            collision tree, which optimizes performance.  It's meant to be used for static
-            environment objects in a level that will never move.
+            An optional list of collision tags that are "static".  Colliders with a static tag will
+            not move, and the physics engine uses this for optimization.
           ]]
           ]]
         },
         },
         {
         {
-          name = 'tickRate',
+          name = 'timestep',
           type = 'number',
           type = 'number',
-          default = '60',
+          default = '1 / 60',
           description = [[
           description = [[
-            The number of physics updates to perform per second for fixed timestep physics
-            simulation, or zero to disable fixed timestep.  When fixed timestep is active, any time
-            passed to `World:update` will be accumulated, and the physics simulation will run only
-            when there's as much time as the fixed timestep.  This decouples the physics update rate
-            from the rendering rate, which improves stability.  Collider poses will be interpolated
-            between the two most recent ticks.  Higher values result in more accurate simulation, at
-            the cost of CPU usage.  Use zero to disable fixed timestep and directly update the
-            physics simulation when `World:update` is called.
+            The physics timestep, or zero to disable fixed timestep.  When fixed timestep is active,
+            any time passed to `World:update` will be accumulated, and the physics simulation will
+            run only when there's as much time as the fixed timestep.  This decouples the physics
+            update rate from the rendering rate, which improves stability. Collider poses will be
+            interpolated between the two most recent ticks.  Lower values result in more accurate
+            simulation, at the cost of CPU usage.  Use zero to disable fixed timestep and directly
+            update the physics simulation when `World:update` is called.
           ]]
           ]]
         },
         },
         {
         {
-          name = 'tickLimit',
+          name = 'maxSteps',
           type = 'number',
           type = 'number',
           default = '0',
           default = '0',
           description = [[
           description = [[
-            The maximum number of physics ticks to run during any given call to `World:update`.
-            This can be used to avoid a "spiral of death" where the physics engine can't keep up
-            with all the ticks when a large `dt` value is given.  Zero means no limit.
+            The maximum number of physics steps to run during any given call to `World:update`. This
+            can be used to avoid a "spiral of death" where the physics engine can't keep up when a
+            large `dt` value is given.  Zero means no limit.
           ]]
           ]]
         },
         },
         {
         {
@@ -62,16 +58,6 @@ return {
             This can't be bigger than 2^23 (around 8 million).
             This can't be bigger than 2^23 (around 8 million).
           ]]
           ]]
         },
         },
-        {
-          name = 'deterministic',
-          type = 'boolean',
-          default = 'true',
-          description = [[
-            Whether the simulation should be deterministic, meaning it will behave exactly the same
-            given the same starting conditions and inputs.  Disabling this will improve performance
-            slightly.
-          ]]
-        },
         {
         {
           name = 'threadSafe',
           name = 'threadSafe',
           type = 'boolean',
           type = 'boolean',
@@ -110,7 +96,7 @@ return {
           description = 'The maximum amount that colliders are allowed to overlap, in meters.'
           description = 'The maximum amount that colliders are allowed to overlap, in meters.'
         },
         },
         {
         {
-          name = 'minBounceVelocity',
+          name = 'restitutionThreshold',
           type = 'number',
           type = 'number',
           default = '1.0',
           default = '1.0',
           description = [[
           description = [[