Class InterleavedBuffer

"Interleaved" means that multiple attributes, possibly of different types, (e.g., position, normal, uv, color) are packed into a single array buffer.
An introduction into interleaved arrays can be found here: Interleaved array basics

Constructors

  • Create a new instance of InterleavedBuffer

    Parameters

    • array: TypedArray

      A TypedArray with a shared buffer. Stores the geometry data.

    • stride: number

      The number of typed-array elements per vertex. Expects a Integer

    Returns InterleavedBuffer

Properties

isInterleavedBuffer: true
array: TypedArray

A TypedArray with a shared buffer. Stores the geometry data.

stride: number

The number of TypedArray elements per vertex.

Expects a Integer

usage: Usage

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.

THREE.StaticDrawUsage | THREE.StaticDrawUsage.

updateRange: {
    offset: number;
    count: number;
}

Object containing offset and count.

Type declaration

  • offset: number

    0

  • count: number

    -1

{ offset: number = 0; count: number = -1 }

Will be removed in r169. Use "addUpdateRange()" instead.

updateRanges: {
    start: number;
    count: number;
}[]

This can be used to only update some components of stored data. Use the .addUpdateRange function to add
ranges to this array.

Type declaration

  • start: number

    Position at which to start update.

  • count: number

    The number of components to update.

version: number

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

Expects a Integer

0

count: number

Gives the total number of elements in the array.

Expects a Integer

0
uuid: string

UUID of this object instance.

This gets automatically assigned and shouldn't be edited.

Accessors

  • set needsUpdate(value): void
  • 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.

    Parameters

    • value: boolean

    Returns void

    Setting this to true also increments the version.

Methods

  • Calls TypedArray.set( value, offset )
    on the array.

    Parameters

    • value: ArrayLike<number>

      The source TypedArray.

    • offset: number

      index of the array at which to start copying. Expects a Integer. Default 0.

    Returns this

    RangeError When offset is negative or is too large.

  • Set usage

    Parameters

    Returns this

    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.

  • 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.

    Parameters

    • start: number
    • count: number

    Returns void

  • Clears the .updateRanges array.

    Returns void

  • Copies data from attribute[index2] to array[index1].

    Parameters

    Returns this

  • Creates a clone of this InterleavedBuffer.

    Parameters

    • data: {}

      This object holds shared array buffers required for properly cloning geometries with interleaved attributes.

      Returns InterleavedBuffer

    • Serializes this InterleavedBuffer.
      Converting to JSON Geometry format v4,

      Parameters

      • data: {}

        This object holds shared array buffers required for properly serializing geometries with interleaved attributes.

        Returns {
            uuid: string;
            buffer: string;
            type: string;
            stride: number;
        }

        • uuid: string
        • buffer: string
        • type: string
        • stride: number