newHingeJoint.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. return {
  2. tag = 'joints',
  3. summary = 'Create a new HingeJoint.',
  4. description = 'Creates a new HingeJoint.',
  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 = 'x',
  18. type = 'number',
  19. description = 'The x position of the hinge anchor, in world coordinates.'
  20. },
  21. {
  22. name = 'y',
  23. type = 'number',
  24. description = 'The y position of the hinge anchor, in world coordinates.'
  25. },
  26. {
  27. name = 'z',
  28. type = 'number',
  29. description = 'The z position of the hinge anchor, in world coordinates.'
  30. },
  31. {
  32. name = 'ax',
  33. type = 'number',
  34. description = 'The x component of the hinge axis.'
  35. },
  36. {
  37. name = 'ay',
  38. type = 'number',
  39. description = 'The y component of the hinge axis.'
  40. },
  41. {
  42. name = 'az',
  43. type = 'number',
  44. description = 'The z component of the hinge axis.'
  45. }
  46. },
  47. returns = {
  48. {
  49. name = 'hinge',
  50. type = 'HingeJoint',
  51. description = 'The new HingeJoint.'
  52. }
  53. },
  54. notes = [[
  55. A hinge joint constrains two colliders to allow rotation only around the hinge's axis.
  56. ]],
  57. related = {
  58. 'lovr.physics.newBallJoint',
  59. 'lovr.physics.newDistanceJoint',
  60. 'lovr.physics.newSliderJoint'
  61. }
  62. }