InterleavedBuffer.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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 updateRange]</h3>
  37. <p>
  38. Object containing offset and count.<br />
  39. - [page:Number offset]: Default is `0`.<br />
  40. - [page:Number count]: Default is `-1`.<br />
  41. </p>
  42. <h3>[property:String uuid]</h3>
  43. <p>
  44. [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of
  45. this instance. This gets automatically assigned, so this shouldn't be
  46. edited.
  47. </p>
  48. <h3>[property:Integer version]</h3>
  49. <p>
  50. A version number, incremented every time the needsUpdate property is set
  51. to true.
  52. </p>
  53. <h3>[property:Boolean needsUpdate]</h3>
  54. <p>
  55. Default is `false`. Setting this to true increments
  56. [page:InterleavedBuffer.version version].
  57. </p>
  58. <h3>[property:Usage usage]</h3>
  59. <p>
  60. Defines the intended usage pattern of the data store for optimization
  61. purposes. Corresponds to the `usage` parameter of
  62. [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
  63. </p>
  64. <h2>Methods</h2>
  65. <h3>[method:this copy]( [param:InterleavedBuffer source] )</h3>
  66. <p>Copies another [name] to this [name].</p>
  67. <h3>[method:this copyAt]( [param:Integer index1], [param:InterleavedBuffer attribute], [param:Integer index2] )</h3>
  68. <p>
  69. Copies data from `attribute[index2]` to [page:InterleavedBuffer.array array][index1].
  70. </p>
  71. <h3>[method:this set]( [param:TypedArray value], [param:Integer offset] )</h3>
  72. <p>
  73. value - The source (typed) array.<br />
  74. offset - The offset into the target array at which to begin writing values
  75. from the source array. Default is `0`.<br /><br />
  76. Stores multiple values in the buffer, reading input values from a
  77. 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
  82. cloning geometries with interleaved attributes.<br /><br />
  83. Creates a clone of this [name].
  84. </p>
  85. <h3>[method:this setUsage] ( [param:Usage value] )</h3>
  86. <p>Set [page:InterleavedBuffer.usage usage] to value.</p>
  87. <h3>[method:Object toJSON]( [param:Object data] )</h3>
  88. <p>
  89. data - This object holds shared array buffers required for properly
  90. serializing geometries with interleaved attributes.<br /><br />
  91. Serializes this [name].
  92. </p>
  93. <h2>Source</h2>
  94. <p>
  95. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  96. </p>
  97. </body>
  98. </html>