Skip to content

Attribute

new Attribute(array: TypedArray | number[], itemSize: number)

THREE equivalent: THREE.BufferAttribute

Typed array wrapper for vertex attributes (position, normal, uv, color). Each vertex consumes itemSize consecutive elements.

Differs from THREE.js

No GPU buffer - data is read directly by the CPU rasterizer.

Name Type Description
array Float32Array|Uint16Array|Uint32Array Backing typed array.
itemSize number Number of array elements per vertex.
count number Number of vertices (array.length / itemSize).
needsUpdate boolean Flag for external cache invalidation.
Method Description
getX(index: number): number Returns the first component at vertex index.
getY(index: number): number Returns the second component at vertex index.
getZ(index: number): number Returns the third component at vertex index.
setXYZ(index: number, x: number, y: number, z: number): this Writes three components at vertex index.
clone(): Attribute Returns a new Attribute with a copied array.