newMeshShape.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. return {
  2. tag = 'shapes',
  3. summary = 'Create a new MeshShape.',
  4. description = 'Creates a new MeshShape.',
  5. arguments = {
  6. vertices = {
  7. type = 'table',
  8. description = 'The table of vertices in the mesh. Each vertex is a table with 3 numbers.'
  9. },
  10. indices = {
  11. type = 'table',
  12. description = [[
  13. A table of triangle indices representing how the vertices are connected in the Mesh.
  14. ]]
  15. },
  16. model = {
  17. type = 'Model',
  18. description = [[
  19. A Model to use for the mesh data. Similar to calling `Model:getTriangles` and passing it to
  20. this function, but has better performance.
  21. ]]
  22. }
  23. },
  24. returns = {
  25. mesh = {
  26. type = 'MeshShape',
  27. description = 'The new MeshShape.'
  28. }
  29. },
  30. variants = {
  31. {
  32. arguments = { 'vertices', 'indices' },
  33. returns = { 'mesh' }
  34. },
  35. {
  36. arguments = { 'model' },
  37. returns = { 'mesh' }
  38. }
  39. },
  40. notes = 'A Shape can be attached to a Collider using `Collider:addShape`.',
  41. related = {
  42. 'MeshShape',
  43. 'lovr.physics.newBoxShape',
  44. 'lovr.physics.newCapsuleShape',
  45. 'lovr.physics.newCylinderShape',
  46. 'lovr.physics.newSphereShape',
  47. 'lovr.physics.newTerrainShape',
  48. 'Model:getTriangles'
  49. }
  50. }