Add loader to lib

This commit is contained in:
DefectingCat
2022-10-18 16:26:17 +08:00
parent 5a1b95bd7c
commit dcd6b7ea6a
3 changed files with 17 additions and 19 deletions

12
lib/gltfLoader.ts Normal file
View File

@ -0,0 +1,12 @@
import { THREE } from 'rua-three';
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
const manager = new THREE.LoadingManager();
const gltfLoader = new GLTFLoader(manager);
const dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath('./libs/draco/');
dracoLoader.setDecoderConfig({ type: 'wasm' });
gltfLoader.setDRACOLoader(dracoLoader);
export { manager, gltfLoader, dracoLoader };