Class: Accessor
WebSG.Accessor
The Accessor class provides a way to update a given ArrayBuffer with new data.
Table of contents
Constructors
Methods
Constructors
constructor
• new Accessor()
Methods
updateWith
▸ updateWith(data
): Accessor
Updates the existing ArrayBuffer with new data.
Example
ts
// Create an instance of Accessor
const accessor = world.createAccessorFrom(buffer, {
componentType: WebSG.AccessorComponentType.Uint16,
count: indicesCount,
type: WebSG.AccessorType.SCALAR,
});
// Update the ArrayBuffer with new data
accessor.updateWith(newData);
Parameters
Name | Type | Description |
---|---|---|
data | ArrayBuffer | The new data to update the ArrayBuffer. |