InterleavedBuffer.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <!DOCTYPE html>
  2. <html lang="zh">
  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. "交叉存储" 表明多个类型的 attributes (例如,顶点位置、法向量、UV 和颜色值)被存储到一个队列中。
  13. <br/><br/>
  14. 如下链接有对交叉存储更详细的介绍: [link:https://blog.tojicode.com/2011/05/interleaved-array-basics.html Interleaved array basics]
  15. </p>
  16. <h2>例子</h2>
  17. <p>[example:webgl_buffergeometry_points_interleaved webgl / buffergeometry / points / interleaved]</p>
  18. <h2>构造函数</h2>
  19. <h3>[name]( [param:TypedArray array], [param:Integer stride] )</h3>
  20. <p>
  21. [page:TypedArray array] -- 一个基于共享缓存的类型化队列。该队列存储几何体相关数据。<br/>
  22. [page:Integer stride] -- 每个顶点占用类型化队列的多少个元素。
  23. </p>
  24. <h2>属性</h2>
  25. <h3>[property:Array array]</h3>
  26. <p>
  27. 一个基于共享缓存的类型化队列。该队列存储几何体相关数据。
  28. </p>
  29. <h3>[property:Integer stride]</h3>
  30. <p>
  31. 每个顶点占用类型化队列的多少个元素。
  32. </p>
  33. <h3>[property:Integer count]</h3>
  34. <p>
  35. 类型化队列中,所有元素的数目。
  36. </p>
  37. <h3>[property:Object updateRange]</h3>
  38. <p>
  39. 对象存储着需要更新的数据的偏移量和数量。<br />
  40. - [page:Number offset]: 默认值为 *0*。<br />
  41. - [page:Number count]: 默认值为 *-1*。<br />
  42. </p>
  43. <h3>[property:String uuid]</h3>
  44. <p>
  45. 该类所创建的实例的[link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID]。它是自动被指定的,因此它不应当被编辑、更改。
  46. </p>
  47. <h3>[property:Integer version]</h3>
  48. <p>
  49. 版本号,每次 needsUpdate 属性设置为 true 时,版本号增加。
  50. </p>
  51. <h3>[property:Integer needsUpdate]</h3>
  52. <p>
  53. 默认值为 *false*。该值被设置为 true 时,会导致 [page:InterleavedBuffer.version version] 增加。
  54. </p>
  55. <h3>[property:Usage usage]</h3>
  56. <p>
  57. Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the *usage* parameter of
  58. [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
  59. </p>
  60. <h2>方法</h2>
  61. <h3>[method:this copy]( [param:InterleavedBuffer source] ) </h3>
  62. <p>
  63. 将参数指定的 [name] 拷贝到当前 [name]。
  64. </p>
  65. <h3>[method:this copyAt]( [param:Integer index1], [param:InterleavedBuffer attribute], [param:Integer index2] ) </h3>
  66. <p> 将数据从 attribute[index2] 拷贝到 [page:InterleavedBuffer.array array][index1]。</p>
  67. <h3>[method:this set]( [param:TypedArray value], [param:Integer offset] ) </h3>
  68. <p>
  69. value - 被拷贝的源(类型化)队列。<br/>
  70. offset - 源队列中,数据开始拷贝的偏移量。默认值是 *0*.<br/><br />
  71. 将源队列数据拷贝到目标队列缓存中。
  72. </p>
  73. <h3>[method:InterleavedBuffer clone]( [param:Object data] ) </h3>
  74. <p>
  75. data - This object holds shared array buffers required for properly cloning geometries with interleaved attributes.<br/><br />
  76. Creates a clone of this [name].
  77. </p>
  78. <h3>[method:this setUsage] ( [param:Usage value] ) </h3>
  79. <p>Set [page:InterleavedBuffer.usage usage] to value.</p>
  80. <h3>[method:Object toJSON]( [param:Object data] ) </h3>
  81. <p>
  82. data - This object holds shared array buffers required for properly serializing geometries with interleaved attributes.<br/><br />
  83. Serializes this [name].
  84. </p>
  85. <h2>源代码</h2>
  86. <p>
  87. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  88. </p>
  89. </body>
  90. </html>