newDistanceJoint.lua 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. return {
  2. tag = 'joints',
  3. summary = 'Create a new DistanceJoint.',
  4. description = 'Creates a new DistanceJoint.',
  5. arguments = {
  6. {
  7. name = 'colliderA',
  8. type = 'Collider',
  9. description = 'The first collider to attach the Joint to.'
  10. },
  11. {
  12. name = 'colliderB',
  13. type = 'Collider',
  14. description = 'The second collider to attach the Joint to.'
  15. },
  16. {
  17. name = 'x1',
  18. type = 'number',
  19. description = 'The x position of the first anchor point, in world coordinates.'
  20. },
  21. {
  22. name = 'y1',
  23. type = 'number',
  24. description = 'The y position of the first anchor point, in world coordinates.'
  25. },
  26. {
  27. name = 'z1',
  28. type = 'number',
  29. description = 'The z position of the first anchor point, in world coordinates.'
  30. },
  31. {
  32. name = 'x2',
  33. type = 'number',
  34. description = 'The x position of the second anchor point, in world coordinates.'
  35. },
  36. {
  37. name = 'y2',
  38. type = 'number',
  39. description = 'The y position of the second anchor point, in world coordinates.'
  40. },
  41. {
  42. name = 'z2',
  43. type = 'number',
  44. description = 'The z position of the second anchor point, in world coordinates.'
  45. }
  46. },
  47. returns = {
  48. {
  49. name = 'joint',
  50. type = 'DistanceJoint',
  51. description = 'The new DistanceJoint.'
  52. }
  53. },
  54. notes = [[
  55. A distance joint tries to keep the two colliders a fixed distance apart. The distance is
  56. determined by the initial distance between the anchor points. The joint allows for rotation on
  57. the anchor points.
  58. ]],
  59. related = {
  60. 'lovr.physics.newBallJoint',
  61. 'lovr.physics.newHingeJoint',
  62. 'lovr.physics.newSliderJoint'
  63. }
  64. }