bjorn 1 year ago
parent
commit
4da0e00cf5
42 changed files with 522 additions and 522 deletions
  1. 393 334
      api/init.lua
  2. 4 3
      api/lovr/physics/Collider/getDegreesOfFreedom.lua
  3. 0 30
      api/lovr/physics/Collider/getLocalCenter.lua
  4. 0 42
      api/lovr/physics/Collider/getMassData.lua
  5. 52 0
      api/lovr/physics/Collider/getRawPose.lua
  6. 4 3
      api/lovr/physics/Collider/setDegreesOfFreedom.lua
  7. 0 42
      api/lovr/physics/Collider/setMassData.lua
  8. 2 1
      api/lovr/physics/ConeJoint/init.lua
  9. 2 1
      api/lovr/physics/ConvexShape/init.lua
  10. 2 2
      api/lovr/physics/HingeJoint/setMaxMotorTorque.lua
  11. 1 1
      api/lovr/physics/HingeJoint/setMotorTarget.lua
  12. 18 0
      api/lovr/physics/MotorMode.lua
  13. 2 2
      api/lovr/physics/SliderJoint/setMaxMotorForce.lua
  14. 1 1
      api/lovr/physics/SliderJoint/setMotorTarget.lua
  15. 2 1
      api/lovr/physics/WeldJoint/init.lua
  16. 0 1
      api/lovr/physics/World/destroy.lua
  17. 0 1
      api/lovr/physics/World/disableCollisionBetween.lua
  18. 0 1
      api/lovr/physics/World/enableCollisionBetween.lua
  19. 0 1
      api/lovr/physics/World/getAngularDamping.lua
  20. 0 1
      api/lovr/physics/World/getGravity.lua
  21. 0 1
      api/lovr/physics/World/getLinearDamping.lua
  22. 0 9
      api/lovr/physics/World/getResponseTime.lua
  23. 0 1
      api/lovr/physics/World/getStepCount.lua
  24. 0 1
      api/lovr/physics/World/getTags.lua
  25. 0 5
      api/lovr/physics/World/getTightness.lua
  26. 0 1
      api/lovr/physics/World/isCollisionEnabledBetween.lua
  27. 25 0
      api/lovr/physics/World/isDestroyed.lua
  28. 0 1
      api/lovr/physics/World/isSleepingAllowed.lua
  29. 0 1
      api/lovr/physics/World/overlapShape.lua
  30. 0 1
      api/lovr/physics/World/queryBox.lua
  31. 0 1
      api/lovr/physics/World/querySphere.lua
  32. 0 1
      api/lovr/physics/World/raycast.lua
  33. 0 1
      api/lovr/physics/World/setAngularDamping.lua
  34. 0 1
      api/lovr/physics/World/setGravity.lua
  35. 0 1
      api/lovr/physics/World/setLinearDamping.lua
  36. 0 9
      api/lovr/physics/World/setResponseTime.lua
  37. 0 1
      api/lovr/physics/World/setSleepingAllowed.lua
  38. 0 1
      api/lovr/physics/World/setStepCount.lua
  39. 0 9
      api/lovr/physics/World/setTightness.lua
  40. 1 2
      api/lovr/physics/World/shapecast.lua
  41. 0 1
      api/lovr/physics/World/update.lua
  42. 13 5
      api/main.lua

File diff suppressed because it is too large
+ 393 - 334
api/init.lua


+ 4 - 3
api/lovr/physics/Collider/getEnabledAxes.lua → api/lovr/physics/Collider/getDegreesOfFreedom.lua

