Small World Engine API Reference - v0.78.00
    Preparing search index...

    Interface GltfLoaderOptions

    Specialized configuration options for glTF/GLB loaders.

    interface GltfLoaderOptions {
        assetManager?: AssetManager;
        basePath?: string;
        clampMetallic?: number | [number, number];
        clampRoughness?: number | [number, number];
        defaultMetallic?: number;
        defaultRoughness?: number;
        nodeNameTransform?: (name: string) => string;
        normalizeMixamoRig?: boolean;
        onMaterialParsed?: (
            material: StandardMaterial,
            rawDef: Record<string, unknown>,
        ) => void;
        onNodeParsed?: (object: Object3D, rawDef: Record<string, unknown>) => void;
        onParsed?: (root: Object3D) => void;
        variant?: string | number;
    }

    Hierarchy (View Summary)

    Index
    assetManager?: AssetManager

    The AssetManager instance to fetch/cache resources through. Defaults to a fresh, private instance (not the deprecated process-wide singleton) -- pass RendererContext.assetManager to share a cache/baseUrl/headers with the rest of an engine instance.

    basePath?: string

    The base path to prepend to all resource URLs. Defaults to "".

    clampMetallic?: number | [number, number]

    Maximum metallic factor (or [min, max] range) applied to parsed PBR materials.

    clampRoughness?: number | [number, number]

    Maximum roughness factor (or [min, max] range) applied to parsed PBR materials.

    defaultMetallic?: number

    Default metallic factor used when a material does not explicitly define one.

    defaultRoughness?: number

    Default roughness factor used when a material does not explicitly define one.

    nodeNameTransform?: (name: string) => string

    Optional transformation function applied to node names during glTF hierarchy parsing.

    normalizeMixamoRig?: boolean

    Whether to normalize numeric Mixamo rig prefixes (e.g. "mixamorig1:" -> "mixamorig:"). Defaults to false.

    onMaterialParsed?: (
        material: StandardMaterial,
        rawDef: Record<string, unknown>,
    ) => void

    Lifecycle hook invoked after each material is constructed from glTF PBR definitions.

    onNodeParsed?: (object: Object3D, rawDef: Record<string, unknown>) => void

    Lifecycle hook invoked after each Object3D/Bone node is parsed and transformed.

    onParsed?: (root: Object3D) => void

    Lifecycle hook invoked after the complete scene hierarchy and animations have been parsed.

    variant?: string | number

    Initial material variant name or index to activate upon loading (KHR_materials_variants).