[name]

"交叉存储" 表明多个类型的 attributes (例如,顶点位置、法向量、UV 和颜色值)被存储到一个队列中。

如下链接有对交叉存储更详细的介绍: [link:https://blog.tojicode.com/2011/05/interleaved-array-basics.html Interleaved array basics]

例子

[example:webgl_buffergeometry_points_interleaved webgl / buffergeometry / points / interleaved]

构造函数

[name]( [param:TypedArray array], [param:Integer stride] )

[page:TypedArray array] -- 一个基于共享缓存的类型化队列。该队列存储几何体相关数据。
[page:Integer stride] -- 每个顶点占用类型化队列的多少个元素。

属性

[property:Array array]

一个基于共享缓存的类型化队列。该队列存储几何体相关数据。

[property:Integer stride]

每个顶点占用类型化队列的多少个元素。

[property:Integer count]

类型化队列中,所有元素的数目。

[property:Object updateRange]

对象存储着需要更新的数据的偏移量和数量。

[property:Number updateRange.offset]

默认值为 *0*。

[property:Number updateRange.count]

默认值为 *-1*。

[property:String uuid]

该类所创建的实例的[link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID]。它是自动被指定的,因此它不应当被编辑、更改。

[property:Integer version]

版本号,每次 needsUpdate 属性设置为 true 时,版本号增加。

[property:Integer needsUpdate]

默认值为 *false*。该值被设置为 true 时,会导致 [page:InterleavedBuffer.version version] 增加。

[property:Usage usage]

Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the *usage* parameter of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().

方法

[method:this copy]( [param:InterleavedBuffer source] )

将参数指定的 [name] 拷贝到当前 [name]。

[method:this copyAt]( [param:Integer index1], [param:InterleavedBuffer attribute], [param:Integer index2] )

将数据从 attribute[index2] 拷贝到 [page:InterleavedBuffer.array array][index1]。

[method:this set]( [param:TypedArray value], [param:Integer offset] )

value - 被拷贝的源(类型化)队列。
offset - 源队列中,数据开始拷贝的偏移量。默认值是 *0*.

将源队列数据拷贝到目标队列缓存中。

[method:InterleavedBuffer clone]( [param:Object data] )

data - This object holds shared array buffers required for properly cloning geometries with interleaved attributes.

Creates a clone of this [name].

[method:this setUsage] ( [param:Usage value] )

Set [page:InterleavedBuffer.usage usage] to value.

[method:Object toJSON]( [param:Object data] )

data - This object holds shared array buffers required for properly serializing geometries with interleaved attributes.

Serializes this [name].

源代码

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]