InterleavedBuffer.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <p class="desc">
  12. "Interleaved" means that multiple attributes, possibly of different types, (e.g., position, normal, uv, color) are packed into a single array buffer.
  13. <br/><br/>
  14. An introduction into interleaved arrays can be found here: [link:https://blog.tojicode.com/2011/05/interleaved-array-basics.html Interleaved array basics]
  15. </p>
  16. <h2>Examples</h2>
  17. <p>[example:webgl_buffergeometry_points_interleaved webgl / buffergeometry / points / interleaved]</p>
  18. <h2>Constructor</h2>
  19. <h3>[name]( [param:TypedArray array], [param:Integer stride] )</h3>
  20. <p>
  21. [page:TypedArray array] -- A typed array with a shared buffer. Stores the geometry data.<br/>
  22. [page:Integer stride] -- The number of typed-array elements per vertex.
  23. </p>
  24. <h2>Properties</h2>
  25. <h3>[property:Array array]</h3>
  26. <p>
  27. A typed array with a shared buffer. Stores the geometry data.
  28. </p>
  29. <h3>[property:Integer stride]</h3>
  30. <p>
  31. The number of typed-array elements per vertex.
  32. </p>
  33. <h3>[property:Integer count]</h3>
  34. <p>
  35. Gives the total number of elements in the array.
  36. </p>
  37. <h3>[property:Object updateRange]</h3>
  38. <p>
  39. Object containing offset and count.
  40. </p>
  41. <h3>[property:Number updateRange.offset]</h3>
  42. <p>
  43. Default is *0*.
  44. </p>
  45. <h3>[property:Number updateRange.count]</h3>
  46. <p>
  47. Default is *-1*.
  48. </p>
  49. <h3>[property:String uuid]</h3>
  50. <p>
  51. [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this instance. This gets automatically assigned, so this shouldn't be edited.
  52. </p>
  53. <h3>[property:Integer version]</h3>
  54. <p>
  55. A version number, incremented every time the needsUpdate property is set to true.
  56. </p>
  57. <h3>[property:Boolean needsUpdate]</h3>
  58. <p>
  59. Default is *false*. Setting this to true increments [page:InterleavedBuffer.version version].
  60. </p>
  61. <h3>[property:Usage usage]</h3>
  62. <p>
  63. Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the *usage* parameter of
  64. [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
  65. </p>
  66. <h2>Methods</h2>
  67. <h3>[method:InterleavedBuffer copy]( [param:InterleavedBuffer source] ) </h3>
  68. <p>
  69. Copies another [name] to this [name].
  70. </p>
  71. <h3>[method:InterleavedBuffer copyAt]( [param:Integer index1], [param:InterleavedBuffer attribute], [param:Integer index2] ) </h3>
  72. <p>Copies data from attribute[index2] to [page:InterleavedBuffer.array array][index1].</p>
  73. <h3>[method:InterleavedBuffer set]( [param:TypedArray value], [param:Integer offset] ) </h3>
  74. <p>
  75. value - The source (typed) array.<br/>
  76. offset - The offset into the target array at which to begin writing values from the source array. Default is *0*.<br/><br />
  77. Stores multiple values in the buffer, reading input values from a specified array.
  78. </p>
  79. <h3>[method:InterleavedBuffer clone]( [param:Object data] ) </h3>
  80. <p>
  81. data - This object holds shared array buffers required for properly cloning geometries with interleaved attributes.<br/><br />
  82. Creates a clone of this [name].
  83. </p>
  84. <h3>[method:InterleavedBuffer setUsage] ( [param:Usage value] ) </h3>
  85. <p>Set [page:InterleavedBuffer.usage usage] to value.</p>
  86. <h3>[method:InterleavedBuffer toJSON]( [param:Object data] ) </h3>
  87. <p>
  88. data - This object holds shared array buffers required for properly serializing geometries with interleaved attributes.<br/><br />
  89. Serializes this [name].
  90. </p>
  91. <h2>Source</h2>
  92. <p>
  93. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  94. </p>
  95. </body>
  96. </html>