From 3b937a6f353ba8fe488ddc748115b3857d8c1071 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sun, 23 Mar 2025 17:41:38 -0500 Subject: [PATCH] feat: outlines --- .../components/DissectorSceneComponent.tsx | 66 +++++++++++-------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/packages/website/src/components/Armor/components/DissectorSceneComponent.tsx b/packages/website/src/components/Armor/components/DissectorSceneComponent.tsx index 74ed31b25..a91af130f 100644 --- a/packages/website/src/components/Armor/components/DissectorSceneComponent.tsx +++ b/packages/website/src/components/Armor/components/DissectorSceneComponent.tsx @@ -1,15 +1,15 @@ import { asset, J_HAT } from '@blitzkit/core'; import { - amberDark, blueDark, - bronzeDark, + crimsonDark, indigoDark, mauveDark, orangeDark, plumDark, - redDark, - skyDark, + purpleDark, slateDark, + tomatoDark, + yellowDark, } from '@radix-ui/colors'; import { Base, @@ -25,6 +25,7 @@ import { DoubleSide, Group, LineBasicMaterial, + LineSegments, Material, MeshStandardMaterial, Plane, @@ -58,16 +59,16 @@ const moduleColor: Record = { Gunner1: new Color(mauveDark.mauve11), Loader1: new Color(mauveDark.mauve11), - SurveyingDevice: new Color(plumDark.plum8), - Radio: new Color(slateDark.slate8), + SurveyingDevice: new Color(plumDark.plum7), + Radio: new Color(slateDark.slate7), Gun: new Color(blueDark.blue8), - FuelTank: new Color(orangeDark.orange8), - Engine: new Color(redDark.red8), - AmmoBay: new Color(amberDark.amber8), - LeftTrack: new Color(bronzeDark.bronze8), - RightTrack: new Color(bronzeDark.bronze8), - TurretRotator: new Color(indigoDark.indigo8), - Transmission: new Color(skyDark.sky8), + FuelTank: new Color(orangeDark.orange9), + Engine: new Color(crimsonDark.crimson8), + AmmoBay: new Color(yellowDark.yellow9), + LeftTrack: new Color(purpleDark.purple5), + RightTrack: new Color(purpleDark.purple5), + TurretRotator: new Color(indigoDark.indigo7), + Transmission: new Color(tomatoDark.tomato4), }; const moduleOutlineColor: Record = { Armor: armorOutlineColor, @@ -120,13 +121,14 @@ export function DissectorSceneComponent({ clippingPlanes: isModule ? undefined : [clippingPlane.current], }), ); + const outline = useRef(null); const outlineMaterial = useRef( new LineBasicMaterial({ transparent: !isModule, opacity: 2 ** -3, side: DoubleSide, color: moduleOutlineColor[armorPlate.type], - clippingPlanes: isModule ? undefined : [clippingPlane.current], + clippingPlanes: [clippingPlane.current], }), ); const outlineMaterialInverse = useRef( @@ -177,19 +179,31 @@ export function DissectorSceneComponent({ if (isModule) { return ( - - - + <> + { + event.stopPropagation(); + }} + > + + - - - - - - - + + + + + + + + + + + + ); }