feat: rewrite some systems

This commit is contained in:
TrèsAbhi committed 2025-09-05 23:34:59 -05:00
1 parent 95fa5bc1a5
commit 335cd4d699
11 files changed
+212 -107

No files matched your search

+6 -6
View File
@@ -1,7 +1,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 { type ObjectMap, useLoader } from "@react-three/fiber";
import { Mesh, MeshStandardMaterial } from "three";
import { type GLTF, GLTFLoader } from "three-stdlib";
const cache: Record<
number,
@@ -12,7 +11,8 @@ const cache: Record<
> = {};
export function useModel(id: number) {
const gltf = useLoader(GLTFLoader, asset(`3d/tanks/models/${id}.glb`));
// const gltf = useLoader(GLTFLoader, asset(`3d/tanks/models/${id}.glb`));
const gltf = useLoader(GLTFLoader, `/test.glb`);
if (!cache[id]) {
cache[id] = {
@@ -21,7 +21,7 @@ export function useModel(id: number) {
(node) =>
node instanceof Mesh &&
node.material instanceof MeshStandardMaterial &&
node.material.roughnessMap !== null,
node.material.roughnessMap !== null
),
};
}