@@ -1,6 +1,6 @@
 return {
 return {
   summary = 'Get the enabled translation/rotation axes.',
   summary = 'Get the enabled translation/rotation axes.',
-  description = 'Get the axes that are enabled for translation and rotation.',
+  description = 'Get the degrees of freedom of the Collider.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
     translation = {
     translation = {
@@ -29,7 +29,8 @@ return {
   notes = [[
   notes = [[
     The default state is `xyz` for both translation and rotation.
     The default state is `xyz` for both translation and rotation.
 
 
-    The physics engine does not support disabling all axes.  At least one translation or rotation
-    axis needs to be enabled.  To disable all movement for a collider, make it kinematic.
+    The physics engine does not support disabling all degrees of freedom.  At least one translation
+    or rotation axis needs to be enabled.  To disable all movement for a collider, make it
+    kinematic.
   ]]
   ]]
 }
 }

+ 0 - 30
api/lovr/physics/Collider/getLocalCenter.lua

@@ -1,30 +0,0 @@
-return {
-  summary = 'Get the Collider\'s center of mass.',
-  description = 'Returns the Collider\'s center of mass.',
-  arguments = {},
-  returns = {
-    cx = {
-      type = 'number',
-      description = 'The x position of the center of mass.'
-    },
-    cy = {
-      type = 'number',
-      description = 'The y position of the center of mass.'
-    },
-    cz = {
-      type = 'number',
-      description = 'The z position of the center of mass.'
-    }
-  },
-  variants = {
-    {
-      arguments = {},
-      returns = { 'cx', 'cy', 'cz' }
-    }
-  },
-  related = {
-    'Collider:getLocalPoint',
-    'Collider:getMassData',
-    'Collider:setMassData'
-  }
-}

+ 0 - 42
api/lovr/physics/Collider/getMassData.lua

@@ -1,42 +0,0 @@
-return {
-  summary = 'Compute mass properties for the Collider.',
-  description = 'Computes mass properties for the Collider.',
-  arguments = {},
-  returns = {
-    cx = {
-      type = 'number',
-      description = 'The x position of the center of mass.'
-    },
-    cy = {
-      type = 'number',
-      description = 'The y position of the center of mass.'
-    },
-    cz = {
-      type = 'number',
-      description = 'The z position of the center of mass.'
-    },
-    mass = {
-      type = 'number',
-      description = 'The computed mass of the Collider.'
-    },
-    inertia = {
-      type = 'table',
-      description = [[
-        A table containing 6 values of the rotational inertia tensor matrix.  The table contains the
-        3 diagonal elements of the matrix (upper left to bottom right), followed by the 3 elements
-        of the upper right portion of the 3x3 matrix.
-      ]]
-    }
-  },
-  variants = {
-    {
-      arguments = {},
-      returns = { 'cx', 'cy', 'cz', 'mass', 'inertia' }
-    }
-  },
-  related = {
-    'Collider:getMass',
-    'Collider:setMass',
-    'Shape:getMass'
-  }
-}

+ 52 - 0
api/lovr/physics/Collider/getRawPose.lua

@@ -0,0 +1,52 @@
+return {
+  summary = 'Get the raw pose of the Collider, without any interpolation.',
+  description = [[
+    Returns the position and orientation of the Collider, without any interpolation applied.
+  ]],
+  arguments = {},
+  returns = {
+    x = {
+      type = 'number',
+      description = 'The x position of the Collider, in meters.'
+    },
+    y = {
+      type = 'number',
+      description = 'The y position of the Collider, in meters.'
+    },
+    z = {
+      type = 'number',
+      description = 'The z position of the Collider, in meters.'
+    },
+    angle = {
+      type = 'number',
+      description = 'The number of radians the Collider is rotated around its axis of rotation.'
+    },
+    ax = {
+      type = 'number',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      description = 'The z component of the axis of rotation.'
+    }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
+    }
+  },
+  notes = [[
+    To disable all interpolation, disable fixed timestep by setting the `tickRate` to 0 when
+    creating the world.
+  ]],
+  related = {
+    'Collider:getRawPosition',
+    'Collider:getRawOrientation',
+    'Collider:getPose'
+  }
+}

+ 4 - 3
api/lovr/physics/Collider/setEnabledAxes.lua → api/lovr/physics/Collider/setDegreesOfFreedom.lua

@@ -1,6 +1,6 @@
 return {
 return {
   summary = 'Set the enabled translation/rotation axes.',
   summary = 'Set the enabled translation/rotation axes.',
-  description = 'Set the axes that are enabled for translation and rotation.',
+  description = 'Set the degrees of freedom of the Collider.',
   arguments = {
   arguments = {
     translation = {
     translation = {
       type = 'string',
       type = 'string',
@@ -29,8 +29,9 @@ return {
   notes = [[
   notes = [[
     The default state is `xyz` for both translation and rotation.
     The default state is `xyz` for both translation and rotation.
 
 
-    The physics engine does not support disabling all axes.  At least one translation or rotation
-    axis needs to be enabled.  To disable all movement for a collider, make it kinematic.
+    The physics engine does not support disabling all degrees of freedom.  At least one translation
+    or rotation axis needs to be enabled.  To disable all movement for a collider, make it
+    kinematic.
 
 
     When all translation axes are disabled, `Collider:getMass` will return 0.
     When all translation axes are disabled, `Collider:getMass` will return 0.
 
 

+ 0 - 42
api/lovr/physics/Collider/setMassData.lua

@@ -1,42 +0,0 @@
-return {
-  summary = 'Set mass properties for the Collider.',
-  description = 'Sets mass properties for the Collider.',
-  arguments = {
-    cx = {
-      type = 'number',
-      description = 'The x position of the center of mass.'
-    },
-    cy = {
-      type = 'number',
-      description = 'The y position of the center of mass.'
-    },
-    cz = {
-      type = 'number',
-      description = 'The z position of the center of mass.'
-    },
-    mass = {
-      type = 'number',
-      description = 'The computed mass of the Collider.'
-    },
-    inertia = {
-      type = 'table',
-      description = [[
-        A table containing 6 values of the rotational inertia tensor matrix.  The table contains the
-        3 diagonal elements of the matrix (upper left to bottom right), followed by the 3 elements
-        of the upper right portion of the 3x3 matrix.
-      ]]
-    }
-  },
-  returns = {},
-  variants = {
-    {
-      arguments = { 'cx', 'cy', 'cz', 'mass', 'inertia' },
-      returns = {}
-    }
-  },
-  related = {
-    'Collider:getMass',
-    'Collider:setMass',
-    'Shape:getMass'
-  }
-}

+ 2 - 1
api/lovr/physics/ConeJoint/init.lua

@@ -1,4 +1,5 @@
 return {
 return {
   summary = 'TODO',
   summary = 'TODO',
-  description = 'TODO'
+  description = 'TODO',
+  extends = 'Joint'
 }
 }

+ 2 - 1
api/lovr/physics/ConvexShape/init.lua

@@ -1,4 +1,5 @@
 return {
 return {
   summary = 'TODO',
   summary = 'TODO',
-  description = 'TODO'
+  description = 'TODO',
+  extends = 'Shape'
 }
 }

+ 2 - 2
api/lovr/physics/HingeJoint/setMaxMotorTorque.lua

@@ -28,8 +28,8 @@ return {
   returns = {},
   returns = {},
   variants = {
   variants = {
     {
     {
-      arguments = {},
-      returns = { 'positive', 'negative' }
+      arguments = { 'positive', 'negative' },
+      returns = {}
     }
     }
   },
   },
   related = {
   related = {

+ 1 - 1
api/lovr/physics/HingeJoint/setMotorTarget.lua

@@ -13,7 +13,7 @@ return {
   returns = {},
   returns = {},
   variants = {
   variants = {
     {
     {
-      arguments = { 'mode' },
+      arguments = { 'target' },
       returns = {}
       returns = {}
     }
     }
   },
   },

+ 18 - 0
api/lovr/physics/MotorMode.lua

@@ -0,0 +1,18 @@
+return {
+  summary = 'The different states for joint motors.',
+  description = 'The different ways the motor on a joint can be used.',
+  values = {
+    {
+      name = 'position',
+      description = 'The motor drives to a particular value.'
+    },
+    {
+      name = 'velocity',
+      description = 'The motor drives to a particular speed.'
+    }
+  },
+  related = {
+    'HingeJoint:setMotorMode',
+    'SliderJoint:setMotorMode'
+  }
+}

+ 2 - 2
api/lovr/physics/SliderJoint/setMaxMotorForce.lua

@@ -28,8 +28,8 @@ return {
   returns = {},
   returns = {},
   variants = {
   variants = {
     {
     {
-      arguments = {},
-      returns = { 'positive', 'negative' }
+      arguments = { 'positive', 'negative' },
+      returns = {}
     }
     }
   },
   },
   related = {
   related = {

+ 1 - 1
api/lovr/physics/SliderJoint/setMotorTarget.lua

@@ -13,7 +13,7 @@ return {
   returns = {},
   returns = {},
   variants = {
   variants = {
     {
     {
-      arguments = { 'mode' },
+      arguments = { 'target' },
       returns = {}
       returns = {}
     }
     }
   },
   },

+ 2 - 1
api/lovr/physics/WeldJoint/init.lua

@@ -1,4 +1,5 @@
 return {
 return {
   summary = 'TODO',
   summary = 'TODO',
-  description = 'TODO'
+  description = 'TODO',
+  extends = 'Joint'
 }
 }

+ 0 - 1
api/lovr/physics/World/destroy.lua

@@ -1,5 +1,4 @@
 return {
 return {
-  tag = 'worldBasics',
   summary = 'Destroy the World!!  Muahaha!',
   summary = 'Destroy the World!!  Muahaha!',
   description = [[
   description = [[
     Destroys the World.  This will destroy all colliders, shapes, and joints in the world.  After
     Destroys the World.  This will destroy all colliders, shapes, and joints in the world.  After

+ 0 - 1
api/lovr/physics/World/disableCollisionBetween.lua

@@ -1,5 +1,4 @@
 return {
 return {
-  tag = 'worldCollision',
   summary = 'Disable collision between two tags.',
   summary = 'Disable collision between two tags.',
   description = [[
   description = [[
     Disables collision between two tags.  Use `Collider:setTag` to set a Collider's tag.
     Disables collision between two tags.  Use `Collider:setTag` to set a Collider's tag.

+ 0 - 1
api/lovr/physics/World/enableCollisionBetween.lua

@@ -1,5 +1,4 @@
 return {
 return {
-  tag = 'worldCollision',
   summary = 'Enable collision between two tags.',
   summary = 'Enable collision between two tags.',
   description = [[
   description = [[
     Enables collision between two tags.  Use `Collider:setTag` to set a Collider's tag.
     Enables collision between two tags.  Use `Collider:setTag` to set a Collider's tag.

+ 0 - 1
api/lovr/physics/World/getAngularDamping.lua

@@ -1,6 +1,5 @@
 return {
 return {
   deprecated = true,
   deprecated = true,
-  tag = 'worldProperties',
   summary = 'Get the angular damping of the World.',
   summary = 'Get the angular damping of the World.',
   description = [[
   description = [[
     Returns the angular damping parameters of the World.  Angular damping makes things less
     Returns the angular damping parameters of the World.  Angular damping makes things less

+ 0 - 1
api/lovr/physics/World/getGravity.lua

@@ -1,5 +1,4 @@
 return {
 return {
-  tag = 'worldProperties',
   summary = 'Get the gravity of the World.',
   summary = 'Get the gravity of the World.',
   description = [[
   description = [[
     Returns the World's gravity.  Gravity is a constant acceleration applied to all colliders.  The
     Returns the World's gravity.  Gravity is a constant acceleration applied to all colliders.  The

+ 0 - 1
api/lovr/physics/World/getLinearDamping.lua

@@ -1,6 +1,5 @@
 return {
 return {
   deprecated = true,
   deprecated = true,
-  tag = 'worldProperties',
   summary = 'Get the linear damping of the World.',
   summary = 'Get the linear damping of the World.',
   description = [[
   description = [[
     Returns the linear damping parameters of the World.  Linear damping is similar to drag or air
     Returns the linear damping parameters of the World.  Linear damping is similar to drag or air

+ 0 - 9
api/lovr/physics/World/getResponseTime.lua

@@ -1,6 +1,5 @@
 return {
 return {
   deprecated = true,
   deprecated = true,
-  tag = 'worldProperties',
   summary = 'Get the response time of the World.',
   summary = 'Get the response time of the World.',
   description = [[
   description = [[
     Returns the response time factor of the World.
     Returns the response time factor of the World.
@@ -24,13 +23,5 @@ return {
       arguments = {},
       arguments = {},
       returns = { 'responseTime' }
       returns = { 'responseTime' }
     }
     }
-  },
-  related = {
-    'BallJoint:getResponseTime',
-    'BallJoint:setResponseTime',
-    'DistanceJoint:getResponseTime',
-    'DistanceJoint:setResponseTime',
-    'World:getTightness',
-    'World:setTightness'
   }
   }
 }
 }

+ 0 - 1
api/lovr/physics/World/getStepCount.lua

@@ -1,6 +1,5 @@
 return {
 return {
   deprecated = true,
   deprecated = true,
-  tag = 'worldProperties',
   summary = 'Get the step count of the World.',
   summary = 'Get the step count of the World.',
   description = [[
   description = [[
     Returns the step count of the World.  The step count influences how many steps are taken during
     Returns the step count of the World.  The step count influences how many steps are taken during

+ 0 - 1
api/lovr/physics/World/getTags.lua

@@ -1,5 +1,4 @@
 return {
 return {
-  tag = 'worldCollision',
   summary = 'Get the World\'s list of collision tags.',
   summary = 'Get the World\'s list of collision tags.',
   description = [[
   description = [[
     Returns the list of collision tags that were specified when the World was created.  Tags are
     Returns the list of collision tags that were specified when the World was created.  Tags are

+ 0 - 5
api/lovr/physics/World/getTightness.lua

@@ -1,6 +1,5 @@
 return {
 return {
   deprecated = true,
   deprecated = true,
-  tag = 'worldProperties',
   summary = 'Get the tightness of joints in the World.',
   summary = 'Get the tightness of joints in the World.',
   description = [[
   description = [[
     Returns the tightness of joints in the World.
     Returns the tightness of joints in the World.
@@ -23,9 +22,5 @@ return {
       arguments = {},
       arguments = {},
       returns = { 'tightness' }
       returns = { 'tightness' }
     }
     }
-  },
-  related = {
-    'DistanceJoint:getTightness',
-    'DistanceJoint:setTightness'
   }
   }
 }
 }

+ 0 - 1
api/lovr/physics/World/isCollisionEnabledBetween.lua

@@ -1,5 +1,4 @@
 return {
 return {
-  tag = 'worldCollision',
   summary = 'Check if two tags can collide.',
   summary = 'Check if two tags can collide.',
   description = [[
   description = [[
     Returns whether collisions are enabled between a pair of tags.
     Returns whether collisions are enabled between a pair of tags.

+ 25 - 0
api/lovr/physics/World/isDestroyed.lua

@@ -0,0 +1,25 @@
+return {
+  summary = 'Check if the World has been destroyed.',
+  description = [[
+    Returns whether the World has been destroyed.  Destroyed worlds can not be used for anything.
+  ]],
+  arguments = {},
+  returns = {
+    destroyed = {
+      type = 'boolean',
+      description = 'Whether the World has been destroyed.'
+    }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'destroyed' }
+    }
+  },
+  related = {
+    'World:destroy',
+    'Collider:isDestroyed',
+    'Shape:isDestroyed',
+    'Joint:isDestroyed'
+  }
+}

+ 0 - 1
api/lovr/physics/World/isSleepingAllowed.lua

@@ -1,6 +1,5 @@
 return {
 return {
   deprecated = true,
   deprecated = true,
-  tag = 'worldProperties',
   summary = 'Check if colliders can go to sleep.',
   summary = 'Check if colliders can go to sleep.',
   description = 'Returns whether colliders can go to sleep in the World.',
   description = 'Returns whether colliders can go to sleep in the World.',
   arguments = {},
   arguments = {},

+ 0 - 1
api/lovr/physics/World/overlapShape.lua

@@ -1,5 +1,4 @@
 return {
 return {
-  tag = 'worldQueries',
   summary = 'Find colliders that overlap a shape.',
   summary = 'Find colliders that overlap a shape.',
   description = [[
   description = [[
     - Collides a shape with the world, returning all colliders that the shape touches.
     - Collides a shape with the world, returning all colliders that the shape touches.

+ 0 - 1
api/lovr/physics/World/queryBox.lua

@@ -1,5 +1,4 @@
 return {
 return {
-  tag = 'worldQueries',
   summary = 'Find colliders that intersect an axis-aligned box.',
   summary = 'Find colliders that intersect an axis-aligned box.',
   description = [[
   description = [[
     Find colliders within an axis-aligned bounding box.  This is a fast but imprecise query that
     Find colliders within an axis-aligned bounding box.  This is a fast but imprecise query that

+ 0 - 1
api/lovr/physics/World/querySphere.lua

@@ -1,5 +1,4 @@
 return {
 return {
-  tag = 'worldQueries',
   summary = 'Find colliders that intersect a sphere.',
   summary = 'Find colliders that intersect a sphere.',
   description = [[
   description = [[
     Find colliders within a sphere.  This is a fast but imprecise query that only checks a rough box
     Find colliders within a sphere.  This is a fast but imprecise query that only checks a rough box

+ 0 - 1
api/lovr/physics/World/raycast.lua

@@ -1,5 +1,4 @@
 return {
 return {
-  tag = 'worldQueries',
   summary = 'Find colliders that intersect a line.',
   summary = 'Find colliders that intersect a line.',
   description = [[
   description = [[
     Traces a ray through the world and calls a function for each collider that was hit.
     Traces a ray through the world and calls a function for each collider that was hit.

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

@@ -1,6 +1,5 @@
 return {
 return {
   deprecated = true,
   deprecated = true,
-  tag = 'worldProperties',
   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

+ 0 - 1
api/lovr/physics/World/setGravity.lua

@@ -1,5 +1,4 @@
 return {
 return {
-  tag = 'worldProperties',
   summary = 'Set the gravity of the World.',
   summary = 'Set the gravity of the World.',
   description = [[
   description = [[
     Sets the World's gravity.  Gravity is a constant acceleration applied to all colliders.  The
     Sets the World's gravity.  Gravity is a constant acceleration applied to all colliders.  The

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

@@ -1,6 +1,5 @@
 return {
 return {
   deprecated = true,
   deprecated = true,
-  tag = 'worldProperties',
   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,

+ 0 - 9
api/lovr/physics/World/setResponseTime.lua

@@ -1,6 +1,5 @@
 return {
 return {
   deprecated = true,
   deprecated = true,
-  tag = 'worldProperties',
   summary = 'Set the response time of the World.',
   summary = 'Set the response time of the World.',
   description = [[
   description = [[
     Sets the response time factor of the World.
     Sets the response time factor of the World.
@@ -24,13 +23,5 @@ return {
       arguments = { 'responseTime' },
       arguments = { 'responseTime' },
       returns = {}
       returns = {}
     }
     }
-  },
-  related = {
-    'BallJoint:getResponseTime',
-    'BallJoint:setResponseTime',
-    'DistanceJoint:getResponseTime',
-    'DistanceJoint:setResponseTime',
-    'World:getTightness',
-    'World:setTightness'
   }
   }
 }
 }

+ 0 - 1
api/lovr/physics/World/setSleepingAllowed.lua

@@ -1,6 +1,5 @@
 return {
 return {
   deprecated = true,
   deprecated = true,
-  tag = 'worldProperties',
   summary = 'Set whether colliders can go to sleep.',
   summary = 'Set whether colliders can go to sleep.',
   description = 'Sets whether colliders can go to sleep in the World.',
   description = 'Sets whether colliders can go to sleep in the World.',
   arguments = {
   arguments = {

+ 0 - 1
api/lovr/physics/World/setStepCount.lua

@@ -1,6 +1,5 @@
 return {
 return {
   deprecated = true,
   deprecated = true,
-  tag = 'worldProperties',
   summary = 'Set the step count of the World.',
   summary = 'Set the step count of the World.',
   description = [[
   description = [[
     Sets the step count of the World.  The step count influences how many steps are taken during a
     Sets the step count of the World.  The step count influences how many steps are taken during a

+ 0 - 9
api/lovr/physics/World/setTightness.lua

@@ -1,6 +1,5 @@
 return {
 return {
   deprecated = true,
   deprecated = true,
-  tag = 'worldProperties',
   summary = 'Set the tightness of joints in the World.',
   summary = 'Set the tightness of joints in the World.',
   description = [[
   description = [[
     Sets the tightness of joints in the World.
     Sets the tightness of joints in the World.
@@ -23,13 +22,5 @@ return {
       arguments = { 'tightness' },
       arguments = { 'tightness' },
       returns = {}
       returns = {}
     }
     }
-  },
-  related = {
-    'BallJoint:getTightness',
-    'BallJoint:setTightness',
-    'DistanceJoint:getTightness',
-    'DistanceJoint:setTightness',
-    'World:getResponseTime',
-    'World:setResponseTime'
   }
   }
 }
 }

+ 1 - 2
api/lovr/physics/World/shapecast.lua

@@ -1,5 +1,4 @@
 return {
 return {
-  tag = 'worldQueries',
   summary = 'Move a shape through the world and return any colliders it touches.',
   summary = 'Move a shape through the world and return any colliders it touches.',
   description = [[
   description = [[
     Moves a shape from a starting point to an endpoint and returns any colliders it touches along
     Moves a shape from a starting point to an endpoint and returns any colliders it touches along
@@ -192,7 +191,7 @@ return {
   ]],
   ]],
   related = {
   related = {
     'World:raycast',
     'World:raycast',
-    'World:collideShape',
+    'World:overlapShape',
     'World:queryBox',
     'World:queryBox',
     'World:querySphere'
     'World:querySphere'
   }
   }

+ 0 - 1
api/lovr/physics/World/update.lua

@@ -1,5 +1,4 @@
 return {
 return {
-  tag = 'worldBasics',
   summary = 'Advance the physics simulation.',
   summary = 'Advance the physics simulation.',
   description = [[
   description = [[
     Updates the World, advancing the physics simulation forward in time and moving all the
     Updates the World, advancing the physics simulation forward in time and moving all the

+ 13 - 5
api/main.lua

@@ -120,12 +120,12 @@ local function processFunction(path, parent)
     assert(variant.returns, string.format('%q variant #%d is missing returns', fn.key, i))
     assert(variant.returns, string.format('%q variant #%d is missing returns', fn.key, i))
 
 
     for j, name in ipairs(variant.arguments) do
     for j, name in ipairs(variant.arguments) do
-      warnIf(not fn.arguments[name], string.format('Function %q variant argument %q does not exist', fn.key, name))
+      warnIf(not fn.arguments[name], string.format('%s uses unknown argument %s', fn.key, name))
       variant.arguments[j] = copy(fn.arguments[name])
       variant.arguments[j] = copy(fn.arguments[name])
     end
     end
 
 
     for j, name in ipairs(variant.returns) do
     for j, name in ipairs(variant.returns) do
-      warnIf(not fn.returns[name], string.format('Function %q variant return %q does not exist', fn.key, name))
+      warnIf(not fn.returns[name], string.format('%s uses unknown return %s', fn.key, name))
       variant.returns[j] = copy(fn.returns[name])
       variant.returns[j] = copy(fn.returns[name])
     end
     end
   end
   end
@@ -267,8 +267,8 @@ end
 -- Validation
 -- Validation
 local function validateRelated(item)
 local function validateRelated(item)
   for _, key in ipairs(item.related or {}) do
   for _, key in ipairs(item.related or {}) do
-    warnIf(not lookup[key], 'Related item for %s not found: %s', item.key, key)
-    warnIf(key == item.key, 'Item %s should not be related to itself', key)
+    warnIf(not lookup[key], '%s has unknown related item %s', item.key, key)
+    warnIf(key == item.key, '%s should not be related to itself', key)
   end
   end
 end
 end
 
 
@@ -329,6 +329,12 @@ local function validateObject(object)
       hasMethod[method.name] = true
       hasMethod[method.name] = true
     end
     end
 
 
+    if object.extends then
+      for i, method in ipairs(lookup[object.extends].methods) do
+        hasMethod[method.name] = true
+      end
+    end
+
     local ignore = {
     local ignore = {
       type = true,
       type = true,
       release = true,
       release = true,
@@ -354,7 +360,9 @@ local function validateModule(module)
 
 
   for _, fn in ipairs(module.functions) do
   for _, fn in ipairs(module.functions) do
     validateFunction(fn)
     validateFunction(fn)
-    warnIf(dev and t and not t[fn.name], '%s has docs for unknown function %s', module.key, fn.name)
+    if dev and not fn.deprecated then
+      warnIf(t and not t[fn.name], '%s has docs for unknown function %s', module.key, fn.name)
+    end
   end
   end
 
 
   for _, fn in ipairs(module.enums) do
   for _, fn in ipairs(module.enums) do

Some files were not shown because too many files changed in this diff