newBallJoint.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. return {
  2. tag = 'joints',
  3. summary = 'Create a new BallJoint.',
  4. description = 'Creates a new BallJoint.',
  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. x = {
  15. type = 'number',
  16. description = 'The x position of the joint anchor point, in world coordinates.'
  17. },
  18. y = {
  19. type = 'number',
  20. description = 'The y position of the joint anchor point, in world coordinates.'
  21. },
  22. z = {
  23. type = 'number',
  24. description = 'The z position of the joint anchor point, in world coordinates.'
  25. },
  26. anchor = {
  27. type = 'Vec3',
  28. description = 'The joint anchor point, in world coordinates.'
  29. }
  30. },
  31. returns = {
  32. ball = {
  33. type = 'BallJoint',
  34. description = 'The new BallJoint.'
  35. }
  36. },
  37. variants = {
  38. {
  39. arguments = { 'colliderA', 'colliderB', 'x', 'y', 'z' },
  40. returns = { 'ball' }
  41. },
  42. {
  43. arguments = { 'colliderA', 'colliderB', 'anchor' },
  44. returns = { 'ball' }
  45. }
  46. },
  47. notes = [[
  48. A ball joint is like a ball and socket between the two colliders. It tries to keep the distance
  49. between the colliders and the anchor position the same, but does not constrain the angle between
  50. them.
  51. ]],
  52. related = {
  53. 'lovr.physics.newDistanceJoint',
  54. 'lovr.physics.newHingeJoint',
  55. 'lovr.physics.newSliderJoint'
  56. }
  57. }