mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
equipment icons
This commit is contained in:
1 parent
487d149587
commit
e5e747f7a0
3 files changed
+100
-9
No files matched your search
@@ -1,11 +1,10 @@
|
||||
import { asset } from "@blitzkit/core";
|
||||
import { useLoader } from "@react-three/fiber";
|
||||
import { Mesh, MeshStandardMaterial } from "three";
|
||||
import { GLTFLoader } from "three-stdlib";
|
||||
import { useDispose } from "./useDispose";
|
||||
|
||||
export function useModel(id: number) {
|
||||
const path = asset(`3d/tanks/models/${id}.glb`);
|
||||
const path = `/api/tanks/${id}/model.glb`;
|
||||
const gltf = useLoader(GLTFLoader, path);
|
||||
|
||||
useDispose(gltf, path);
|
||||
|
||||
Reference in new issue
Block a user