newCapsuleShape.lua 974 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. return {
  2. tag = 'shapes',
  3. summary = 'Create a new CapsuleShape.',
  4. description = 'Creates a new CapsuleShape. Capsules are cylinders with hemispheres on each end.',
  5. arguments = {
  6. radius = {
  7. type = 'number',
  8. default = '1',
  9. description = 'The radius of the capsule, in meters.'
  10. },
  11. length = {
  12. type = 'number',
  13. default = '1',
  14. description = 'The length of the capsule, not including the caps, in meters.'
  15. }
  16. },
  17. returns = {
  18. capsule = {
  19. type = 'CapsuleShape',
  20. description = 'The new CapsuleShape.'
  21. }
  22. },
  23. variants = {
  24. {
  25. arguments = { 'radius', 'length' },
  26. returns = { 'capsule' }
  27. }
  28. },
  29. notes = 'A Shape can be attached to a Collider using `Collider:addShape`.',
  30. related = {
  31. 'CapsuleShape',
  32. 'lovr.physics.newBoxShape',
  33. 'lovr.physics.newCylinderShape',
  34. 'lovr.physics.newMeshShape',
  35. 'lovr.physics.newSphereShape',
  36. 'lovr.physics.newTerrainShape'
  37. }
  38. }