From 19fdb087c55d2b2cd9509f07809087373ea9e8f6 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sun, 29 Nov 2026 17:48:25 -0600 Subject: [PATCH] remove TransitionSkeleton --- .../components/TransitionSkeleton/index.tsx | 153 ------------------ .../TransitionSkeleton/shaders/fragment.glsl | 11 -- .../TransitionSkeleton/shaders/vertex.glsl | 19 --- 3 files changed, 183 deletions(-) delete mode 100644 packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TransitionSkeleton/index.tsx delete mode 100644 packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TransitionSkeleton/shaders/fragment.glsl delete mode 100644 packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TransitionSkeleton/shaders/vertex.glsl diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TransitionSkeleton/index.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TransitionSkeleton/index.tsx deleted file mode 100644 index 5171f6258..000000000 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TransitionSkeleton/index.tsx +++ /dev/null @@ -1,153 +0,0 @@ -import { useRef } from "react"; -import { Group, ShaderMaterial, UniformsLib, UniformsUtils } from "three"; -import { correctZYTuple } from "../../../../../../../core/blitz/correctZYTuple"; -import { jsxTree } from "../../../../../../../core/blitzkit/jsxTree"; -import { useArmor } from "../../../../../../../hooks/useArmor"; -import { useModel } from "../../../../../../../hooks/useModel"; -import { useTankModelDefinition } from "../../../../../../../hooks/useTankModelDefinition"; -import { useTankTransform } from "../../../../../../../hooks/useTankTransform"; -import { Duel } from "../../../../../../../stores/duel"; -import { ModelTankWrapper } from "../../../../../../Armor/components/ModelTankWrapper"; -import fragmentShader from "./shaders/fragment.glsl?raw"; -import vertexShader from "./shaders/vertex.glsl?raw"; - -const skeletonMaterial = new ShaderMaterial({ - vertexShader, - fragmentShader, - wireframe: true, - fog: true, - transparent: true, - uniforms: UniformsUtils.merge([UniformsLib.common, UniformsLib.fog]), - depthWrite: false, -}); - -export function TransitionSkeleton() { - const tank = Duel.use((state) => state.protagonist.tank); - const gun = Duel.use((state) => state.protagonist.gun); - const track = Duel.use((state) => state.protagonist.track); - const turret = Duel.use((state) => state.protagonist.turret); - const turretContainer = useRef(null!); - const gunContainer = useRef(null!); - const { gltf: armorGltf } = useArmor(tank.id); - const { gltf: modelGltf } = useModel(tank.id); - const modelNodes = Object.values(modelGltf.nodes); - const armorNodes = Object.values(armorGltf.nodes); - const tankModelDefinition = useTankModelDefinition(); - const turretModelDefinition = tankModelDefinition.turrets[turret.id]; - const gunModelDefinition = turretModelDefinition.guns[gun.id]; - const trackModelDefinition = tankModelDefinition.tracks[track.id]; - const wrapper = useRef(null); - const hullOrigin = correctZYTuple(trackModelDefinition.origin!); - const turretOrigin = correctZYTuple(tankModelDefinition.turret_origin!); - const gunOrigin = correctZYTuple(turretModelDefinition.gun_origin!); - - useTankTransform(track, turret, turretContainer, gunContainer); - - return ( - - - {armorNodes.map((node) => { - const isHull = node.name.startsWith("hull_"); - const isVisible = isHull; - - if (!isVisible) return null; - - return jsxTree(node, { - mesh(_, props, key) { - return ; - }, - }); - })} - - - {modelNodes.map((node) => { - const isWheel = node.name.startsWith("chassis_wheel_"); - const isTrack = node.name.startsWith("chassis_track_"); - const isVisible = isWheel || isTrack; - - if (!isVisible) return null; - - return jsxTree(node, { - mesh(_, props, key) { - return ; - }, - }); - })} - - - {armorNodes.map((node) => { - const isCurrentTurret = node.name.startsWith( - `turret_${turretModelDefinition.model_id.toString().padStart(2, "0")}`, - ); - const isVisible = isCurrentTurret; - if (!isVisible) { - return null; - } - - return ( - - - {jsxTree(node, { - mesh(_, props, key) { - return ( - - ); - }, - })} - - - ); - })} - - - {armorNodes.map((node) => { - const isCurrentGun = node.name.startsWith( - `gun_${gunModelDefinition.model_id.toString().padStart(2, "0")}`, - ); - const isVisible = isCurrentGun; - - if (!isVisible) return null; - - return ( - - - {jsxTree(node, { - mesh(_, props, key) { - return ( - - ); - }, - })} - - - ); - })} - - {modelNodes.map((node) => { - const gunString = `gun_${gunModelDefinition.model_id - .toString() - .padStart(2, "0")}`; - const isCurrentGun = gunModelDefinition.mask - ? node.name.startsWith(gunString) - : node.name === gunString; - const isVisible = isCurrentGun; - - if (!isVisible) return null; - - return jsxTree(node, { - mesh(_, props, key) { - return ( - - ); - }, - }); - })} - - - - ); -} diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TransitionSkeleton/shaders/fragment.glsl b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TransitionSkeleton/shaders/fragment.glsl deleted file mode 100644 index 5bbbb707b..000000000 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TransitionSkeleton/shaders/fragment.glsl +++ /dev/null @@ -1,11 +0,0 @@ -precision mediump float; - -#define USE_FOG - -#include - -void main() { - float fogFactor = smoothstep(fogNear, fogFar, vFogDepth); - gl_FragColor = vec4(0.5, 0.5, 0.5, fogFactor); - gl_FragColor.rgb = mix(fogColor, gl_FragColor.rgb, fogFactor); -} \ No newline at end of file diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TransitionSkeleton/shaders/vertex.glsl b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TransitionSkeleton/shaders/vertex.glsl deleted file mode 100644 index 2c0140061..000000000 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TransitionSkeleton/shaders/vertex.glsl +++ /dev/null @@ -1,19 +0,0 @@ -precision mediump float; - -#define USE_FOG - -#include - -varying vec3 vNormal; -varying vec3 vViewPosition; - -void main() { - vec4 mvPosition = modelViewMatrix * vec4(position, 1.0); - - vViewPosition = mvPosition.xyz; - vNormal = normalMatrix * normal; - - gl_Position = projectionMatrix * mvPosition; - - #include -}