InterleavedBuffer.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. <h1>[name]</h1>
  12. <div class="desc">
  13. "Interleaved" means that multiple types of data (position, color etc.) are packed into a single array buffer.
  14. Organizing geometry data in this way improves memory locality. By keeping vertex data close together, it is more likely
  15. that also caches (e.g. pre-transform vertex cache) store logically related data together. This leads to more cache hits and a better performance.
  16. <br/><br/>
  17. An introduction into interleaved arrays can be found here: [link:https://blog.tojicode.com/2011/05/interleaved-array-basics.html Interleaved array basics]
  18. </div>
  19. <h2>Example</h2>
  20. <div>[example:webgl_buffergeometry_points_interleaved webgl / buffergeometry / points / interleaved]</div>
  21. <h2>Constructor</h2>
  22. <h3>[name]( [page:TypedArray array], [page:Integer stride] )</h3>
  23. <div>
  24. [page:TypedArray array] -- A typed array with a shared buffer. Stores the geometry data.<br/>
  25. [page:Integer stride] -- How far apart is the start of each vertex.
  26. </div>
  27. <h2>Properties</h2>
  28. <h3>[property:Array array]</h3>
  29. <div>
  30. A typed array with a shared buffer. Stores the geometry data.
  31. </div>
  32. <h3>[property:Integer stride]</h3>
  33. <div>
  34. How far apart is the start of each vertex.
  35. </div>
  36. <h3>[property:Integer count]</h3>
  37. <div>
  38. Gives the total number of elements in the array.
  39. </div>
  40. <h3>[property:Boolean dynamic]</h3>
  41. <div>
  42. Default is *false*.
  43. </div>
  44. <h3>[property:Object updateRange]</h3>
  45. <div>
  46. Object containing offset and count.
  47. </div>
  48. <h3>[property:Number updateRange.offset]</h3>
  49. <div>
  50. Default is *0*.
  51. </div>
  52. <h3>[property:Number updateRange.count]</h3>
  53. <div>
  54. Default is *-1*.
  55. </div>
  56. <h3>[property:Integer version]</h3>
  57. <div>
  58. A version number, incremented every time the needsUpdate property is set to true.
  59. </div>
  60. <h3>[property:Integer isInterleavedBuffer]</h3>
  61. <div>
  62. Default is *true*.
  63. </div>
  64. <h3>[property:Integer needsUpdate]</h3>
  65. <div>
  66. Default is *false*. Setting this to true increments [page:InterleavedBuffer.version version].
  67. </div>
  68. <h2>Methods</h2>
  69. <h3>[method:null setArray] ( [page:TypedArray array] ) </h3>
  70. <div>
  71. array - must be a Typed Array.
  72. </div>
  73. <h3>[method:InterleavedBuffer setDynamic] ( [page:Boolean value] ) </h3>
  74. <div>
  75. Set [page:InterleavedBuffer.dynamic dynamic] to value.
  76. </div>
  77. <h3>[method:InterleavedBuffer copy]( source ) </h3>
  78. <div>
  79. Copies another [name] to this [name].
  80. </div>
  81. <h3>[method:InterleavedBuffer copyAt]( index1, attribute, index2 ) </h3>
  82. <div>Copies data from attribute[index2] to [page:InterleavedBuffer.array array][index1].</div>
  83. <h3>[method:InterleavedBuffer set]( value, offset ) </h3>
  84. <div>
  85. value - The source (typed) array.<br/>
  86. offset - The offset into the target array at which to begin writing values from the source array. Default is *0*.<br/><br />
  87. Stores multiple values in the buffer, reading input values from a specified array.
  88. </div>
  89. <h3>[method:InterleavedBuffer clone]() </h3>
  90. <div>
  91. Creates a clone of this [name].
  92. </div>
  93. <h2>Source</h2>
  94. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  95. </body>
  96. </html>