Selva Compute API Reference - v1.1.2
    Preparing search index...

    "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

    Index

    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.

    Expects a Integer

    0
    
    isInterleavedBuffer: true
    onUploadCallback: () => void

    A callback function that is executed after the Renderer has transferred the geometry data to the GPU.

    stride: number

    The number of TypedArray elements per vertex.

    Expects a Integer

    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.

    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.

    uuid: string

    UUID of this object instance.

    This gets automatically assigned and shouldn't be edited.

    version: number

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

    Expects a Integer

    0

    Accessors

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

    • 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

    • Sets the value of the onUploadCallback property.

      Parameters

      • callback: () => void

        function that is executed after the Renderer has transferred the geometry data to the GPU.

      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

      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.

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