import type { Material } from "../materials/Material.ts"; import type { Frustum } from "../math/Frustum.ts"; import { Matrix4 } from "../math/Matrix4.ts"; import { Vector3 } from "../math/Vector3.ts"; import { DrawCall } from "./DrawCall.ts"; import type { DrawList } from "./DrawList.ts"; import { TriangleBuffer } from "./TriangleBuffer.ts"; interface InstancedNode { matrixWorld: Matrix4; geometry: GeometryLike; material: Material & { color?: { r: number; g: number; b: number; }; }; instanceMatrix: Float32Array; instanceColor: Float32Array | undefined; count: number; frustumCulled: boolean; _instProjVerts?: Float32Array[]; _instWorldPos?: Float32Array[]; _instTriBuf?: TriangleBuffer[]; _instDrawCalls?: DrawCall[]; _instMaterials?: (Material & { color?: { r: number; g: number; b: number; }; })[]; _instMaterialBaseId?: number; _instWorldNormals?: Float32Array[]; _instWorldNormalKey?: Float32Array[]; } interface GeometryLike { boundingSphere?: { centre: Vector3; radius: number; }; computeBoundingSphere?: () => void; getAttribute: (name: string) => AttributeLike | undefined; index?: { array: ArrayLike; } | ArrayLike; _sequentialIndices?: Uint32Array; } interface AttributeLike { array: Float32Array; itemSize?: number; } interface CameraLike { matrixWorldInverse: Matrix4; projectionMatrix: Matrix4; position?: { x: number; y: number; z: number; }; } interface FogState { hasFog: boolean; fogFar: number; } type AssembleTrianglesFn = (indices: ArrayLike, verts: Float32Array, worldNormals: Float32Array, uvs: Float32Array, width: number, height: number, material: Material, node: { _triangleBuffer?: TriangleBuffer; }) => TriangleBuffer; type BuildUvsFn = (node: { geometry: GeometryLike; }) => Float32Array; /** * Builds one DrawCall per visible instance in an InstancedMesh. * Extracted from SceneTraversal to keep the hot class monomorphic and * avoid V8 deoptimisation of the entire traversal path. */ export declare function buildInstancedDrawCalls(node: InstancedNode, camera: CameraLike, frustum: Frustum, width: number, height: number, drawList: DrawList, fogState: FogState, assembleTrianglesFn: AssembleTrianglesFn, buildUvsFn: BuildUvsFn): void; export {}; //# sourceMappingURL=InstancedMeshBuilder.d.ts.map