An alternative version of a buffer attribute with interleaved data. Interleaved attributes share a common interleaved data storage (InterleavedBuffer) and refer with different offsets into the buffer.
Constructs a new interleaved buffer attribute.
interleavedBuffer
The buffer holding the interleaved data.
itemSize
The item size.
offset
The attribute offset into the buffer.
normalized
Whether the data are normalized or not.
Default is false.
The array holding the interleaved buffer attribute data.
The item count of this buffer attribute.
The buffer holding the interleaved data.
This flag can be used for type testing.
Default is true.
The item size, see BufferAttribute#itemSize.
The name of the buffer attribute.
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.
Default is false.
Whether the data are normalized or not, see BufferAttribute#normalized
The attribute offset into the buffer.
Applies the given 4x4 matrix to the given attribute. Only works with item size 3.
m
The matrix to apply.
Returns: A reference to this instance.
Applies the given 3x3 normal matrix to the given attribute. Only works with item size 3.
m
The normal matrix to apply.
Returns: A reference to this instance.
Returns a new buffer attribute with copied values from this instance.
If no parameter is provided, cloning an interleaved buffer attribute will de-interleave buffer data.
data
An object with interleaved buffers that allows to retain the interleaved property.
Returns: A clone of this instance.
Returns the given component of the vector at the given index.
index
The index into the buffer attribute.
component
The component index.
Returns: The returned value.
Returns the w component of the vector at the given index.
index
The index into the buffer attribute.
Returns: The w component.
Returns the x component of the vector at the given index.
index
The index into the buffer attribute.
Returns: The x component.
Returns the y component of the vector at the given index.
index
The index into the buffer attribute.
Returns: The y component.
Returns the z component of the vector at the given index.
index
The index into the buffer attribute.
Returns: The z component.
Sets the given value to the given component of the vector at the given index.
index
The index into the buffer attribute.
component
The component index.
value
The value to set.
Returns: A reference to this instance.
Sets the w component of the vector at the given index.
index
The index into the buffer attribute.
w
The value to set.
Returns: A reference to this instance.
Sets the x component of the vector at the given index.
index
The index into the buffer attribute.
x
The value to set.
Returns: A reference to this instance.
Sets the x and y component of the vector at the given index.
index
The index into the buffer attribute.
x
The value for the x component to set.
y
The value for the y component to set.
Returns: A reference to this instance.
Sets the x, y and z component of the vector at the given index.
index
The index into the buffer attribute.
x
The value for the x component to set.
y
The value for the y component to set.
z
The value for the z component to set.
Returns: A reference to this instance.
Sets the x, y, z and w component of the vector at the given index.
index
The index into the buffer attribute.
x
The value for the x component to set.
y
The value for the y component to set.
z
The value for the z component to set.
w
The value for the w component to set.
Returns: A reference to this instance.
Sets the y component of the vector at the given index.
index
The index into the buffer attribute.
y
The value to set.
Returns: A reference to this instance.
Sets the z component of the vector at the given index.
index
The index into the buffer attribute.
z
The value to set.
Returns: A reference to this instance.
Serializes the buffer attribute into JSON.
If no parameter is provided, cloning an interleaved buffer attribute will de-interleave buffer data.
data
An optional value holding meta information about the serialization.
Returns: A JSON object representing the serialized buffer attribute.
Applies the given 4x4 matrix to the given attribute. Only works with item size 3 and with direction vectors.
m
The matrix to apply.
Returns: A reference to this instance.