newHingeJoint.lua 1.8 KB

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