feat: remove draco

This commit is contained in:
tresabhi committed 2024-11-11 12:50:33 -06:00
1 parent 970d93e7e0
commit 48dd9bec2a
3 files changed
+2 -29

No files matched your search

+1 -11
View File
@@ -2,7 +2,6 @@ import { asset } from '@blitzkit/core';
import { type ObjectMap, useLoader } from '@react-three/fiber';
import { Mesh, MeshStandardMaterial } from 'three';
import { type GLTF, GLTFLoader } from 'three-stdlib';
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';
const cache: Record<
number,
@@ -13,16 +12,7 @@ const cache: Record<
> = {};
export function useModel(id: number) {
const gltf = useLoader(
GLTFLoader,
asset(`3d/tanks/models/${id}.glb`),
(loader) => {
const dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath('https://www.gstatic.com/draco/v1/decoders/');
// @ts-ignore
loader.setDRACOLoader(dracoLoader);
},
);
const gltf = useLoader(GLTFLoader, asset(`3d/tanks/models/${id}.glb`));
if (!cache[id]) {
cache[id] = {