interface IPatch {
    clearInstances(): void;
    createInstances(
        baseMesh: { distance: number; mesh: TransformNode }[],
    ): void;
    getCurrentMesh(): TransformNode;
    getLodMeshes(): TransformNode[];
    getNbInstances(): number;
    handleLod(distance: number): void;
    isEnabled(): boolean;
    setEnabled(enabled: boolean): void;
}

Hierarchy

  • IDisposable
    • IPatch

Methods

  • Clears all instances from the patch. They will be disposed and will not render anymore. The copy of the given base mesh will also be disposed. The matrix buffer will be kept though, which means that calling createInstances() will reuse the same buffer.

    Returns void

  • Creates instances of a copy of the given base mesh (or transform node in the case of HierarchyInstancePatch). The instances will be positioned according to the matrix buffer given in the constructor.

    Parameters

    • baseMesh: { distance: number; mesh: TransformNode }[]

      The mesh to create instances from.

    Returns void

    Error if baseMesh is not a Mesh in the case of InstancePatch and ThinInstancePatch.