Files
blitzkit/packages/website/src/hooks/useArmor.ts
T

19 lines
523 B
TypeScript
Raw Normal View History

2026-08-08 20:45:09 -05:00
import { alias } from "@blitzkit/core";
2026-05-12 17:54:50 -05:00
import { useLoader } from "@react-three/fiber";
import { GLTFLoader } from "three-stdlib";
import { useDispose } from "./useDispose";
2024-01-22 15:42:49 -06:00
2024-01-16 13:16:06 -06:00
export function useArmor(id: number) {
2026-08-08 20:45:09 -05:00
const path = alias("api", `/tanks/${id}/collision.glb`);
2026-05-12 17:54:50 -05:00
const gltf = useLoader(GLTFLoader, path);
2024-12-13 16:45:59 -06:00
2026-05-12 17:54:50 -05:00
useDispose(gltf, path);
return {
gltf,
hasDynamicArmor: Object.values(gltf.nodes).some(
(node) =>
node.name.includes("state_00") || node.name.includes("state_01"),
),
};
2024-01-16 13:16:06 -06:00
}