setVertices.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. return {
  2. summary = 'Set vertices in the Mesh.',
  3. description = 'Sets the data for vertices in the Mesh.',
  4. arguments = {
  5. vertices = {
  6. type = 'table',
  7. description = [[
  8. A table of vertices, where each vertex is a table of numbers matching the vertex format of
  9. the Mesh.
  10. ]]
  11. },
  12. blob = {
  13. type = 'Blob',
  14. description = 'A Blob containing binary vertex data.'
  15. },
  16. index = {
  17. type = 'number',
  18. default = '1',
  19. description = 'The index of the first vertex to return.'
  20. },
  21. count = {
  22. type = 'number',
  23. default = 'nil',
  24. description = [[
  25. The number of vertices to return. If nil, returns the "rest" of the vertices, based on the
  26. `index` argument.
  27. ]]
  28. }
  29. },
  30. returns = {},
  31. variants = {
  32. {
  33. arguments = { 'vertices', 'index', 'count' },
  34. returns = {}
  35. },
  36. {
  37. arguments = { 'blob', 'index', 'count' },
  38. returns = {}
  39. }
  40. },
  41. notes = [[
  42. CPU meshes will write the data to CPU memory and upload any changes to the GPU before the Mesh
  43. is drawn. GPU meshes don't store this CPU copy of the data, and will immediately upload the new
  44. vertex data to VRAM. This means that multiple calls to this function might be slower on a `gpu`
  45. mesh.
  46. ]],
  47. related = {
  48. 'Mesh:getVertexBuffer',
  49. 'Mesh:getVertexFormat',
  50. 'Mesh:getIndices',
  51. 'Mesh:setIndices'
  52. }
  53. }