Model loading · function

readModel

Read one model file into meshes.

Explained in Importing models.

function readModel(source: ModelSource): Promise<ModelImport>
import { readModel } from '@driftengine/assets';

Parameters

ParameterTypeDescription
sourceModelSource

In depth

Asynchronous because two formats may name a file beside them, and resolving that is IO whichever host is doing it. Every reader underneath stays synchronous: the sidecars are fetched first and the parse then runs in one pass, which is also what lets a caller put the whole call in a worker and keep the parse off the main thread.