Skip to content
On this page

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 ​

NameTypeDescription
dataArrayBufferThe new data to update the ArrayBuffer.

Returns ​

Accessor

Defined in ​

websg.d.ts:93