InterleavedBuffer.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. 定义数据存储的预期使用模式,以实现优化目的。对应 [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]() 的 *usage* 参数。
  58. </p>
  59. <h2>方法</h2>
  60. <h3>[method:this addUpdateRange]( [param:Integer start], [param:Integer count] )</h3>
  61. <p>
  62. 在数据数组中添加要在 GPU 上更新的数据范围。将描述该范围的对象添加到 [page:InterleavedBuffer.updateRanges updateRanges] 数组。
  63. </p>
  64. <h3>[method:this clearUpdateRanges]()</h3>
  65. <p>
  66. 清除 [page:InterleavedBuffer.updateRanges updateRanges] 数组。
  67. </p>
  68. <h3>[method:this copy]( [param:InterleavedBuffer source] ) </h3>
  69. <p>
  70. 将参数指定的 [name] 拷贝到当前 [name]。
  71. </p>
  72. <h3>[method:this copyAt]( [param:Integer index1], [param:InterleavedBuffer attribute], [param:Integer index2] ) </h3>
  73. <p> 将数据从 attribute[index2] 拷贝到 [page:InterleavedBuffer.array array][index1]。</p>
  74. <h3>[method:this set]( [param:TypedArray value], [param:Integer offset] ) </h3>
  75. <p>
  76. value - 被拷贝的源(类型化)队列。<br/>
  77. offset - 源队列中,数据开始拷贝的偏移量。默认值是 *0*.<br/><br />
  78. 将源队列数据拷贝到目标队列缓存中。
  79. </p>
  80. <h3>[method:InterleavedBuffer clone]( [param:Object data] ) </h3>
  81. <p>
  82. data - 该对象保存正确克隆具有交错属性的几何图形所需的共享数组缓冲区。<br/><br />
  83. 创建此 [name] 的克隆。
  84. </p>
  85. <h3>[method:this setUsage] ( [param:Usage value] ) </h3>
  86. <p>设置 [page:InterleavedBuffer.usage usage] 的值。</p>
  87. <h3>[method:Object toJSON]( [param:Object data] ) </h3>
  88. <p>
  89. data - 该对象包含正确序列化具有交错属性的几何图形所需的共享数组缓冲区。<br/><br />
  90. 序列化这个 [name]。
  91. </p>
  92. <h2>源代码</h2>
  93. <p>
  94. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  95. </p>
  96. </body>
  97. </html>
粤ICP备19079148号