"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

Hierarchy (view full)

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

array: TypedArray

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

count: number

Gives the total number of elements in the array.

Remarks

Expects a Integer

Default Value

0
stride: number

The number of TypedArray elements per vertex.

Remarks

Expects a Integer

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

Object containing offset and count.

Type declaration

  • count: number

    Default Value

    -1

  • offset: number

    Default Value

    0

Default Value

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

Deprecated

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

updateRanges: {
    count: number;
    start: 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

  • count: number

    The number of components to update.

  • start: number

    Position at which to start update.

usage: Usage

Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the usage parameter of WebGLRenderingContext.bufferData.

Remarks

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.

See

Default Value

{@link THREE.StaticDrawUsage | THREE.StaticDrawUsage}.
uuid: string

UUID of this object instance.

Remarks

This gets automatically assigned and shouldn't be edited.

version: number

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

Remarks

Expects a Integer

Default Value

0

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

    Remarks

    Setting this to true also increments the version.

Methods

  • 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

  • Creates a clone of this InterleavedBuffer.

    Parameters

    • data: {}

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

      Returns InterleavedBuffer

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

      Parameters

      Returns this

    • 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

      Throws

      RangeError When offset is negative or is too large.

    • Set usage

      Parameters

      Returns this

      Remarks

      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.

      See

    • 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 {
            buffer: string;
            stride: number;
            type: string;
            uuid: string;
        }

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