init.lua 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. return {
  2. tag = 'modules',
  3. summary = 'Simulates 3D physics.',
  4. description = 'The `lovr.physics` module simulates 3D rigid body physics.',
  5. sections = {
  6. {
  7. name = 'Worlds',
  8. tag = 'world',
  9. description = [[
  10. A physics World holds all of the colliders and joints in the simulation. It must be updated
  11. every frame using `World:update`, during which it will move all the colliders and resolve
  12. collisions between them.
  13. ]]
  14. },
  15. {
  16. name = 'Colliders',
  17. tag = 'colliders',
  18. description = [[
  19. Colliders are objects that represent a single rigid body in the physics simulation. They can
  20. have forces applied to them and collide with other colliders.
  21. ]]
  22. },
  23. {
  24. name = 'Shapes',
  25. tag = 'shapes',
  26. description = [[
  27. Shapes are 3D physics shapes that can be attached to colliders. Shapes define, well, the
  28. shape of a Collider and how it collides with other objects. Without any Shapes, a collider
  29. wouldn't collide with anything.
  30. Normally, you don't need to create Shapes yourself, as there are convenience functions on
  31. the World that will create colliders with shapes already attached. However, you can attach
  32. multiple Shapes to a collider to create more complicated objects, and sometimes it can be
  33. useful to access the individual Shapes on a collider.
  34. ]]
  35. },
  36. {
  37. name = 'Joints',
  38. tag = 'joints',
  39. description = [[
  40. Joints are objects that constrain the movement of colliders in various ways. Joints are
  41. attached to two colliders when they're created and usually have a concept of an "anchor",
  42. which is where the Joint is attached to relative to the colliders. Joints can be used to
  43. create all sorts of neat things like doors, drawers, buttons, levers, or pendulums.
  44. ]]
  45. }
  46. }
  47. }