InterleavedBuffer.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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,
  13. (e.g., position, normal, uv, color) are packed into a single array buffer.
  14. <br /><br />
  15. An introduction into interleaved arrays can be found here:
  16. [link:https://blog.tojicode.com/2011/05/interleaved-array-basics.html Interleaved array basics]
  17. </p>
  18. <h2>Examples</h2>
  19. <p>
  20. [example:webgl_buffergeometry_points_interleaved webgl / buffergeometry / points / interleaved]
  21. </p>
  22. <h2>Constructor</h2>
  23. <h3>[name]( [param:TypedArray array], [param:Integer stride] )</h3>
  24. <p>
  25. [page:TypedArray array] -- A typed array with a shared buffer. Stores the
  26. geometry data.<br />
  27. [page:Integer stride] -- The number of typed-array elements per vertex.
  28. </p>
  29. <h2>Properties</h2>
  30. <h3>[property:Array array]</h3>
  31. <p>A typed array with a shared buffer. Stores the geometry data.</p>
  32. <h3>[property:Integer stride]</h3>
  33. <p>The number of typed-array elements per vertex.</p>
  34. <h3>[property:Integer count]</h3>
  35. <p>Gives the total number of elements in the array.</p>
  36. <h3>[property:Object updateRanges]</h3>
  37. <p>
  38. Array of objects containing:<br />
  39. [page:Integer start]: Position at which to start
  40. update.<br />
  41. [page:Integer count]: The number of components to update. <br /><br />
  42. This can be used to only update some components of stored data. Use
  43. the [page:InterleavedBuffer.addUpdateRange addUpdateRange] function
  44. to add ranges to this array.
  45. </p>
  46. <h3>[property:String uuid]</h3>
  47. <p>
  48. [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of
  49. this instance. This gets automatically assigned, so this shouldn't be
  50. edited.
  51. </p>
  52. <h3>[property:Integer version]</h3>
  53. <p>
  54. A version number, incremented every time the needsUpdate property is set
  55. to true.
  56. </p>
  57. <h3>[property:Boolean needsUpdate]</h3>
  58. <p>
  59. Default is `false`. Setting this to true increments
  60. [page:InterleavedBuffer.version version].
  61. </p>
  62. <h3>[property:Usage usage]</h3>
  63. <p>
  64. Defines the intended usage pattern of the data store for optimization
  65. purposes. Corresponds to the `usage` parameter of
  66. [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
  67. </p>
  68. <h2>Methods</h2>
  69. <h3>[method:this addUpdateRange]( [param:Integer start], [param:Integer count] )</h3>
  70. <p>
  71. Adds a range of data in the data array to be updated on the GPU. Adds an
  72. object describing the range to the [page:InterleavedBuffer.updateRanges updateRanges]
  73. array.
  74. </p>
  75. <h3>[method:this clearUpdateRanges]()</h3>
  76. <p>
  77. Clears the [page:InterleavedBuffer.updateRanges updateRanges] array.
  78. </p>
  79. <h3>[method:this copy]( [param:InterleavedBuffer source] )</h3>
  80. <p>Copies another [name] to this [name].</p>
  81. <h3>[method:this copyAt]( [param:Integer index1], [param:InterleavedBuffer attribute], [param:Integer index2] )</h3>
  82. <p>
  83. Copies data from `attribute[index2]` to [page:InterleavedBuffer.array array][index1].
  84. </p>
  85. <h3>[method:this set]( [param:TypedArray value], [param:Integer offset] )</h3>
  86. <p>
  87. value - The source (typed) array.<br />
  88. offset - The offset into the target array at which to begin writing values
  89. from the source array. Default is `0`.<br /><br />
  90. Stores multiple values in the buffer, reading input values from a
  91. specified array.
  92. </p>
  93. <h3>[method:InterleavedBuffer clone]( [param:Object data] )</h3>
  94. <p>
  95. data - This object holds shared array buffers required for properly
  96. cloning geometries with interleaved attributes.<br /><br />
  97. Creates a clone of this [name].
  98. </p>
  99. <h3>[method:this setUsage] ( [param:Usage value] )</h3>
  100. <p>Set [page:InterleavedBuffer.usage usage] to value.</p>
  101. <h3>[method:Object toJSON]( [param:Object data] )</h3>
  102. <p>
  103. data - This object holds shared array buffers required for properly
  104. serializing geometries with interleaved attributes.<br /><br />
  105. Serializes this [name].
  106. </p>
  107. <h2>Source</h2>
  108. <p>
  109. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  110. </p>
  111. </body>
  112. </html>