import Mesh, { MeshOpts } from './Mesh'; import BoundingBox from './math/BoundingBox'; import type ClayNode from './Node'; import type { AttributeSize, AttributeType, AttributeValue } from './GeometryBase'; import Material from './Material'; import Geometry from './Geometry'; interface InstancedAttribute { name: string; type: AttributeType; size: AttributeSize; divisor: number; value?: AttributeValue; } interface Instance { node: ClayNode; } interface InstancedMeshOpts extends MeshOpts { /** * Instances array. Each object in array must have node property * @example * const node = new clay.Node() * instancedMesh.instances.push({ * node: node * }); */ instances: Instance[]; } interface InstancedMesh extends InstancedMeshOpts { } declare class InstancedMesh extends Mesh { instances: Instance[]; instancedAttributes: Record; boundingBox?: BoundingBox; private _attributesNames; __dirty: boolean; constructor(geometry: Geometry, material: T, opts?: Partial); isInstancedMesh(): boolean; getInstanceCount(): number; removeAttribute(name: string): void; createInstancedAttribute(name: string, type: AttributeType, size: AttributeSize, divisor: number): void; getInstancedAttributes(): string[]; update(): void; } export default InstancedMesh;