newDistanceJoint.lua 2.0 KB

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