getVertices.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. return {
  2. summary = 'Get the vertices in the Mesh.',
  3. description = 'Returns the vertices in the Mesh.',
  4. arguments = {
  5. index = {
  6. type = 'number',
  7. default = '1',
  8. description = 'The index of the first vertex to return.'
  9. },
  10. count = {
  11. type = 'number',
  12. default = 'nil',
  13. description = [[
  14. The number of vertices to return. If nil, returns the "rest" of the vertices, based on the
  15. `index` argument.
  16. ]]
  17. }
  18. },
  19. returns = {
  20. vertices = {
  21. type = 'table',
  22. description = [[
  23. A table of vertices. Each vertex is a table of numbers for each vertex attribute, given by
  24. the vertex format of the Mesh.
  25. ]]
  26. }
  27. },
  28. variants = {
  29. {
  30. arguments = { 'index', 'count' },
  31. returns = { 'vertices' }
  32. }
  33. },
  34. notes = [[
  35. > **This function will be very very slow if the storage mode of the Mesh is `gpu`, because the
  36. > data will be downloaded from VRAM. A better option is to call `Buffer:newReadback` on the
  37. > Mesh's underlying vertex buffer (`Mesh:getVertexBuffer`), which will download in the
  38. > background instead of waiting for it to complete.**
  39. ]],
  40. related = {
  41. 'Mesh:getVertexBuffer',
  42. 'Mesh:getVertexFormat',
  43. 'Mesh:getIndices',
  44. 'Mesh:setIndices'
  45. }
  46. }