playcanvas-opti-pixel - v1.2.0
    Preparing search index...

    Interface IAABBStore

    Interface for AABB (Axis-Aligned Bounding Box) store management

    interface IAABBStore {
        capacity: number;
        centersData: Float32Array;
        centersTexture: Texture;
        halfExtentsData: Float32Array;
        halfExtentsTexture: Texture;
        hasTextures: boolean;
        indexManager: IndexManager;
        version: number;
        destroy(): void;
        enqueueUpdate(
            index: number,
            boundingBox: BoundingBox,
            matrix?: Mat4,
            extra1?: number,
            extra2?: number,
        ): void;
        get(index: number, boundingBox: BoundingBox): BoundingBox;
        getMatrix(index: number, matrixData: Float32Array): void;
        lock(
            boundingBox: BoundingBox,
            matrix?: Mat4,
            extra1?: number,
            extra2?: number,
        ): number;
        lockMinMaxScalars(
            data: ArrayLike<number>,
            offset: number,
            matrix?: Mat4,
            extra1?: number,
            extra2?: number,
        ): number;
        unlock(index: number): void;
        update(): void;
    }
    Index
    capacity: number

    Maximum number of AABBs the store can hold.

    centersData: Float32Array

    CPU packed centers (xyz + extra1 per index).

    centersTexture: Texture

    Texture containing AABB centers. Created on first access; until then the store keeps CPU arrays only.

    halfExtentsData: Float32Array

    CPU packed half extents (xyz + extra2 per index).

    halfExtentsTexture: Texture

    Texture containing AABB half extents. Created on first access; until then the store keeps CPU arrays only.

    hasTextures: boolean

    True after both GPU textures were created by accessing centersTexture or halfExtentsTexture.

    indexManager: IndexManager

    Index manager

    version: number

    Increments when AABB CPU data changes (lock, update, resize).

    • Enqueues an update for a bounding box

      Parameters

      • index: number

        Index of the bounding box to update

      • boundingBox: BoundingBox

        New bounding box data

      • Optionalmatrix: Mat4

        Optional transformation matrix

      • Optionalextra1: number

        Extra parameter 1

      • Optionalextra2: number

        Extra parameter 2

      Returns void

    • Gets the bounding box data by its index

      Parameters

      • index: number

        Index of the bounding box

      • boundingBox: BoundingBox

        Bounding box object to store the result

      Returns BoundingBox

      The bounding box

    • Gets the transformation matrix data for a bounded box

      Parameters

      • index: number

        Index of the bounding box

      • matrixData: Float32Array

        Float32Array to store the matrix data

      Returns void

    • Locks a bounding box and returns its index

      Parameters

      • boundingBox: BoundingBox

        The bounding box to lock

      • Optionalmatrix: Mat4

        Optional transformation matrix

      • Optionalextra1: number

        Extra parameter 1 (usage depends on implementation)

      • Optionalextra2: number

        Extra parameter 2 (usage depends on implementation)

      Returns number

      Index of the locked bounding box

    • Locks a bounding box using min and max scalar values and returns its index

      Parameters

      • data: ArrayLike<number>

        The array containing the bounding box data (min and max points) in local or world coordinates [minX, maxX, minY, maxY, minZ, maxZ]

      • offset: number

        The offset in the array where the bounding box data starts

      • Optionalmatrix: Mat4

        Optional transformation matrix

      • Optionalextra1: number

        Extra parameter 1 (usage depends on implementation)

      • Optionalextra2: number

        Extra parameter 2 (usage depends on implementation)

      Returns number

      Index of the locked bounding box

    • Unlocks a bounding box by its index

      Parameters

      • index: number

        Index of the bounding box to unlock

      Returns void

    • Updates the stored data and synchronizes it across all sources when needed, including CPU, GPU, and any other backing representations.

      Returns void