Skip to content

⬅️ Back to Table of Contents

📄 InstancedInterleavedBuffer.js

📊 Analysis Summary

Metric Count
🔧 Functions 3
🧱 Classes 1
📦 Imports 1

📚 Table of Contents

🛠️ File Location:

📂 src/core/InstancedInterleavedBuffer.js

📦 Imports

Name Source
InterleavedBuffer ./InterleavedBuffer.js

Functions

InstancedInterleavedBuffer.copy(source: any): this

Parameters:

  • source any

Returns: this

Calls:

  • super.copy
Code
copy( source ) {

        super.copy( source );

        this.meshPerAttribute = source.meshPerAttribute;

        return this;

    }

InstancedInterleavedBuffer.clone(data: any): InterleavedBuffer

Parameters:

  • data any

Returns: InterleavedBuffer

Calls:

  • super.clone
Code
clone( data ) {

        const ib = super.clone( data );

        ib.meshPerAttribute = this.meshPerAttribute;

        return ib;

    }

InstancedInterleavedBuffer.toJSON(data: any): any

Parameters:

  • data any

Returns: any

Calls:

  • super.toJSON
Code
toJSON( data ) {

        const json = super.toJSON( data );

        json.isInstancedInterleavedBuffer = true;
        json.meshPerAttribute = this.meshPerAttribute;

        return json;

    }

Classes

InstancedInterleavedBuffer

Class Code
class InstancedInterleavedBuffer extends InterleavedBuffer {

    /**
     * Constructs a new instanced interleaved buffer.
     *
     * @param {TypedArray} array - A typed array with a shared buffer storing attribute data.
     * @param {number} stride - The number of typed-array elements per vertex.
     * @param {number} [meshPerAttribute=1] - Defines how often a value of this interleaved buffer should be repeated.
     */
    constructor( array, stride, meshPerAttribute = 1 ) {

        super( array, stride );

        /**
         * This flag can be used for type testing.
         *
         * @type {boolean}
         * @readonly
         * @default true
         */
        this.isInstancedInterleavedBuffer = true;

        /**
         * Defines how often a value of this buffer attribute should be repeated,
         * see {@link InstancedBufferAttribute#meshPerAttribute}.
         *
         * @type {number}
         * @default 1
         */
        this.meshPerAttribute = meshPerAttribute;

    }

    copy( source ) {

        super.copy( source );

        this.meshPerAttribute = source.meshPerAttribute;

        return this;

    }

    clone( data ) {

        const ib = super.clone( data );

        ib.meshPerAttribute = this.meshPerAttribute;

        return ib;

    }

    toJSON( data ) {

        const json = super.toJSON( data );

        json.isInstancedInterleavedBuffer = true;
        json.meshPerAttribute = this.meshPerAttribute;

        return json;

    }

}

Methods

copy(source: any): this
Code
copy( source ) {

        super.copy( source );

        this.meshPerAttribute = source.meshPerAttribute;

        return this;

    }
clone(data: any): InterleavedBuffer
Code
clone( data ) {

        const ib = super.clone( data );

        ib.meshPerAttribute = this.meshPerAttribute;

        return ib;

    }
toJSON(data: any): any
Code
toJSON( data ) {

        const json = super.toJSON( data );

        json.isInstancedInterleavedBuffer = true;
        json.meshPerAttribute = this.meshPerAttribute;

        return json;

    }