InterleavedBuffer.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. 对象存储着需要更新的数据的偏移量和数量。
  40. </p>
  41. <h3>[property:Number updateRange.offset]</h3>
  42. <p>
  43. 默认值为 *0*。
  44. </p>
  45. <h3>[property:Number updateRange.count]</h3>
  46. <p>
  47. 默认值为 *-1*。
  48. </p>
  49. <h3>[property:String uuid]</h3>
  50. <p>
  51. 该类所创建的实例的[link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID]。它是自动被指定的,因此它不应当被编辑、更改。
  52. </p>
  53. <h3>[property:Integer version]</h3>
  54. <p>
  55. 版本号,每次 needsUpdate 属性设置为 true 时,版本号增加。
  56. </p>
  57. <h3>[property:Integer needsUpdate]</h3>
  58. <p>
  59. 默认值为 *false*。该值被设置为 true 时,会导致 [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>方法</h2>
  67. <h3>[method:InterleavedBuffer copy]( [param:InterleavedBuffer source] ) </h3>
  68. <p>
  69. 将参数指定的 [name] 拷贝到当前 [name]。
  70. </p>
  71. <h3>[method:InterleavedBuffer copyAt]( [param:Integer index1], [param:InterleavedBuffer attribute], [param:Integer index2] ) </h3>
  72. <p> 将数据从 attribute[index2] 拷贝到 [page:InterleavedBuffer.array array][index1]。</p>
  73. <h3>[method:InterleavedBuffer set]( [param:TypedArray value], [param:Integer offset] ) </h3>
  74. <p>
  75. value - 被拷贝的源(类型化)队列。<br/>
  76. offset - 源队列中,数据开始拷贝的偏移量。默认值是 *0*.<br/><br />
  77. 将源队列数据拷贝到目标队列缓存中。
  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>源代码</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>