The TypedArray holding data stored in the buffer.
ReadonlycountConfigures the bound GPU type for use in shaders. Either FloatType or IntType, default is FloatType.
Note: this only has an effect for integer arrays and is not configurable for float arrays. For lower precision float types, see https://threejs.org/docs/#api/en/core/bufferAttributeTypes/BufferAttributeTypes.
ReadonlyidUnique number for this attribute instance.
ReadonlyisRead-only flag to check if a given object is of type BufferAttribute.
ReadonlyisThe length of vectors that are being stored in the array.
Optional name for this attribute instance.
Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
A callback function that is executed after the Renderer has transferred the attribute array data to the GPU.
This can be used to only update some components of stored vectors (for example, just the component related to color). Use the .addUpdateRange function to add ranges to this array.
The number of components to update.
Position at which to start update.
Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of WebGLRenderingContext.bufferData.
After the initial use of a buffer, its usage cannot be changed. Instead, instantiate a new one and set the desired usage before the next render.
A version number, incremented every time the needsUpdate property is set to true.
Flag to indicate that this attribute has changed and should be re-sent to the GPU. Set this to true when you modify the value of the array.
Setting this to true also increments the version.
Adds a range of data in the data array to be updated on the GPU. Adds an object describing the range to the .updateRanges array.
Applies normal matrix m to every Vector3 element of this BufferAttribute.
Clears the .updateRanges array.
a copy of this BufferAttribute.
Copies another BufferAttribute to this BufferAttribute.
Copy the array given here (which can be a normal array or TypedArray) into array.
TypedArray.set for notes on requirements if copying a TypedArray.
Copy a vector from bufferAttribute[index2] to array[index1].
Returns the given component of the vector at the given index.
Returns the w component of the vector at the given index.
Expects a Integer
Returns the x component of the vector at the given index.
Expects a Integer
Returns the y component of the vector at the given index.
Expects a Integer
Returns the z component of the vector at the given index.
Expects a Integer
Sets the value of the onUploadCallback property.
function that is executed after the Renderer has transferred the attribute array data to the GPU.
Calls TypedArray.set( value, offset ) on the array.
Array | Array or TypedArray from which to copy values.
Optionaloffset: numberindex of the array at which to start copying. Expects a Integer. Default 0.
RangeError When offset is negative or is too large.
Sets the given component of the vector at the given index.
Set usage
After the initial use of a buffer, its usage cannot be changed. Instead, instantiate a new one and set the desired usage before the next render.
Sets the w component of the vector at the given index.
Expects a Integer
Sets the x component of the vector at the given index.
Expects a Integer
Sets the x and y components of the vector at the given index.
Expects a Integer
Sets the x, y and z components of the vector at the given index.
Expects a Integer
Sets the x, y, z and w components of the vector at the given index.
Expects a Integer
Sets the y component of the vector at the given index.
Expects a Integer
Sets the z component of the vector at the given index.
Expects a Integer
Convert this object to three.js to the data.attributes part of JSON Geometry format v4,
Applies matrix m to every Vector3 element of this BufferAttribute, interpreting the elements as a direction vectors.
This class stores data for an attribute (such as vertex positions, face indices, normals, colors, UVs, and any custom attributes ) associated with a THREE.BufferGeometry | BufferGeometry, which allows for more efficient passing of data to the GPU
Remarks
When working with vector-like data, the
.fromBufferAttribute( attribute, index )helper methods on THREE.Vector2.fromBufferAttribute | Vector2, THREE.Vector3.fromBufferAttribute | Vector3, THREE.Vector4.fromBufferAttribute | Vector4, and THREE.Color.fromBufferAttribute | Color classes may be helpful.See