getTriangles.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. return {
  2. summary = 'Get all the triangles in the model.',
  3. description = [[
  4. Returns the data for all triangles in the model. There are a few differences between this and
  5. the mesh-specific functions like `ModelData:getMeshVertex` and `ModelData:getMeshIndex`:
  6. - Only vertex positions are returned, not other vertex attributes.
  7. - Positions are relative to the origin of the whole model, instead of local to a node.
  8. - If a mesh is attached to more than one node, its vertices will be in the table multiple times.
  9. - Vertex indices will be relative to the whole triangle list instead of a mesh.
  10. ]],
  11. arguments = {},
  12. returns = {
  13. vertices = {
  14. type = 'table',
  15. description = [[
  16. The triangle vertex positions, returned as a flat (non-nested) table of numbers. The
  17. position of each vertex is given as an x, y, and z coordinate.
  18. ]]
  19. },
  20. indices = {
  21. type = 'table',
  22. description = 'The vertex indices. Every 3 indices describes a triangle.'
  23. }
  24. },
  25. variants = {
  26. {
  27. arguments = {},
  28. returns = { 'vertices', 'indices' }
  29. }
  30. },
  31. notes = 'After this function is called on a ModelData once, the result is cached.',
  32. related = {
  33. 'ModelData:getTriangleCount',
  34. 'ModelData:getVertexCount',
  35. 'Model:getTriangles'
  36. }
  37. }