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

@@ -64,7 +64,7 @@ export function Lighting() {
position={position}
intensity={INTENSITY}
penumbra={1}
castShadow={cast}
// castShadow={cast}
decay={1}
color={color}
/>
@@ -28,6 +28,13 @@ export function TankModel() {
const { gltf } = useModel(protagonist.tank.id);
const nodes = Object.values(gltf.nodes);
nodes.forEach((n) => {
if (n instanceof Mesh && n.material instanceof MeshStandardMaterial) {
n.material.aoMapIntensity = 10;
console.log(n.geometry.attributes);
}
});
useTankTransform(track, turret, turretContainer, gunContainer);
return (
+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
),
};
}