From 58c70f98e1d2b0f752648e8a003a1cef9aa8dd6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Thu, 27 Nov 2025 17:24:12 -0600 Subject: [PATCH] refactor: remove 'naked' prop from Controls and TankSandbox components --- .../TankSandbox/components/Control.tsx | 16 +++------------- .../HeroSection/components/TankSandbox/index.tsx | 16 +++++++--------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Control.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Control.tsx index 1b35703ef..cc60f1009 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Control.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Control.tsx @@ -22,14 +22,12 @@ const poseDistances: Record = { const modelDefinitions = await awaitableModelDefinitions; interface ControlsProps { - naked?: boolean; autoRotate?: boolean; zoomable?: boolean; enableRotate?: boolean; } export function Controls({ - naked, autoRotate = true, zoomable = true, enableRotate = true, @@ -79,11 +77,7 @@ export function Controls({ protagonistHullOrigin.y + protagonistTurretOrigin.y + protagonistGunOrigin.y; - const inspectModeInitialPosition = new Vector3( - -8, - naked ? gunHeight + 10 : 2, - -13 - ); + const inspectModeInitialPosition = new Vector3(-8, 2, -13); const t0 = useRef(Date.now() / 1000); useFrame(() => { @@ -236,14 +230,10 @@ export function Controls({ orbitControls.current.rotateSpeed = 0.25; camera.position.copy(inspectModeInitialPosition); - orbitControls.current.target.set( - 0, - gunHeight * (naked ? 1 / 4 : 3 / 4), - 0 - ); + orbitControls.current.target.set(0, gunHeight * 0.6, 0); orbitControls.current.enablePan = true; orbitControls.current.enableZoom = true; - camera.fov = naked ? 20 : 25; + camera.fov = 25; camera.updateProjectionMatrix(); } diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/index.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/index.tsx index ff5b3e28d..ef90ce6ec 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/index.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/index.tsx @@ -1,4 +1,3 @@ -import { BLITZKIT_TANK_ICON_SIZE } from "@blitzkit/core"; import { forwardRef, Suspense, @@ -33,11 +32,10 @@ import { TankModel } from "./components/TankModel"; interface TankSandboxProps { thicknessRange: ThicknessRange; - naked?: boolean; } export const TankSandbox = forwardRef( - ({ thicknessRange, naked }, ref) => { + ({ thicknessRange }, ref) => { const canvas = useRef(null); const hasImprovedVerticalStabilizer = useEquipment(122); const hasDownImprovedVerticalStabilizer = useEquipment(124); @@ -153,7 +151,7 @@ export const TankSandbox = forwardRef( return ( ( }} style={{ userSelect: "none", - width: naked ? BLITZKIT_TANK_ICON_SIZE.width : "100%", - height: naked ? BLITZKIT_TANK_ICON_SIZE.height : "100%", - outline: naked ? "1rem red solid" : undefined, + width: "100%", + height: "100%", + outline: undefined, }} > - {!naked && } + {(display === TankopediaDisplay.Model || (display === TankopediaDisplay.DynamicArmor && !hideTankModelUnderArmor)) && } @@ -186,7 +184,7 @@ export const TankSandbox = forwardRef( {/* Controls within Suspense to allow for frame-perfect start of camera auto-rotate */} - + {display === TankopediaDisplay.DynamicArmor && } {display === TankopediaDisplay.StaticArmor && (