mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
aliases
This commit is contained in:
1 parent
13cda7aec0
commit
b26c5137f3
53 files changed
+236
-932
No files matched your search
@@ -1,10 +1,11 @@
|
||||
import { alias } 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 = `/api/tanks/${id}/model.glb`;
|
||||
const path = alias("api", `/tanks/${id}/model.glb`);
|
||||
const gltf = useLoader(GLTFLoader, path);
|
||||
|
||||
useDispose(gltf, path);
|
||||
|
||||
Reference in new issue
Block a user