InstancedBufferAttribute

An instanced version of BufferAttribute .

Core Class

An instanced version of BufferAttribute .

Type Parameters

  • T extends TypedArray = TypedArray

Hierarchy

Constructors

Properties

_array: T

The geometry attribute data store as TypedArray.

itemSize: number

If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.

normalized: boolean

If attribute data is normalized.

count: number

Stores the array's length divided by the itemSize.

If the buffer is storing a 3-component vector (such as a position, normal, or color), then this will count the number of such vectors stored.

dynamic: boolean

The data of this buffer always need update.

will not take effect, update attribute.array if need to reupload

updateRange: { offset: number; count: number }

Object containing:
offset:Integer - Default is 0. Position at which to start update.
count:Integer - Default is -1, which means don't use update ranges.

This can be used to only update some components of stored vectors (for example, just the component related to color).

will not take effect, update attribute.array instead

isBufferAttribute: boolean

Used to check type of this or extended instance. This value should not be changed by user.

isDataDropped: boolean

When the data is cleared from memory, this mark will be set true.

never updated, always false.

removeDataAfterUpload: boolean

Remove the data after it is uploaded to GPU memory.

will not take effect

version: number

A version number, incremented every time the needsUpdate property is set to true.

onUpdateCallback: () => void

A callback function for updating. It will be called after needsUpdate.

onUploadCallback: () => void

A callback function for uploading. It will be called after the data uploaded to WebGL.

meshPerAttribute: number

Defines how often a value of this buffer attribute should be repeated. A value of one means that each value of the instanced attribute is used for a single instance. A value of two means that each value is used for two consecutive instances (and so on). Default is 1.

isInstancedBufferAttribute: boolean

Used to check type of this or extended instance. This value should not be changed by user.

userData: Record<keyof any, any>
_uuid: any
uuid: string
_listeners: Map<Symbol, Listener<never>[]>

Accessors

  • get array(): T

    The geometry attribute data store as TypedArray.

    Returns T

  • set array(v: T): void

    Parameters

    Returns void

  • set needsUpdate(value: boolean): void

    When this attribute is set to true, the version will be change.

    Parameters

    • value: boolean

    Returns void

  • get businessTag(): string

    Returns string

  • set businessTag(v: string): void

    Parameters

    • v: string

    Returns void

Methods

  • Copy the data at specified position. The given index is items' index, do not need to multiply with item' size.

    Parameters

    • index1: number

      the start position of this array.

    • attribute: BufferAttribute

      the start position of this array.

    • index2: number

      the start position of source array.

    Returns this

  • Copy the data from given array to this array.

    Parameters

    • array: TypedArray | number[]

      the start position of this array.

    Returns this

  • Copy the data from given Array or typedArray.

    Parameters

    • value: ArrayLike<number>

      an Array or TypedArray from which to copy values.

    • offset: number

      (optional) index of the array at which to start copying.

    Returns this

  • Return the x component of all items.

    Parameters

    • index: number

    Returns number

  • Set the x component of the vector at the given index.

    Parameters

    • index: number
    • x: number

    Returns this

  • Return the y component of all vectors.

    Parameters

    • index: number

    Returns number

  • Set the y component of the vector at the given index.

    Parameters

    • index: number
    • y: number

    Returns this

  • Return the z component of all vectors.

    Parameters

    • index: number

    Returns number

  • Set the z component of the vector at the given index.

    Parameters

    • index: number
    • z: number

    Returns this

  • Return the w component of all vectors.

    Parameters

    • index: number

    Returns number

  • Set the w component of the vector at the given index.

    Parameters

    • index: number
    • w: number

    Returns this

  • Set the x and y component of the vector at the given index.

    Parameters

    • index: number
    • x: number
    • y: number

    Returns this

  • Set the x , y and z component of the vector at the given index.

    Parameters

    • index: number
    • x: number
    • y: number
    • z: number

    Returns this

  • Set all component of the vector at the given index.

    Parameters

    • index: number
    • x: number
    • y: number
    • z: number
    • w: number

    Returns this

  • Release the memory which is occupied by this instance from CPU and GPU.

    Returns void

  • Adds a listener to an event type.

    Type Parameters

    • T

    Parameters

    • _type: EventType<T>
    • _listener: Listener<T>

    Returns void

  • Only active the listener one times and then off it| it.

    Type Parameters

    • T

    Parameters

    • _type: EventType<T>
    • _listener: Listener<T>

    Returns void

  • Checks if listener is added to an event type.

    Type Parameters

    • T

    Parameters

    • _type: EventType<T>
    • _listener: Listener<T>

    Returns boolean

  • Removes a listener from listening list.

    Type Parameters

    • T

    Parameters

    • _type: EventType<T>
    • _listener: Listener<T>

    Returns void

  • Active the event and call the registered listener.

    Parameters

    • type: EventType<never>

    Returns void

  • Type Parameters

    • T

    Parameters

    • type: EventType<T>
    • payload: T

    Returns void