InterleavedBufferAttribute

构造函数

InterleavedBufferAttribute(interleavedBuffer : InterleavedBuffer, itemSize : Integer, offset : Integer, normalized : Boolean)

属性

.data : InterleavedBuffer

传入构造函数的 InterleavedBuffer 实例。

.array : TypedArray

data.array 的值。

.count : Integer

data.count 的值。 所缓存的矢量的个数。如果缓存的矢量是一个三元组(例如,位置、法向量或颜色),则该值计算上述三元组的个数。

.itemSize : Integer

队列中每个矢量有多少个元素构成。

.name : String

Optional name for this attribute instance. Default is an empty string.

.needsUpdate : Boolean

Default is false. Setting this to true will send the entire interleaved buffer (not just the specific attribute data) to the GPU again.

.normalized : Boolean

默认值为 false

.offset : Integer

缓存队列中每个元素的起始位置的偏移量。

方法

.applyMatrix4(m : Matrix4) → this

Applies matrix m to every Vector3 element of this InterleavedBufferAttribute.

.getX(index : Integer) → Number

返回给定索引矢量的第一个元素 (X 值)。

.getY(index : Integer) → Number

返回给定索引矢量的第二个元素 (Y 值)。

.getZ(index : Integer) → Number

返回给定索引矢量的第三个元素 (Z 值)。

.getW(index : Integer) → Number

返回给定索引矢量的第四个元素 (W 值)。

.setX(index : Integer, x : Float) → null

通过给定参数,设置指定索引矢量的第一个元素 (X 值)。

.setY(index : Integer, y : Float) → null

通过给定参数,设置指定索引矢量的第二个元素 (Y 值)。

.setZ(index : Integer, z : Float) → null

通过给定参数,设置指定索引矢量的第三个元素 (Z 值)。

.setW(index : Integer, w : Float) → null

通过给定参数,设置指定索引矢量的第四个元素 (W 值)。

.setXY(index : Integer, x : Float, y : Float) → null

通过给定参数,设置指定索引矢量的第一、二个元素 (X 和 Y 值)。

.setXYZ(index : Integer, x : Float, y : Float, z : Float) → null

通过给定参数,设置指定索引矢量的第一、二、三个元素 (X Y 和 Z 值)。

.setXYZW(index : Integer, x : Float, y : Float, z : Float, w : Float) → null

通过给定参数,设置指定索引矢量的第一、二、三、四个元素 (X Y Z 和 W 值)。

源代码

src/core/InterleavedBufferAttribute.js