init.lua 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. return {
  2. summary = 'An independent physics simulation.',
  3. description = [[
  4. A World is an object that holds the colliders, joints, and shapes in a physics simulation.
  5. ]],
  6. constructor = 'lovr.physics.newWorld',
  7. sections = {
  8. {
  9. name = 'Basics',
  10. tag = 'worldBasics'
  11. },
  12. {
  13. name = 'Colliders',
  14. tag = 'colliders',
  15. description = [[
  16. The following functions add Colliders to the World. `World:newCollider` adds an "empty"
  17. Collider without any Shapes attached, whereas the other functions are shortcut functions to
  18. add Colliders with Shapes already attached to them.
  19. ]]
  20. },
  21. {
  22. name = 'Properties',
  23. tag = 'worldProperties',
  24. description = [[
  25. The following functions are global properties of the simulation that apply to all new
  26. Colliders.
  27. ]]
  28. },
  29. {
  30. name = 'Collision',
  31. tag = 'worldCollision',
  32. description = [[
  33. When the World is created using `lovr.physics.newWorld`, it is possible to specify a list of
  34. collision tags for the World. Colliders can then be assigned a tag. You can enable and
  35. disable collision between pairs of tags. There are also some helper functions to quickly
  36. identify pairs of colliders that are near each other and test whether or not they are
  37. colliding. These are used internally by default by `World:update`, but you can override
  38. this behavior and use the functions directly for custom collision behavior.
  39. ]]
  40. }
  41. },
  42. notes = [[
  43. Be sure to update the World in `lovr.update` using `World:update`, otherwise everything will
  44. stand still.
  45. ]]
  46. }