From 142164edd4ba80bf7fa84a6970ac847c4d0eb380 Mon Sep 17 00:00:00 2001 From: tyuXX Date: Sun, 15 Nov 2026 14:49:56 +0300 Subject: [PATCH] Implement ULTRACAT --- src/client/screens/dashboard.ts | 4 +++- src/client/three/rocketMesh/assembly.ts | 23 +++++++++++++++++++++++ src/client/ui/tooltip.ts | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/client/screens/dashboard.ts b/src/client/screens/dashboard.ts index 01d38a8..f94c00a 100644 --- a/src/client/screens/dashboard.ts +++ b/src/client/screens/dashboard.ts @@ -73,7 +73,9 @@ export function renderDashboard(root: HTMLElement): () => void { } } try { - const complex = await buildLaunchComplex(hasRocket ? rocketH : 18); + const complex = await buildLaunchComplex(hasRocket ? rocketH : 18, { + includeMascot: hasRocket, + }); if (disposed) return; view.scene.add(complex); } catch {} diff --git a/src/client/three/rocketMesh/assembly.ts b/src/client/three/rocketMesh/assembly.ts index a494054..e16387e 100644 --- a/src/client/three/rocketMesh/assembly.ts +++ b/src/client/three/rocketMesh/assembly.ts @@ -369,6 +369,7 @@ export async function buildRocketMesh( export async function buildLaunchComplex( rocketHeight = 50, + opts: { includeMascot?: boolean } = {}, ): Promise { const complex = new THREE.Group(); const padMesh = new THREE.Mesh( @@ -428,6 +429,28 @@ export async function buildLaunchComplex( ); vab.position.set(-110, -2, -130); complex.add(vab); + if (opts.includeMascot) { + complex.updateMatrixWorld(true); + const vabBounds = new THREE.Box3().setFromObject(vab); + if (!vabBounds.isEmpty()) { + try { + const ultracat = await loadFittedModel( + encodeModelPath("cat_3d_model_free.glb"), + { + height: 6.5, + anchorBottom: true, + }, + ); + ultracat.name = "ultracat"; + ultracat.position.set( + (vabBounds.min.x + vabBounds.max.x) / 2, + vabBounds.max.y, + (vabBounds.min.z + vabBounds.max.z) / 2, + ); + complex.add(ultracat); + } catch {} + } + } } catch {} return complex; } diff --git a/src/client/ui/tooltip.ts b/src/client/ui/tooltip.ts index e30f661..e87cdf4 100644 --- a/src/client/ui/tooltip.ts +++ b/src/client/ui/tooltip.ts @@ -40,7 +40,7 @@ function showTooltipFor(anchor: HTMLElement): void { tip.append( h("div", { class: "hud-tooltip-cat" }, entry.category), h("div", { class: "hud-tooltip-title" }, entry.title), - h("div", { class: "hud-tooltip-body" }, entry.summary), + h("div", { class: "hud-tooltip-body" }, entry.summary + " -- Your favorite coach, ULTRACAT"), ); if (entry.formula) { tip.appendChild(h("div", { class: "hud-tooltip-formula" }, entry.formula));