UNPKG

lingo3d

Version:

Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor

25 lines 912 B
import { getExtensionIncludingObjectURL } from "../../core/utils/objectURL"; import { increaseLoadingCount, decreaseLoadingCount } from "../../../states/useLoadingCount"; const supported = new Set(["fbx", "glb", "gltf"]); export default async (url, clone) => { increaseLoadingCount(); const extension = getExtensionIncludingObjectURL(url); if (!extension || !supported.has(extension)) { decreaseLoadingCount(); throw new Error("Unsupported file extension " + extension); } const module = extension === "fbx" ? await import("./loadFBX") : await import("./loadGLTF"); let result; try { result = await module.default(url, clone); } catch { decreaseLoadingCount(); throw new Error("Failed to load model, check if src is correct"); } decreaseLoadingCount(); return result; }; //# sourceMappingURL=loadModel.js.map