UNPKG

@tolokoban/tgd

Version:

ToloGameDev library for WebGL2

42 lines 1.48 kB
import { TgdContext } from "../context"; import { TgdMaterial } from "../material"; import { TgdVec4 } from "../math"; import { TgdPainterNode } from "../painter"; import { TgdDataGlb } from "../parser"; import { TgdTexture2D } from "../texture"; import { TgdFormatGltfMesh, TgdFormatGltfMeshPrimitive, TgdFormatGltfNode } from "../types"; interface OverrideMaterialOptions { data: TgdDataGlb; mesh: TgdFormatGltfMesh; primitive: TgdFormatGltfMeshPrimitive; } type MaterialOverrider = (options: OverrideMaterialOptions) => (this: void, options: { color?: TgdVec4 | TgdTexture2D; }) => TgdMaterial; interface MakeMeshGlbPainterOptions { data: TgdDataGlb; context: TgdContext; node: number | string | TgdFormatGltfNode; overrideMaterial?: MaterialOverrider; /** * If defined, we skip all primitive with a material's name in the list. */ excludeByMaterialName?: string[]; /** * If defined, we skip all primitives with a material's name NOT in the list. */ includeOnlyMaterialNames?: string[]; } /** * Create a `TgdPainterNode` from a node hierarchy from a GLTF structure. * @param options * * `data`: a GLTF parser * * `context`: we will create painters, so we need a TgdContext * * `node`: the root node you want to paint. * @returns */ export declare function tgdMakeMeshGlbPainter(options: MakeMeshGlbPainterOptions): { painter: TgdPainterNode; }; export {}; //# sourceMappingURL=mesh-glb.d.ts.map