fix tank modes not switching

This commit is contained in:
tresabhi committed 2026-08-11 19:45:09 -05:00
1 parent bae2f253bc
commit a44e2e9866
1 file changed
+8 -2
@@ -1,6 +1,6 @@
import { blueDark, orangeDark } from "@radix-ui/colors"; import { blueDark, orangeDark } from "@radix-ui/colors";
import { ContactShadows } from "@react-three/drei"; import { ContactShadows } from "@react-three/drei";
import { useFrame } from "@react-three/fiber"; import { invalidate, useFrame } from "@react-three/fiber";
import { clamp, times } from "lodash-es"; import { clamp, times } from "lodash-es";
import { Quicklime } from "quicklime"; import { Quicklime } from "quicklime";
import { import {
@@ -78,6 +78,8 @@ export function Lighting() {
height={1.5} height={1.5}
blur={2 ** 0.5} blur={2 ** 0.5}
opacity={2 ** -0.4} opacity={2 ** -0.4}
resolution={2 ** 7}
depthWrite={false}
/> />
{animate && ( {animate && (
@@ -152,8 +154,12 @@ function Animator({ stop, t0, animationTime, wrapper }: AnimatorProps) {
const factor = const factor =
!hasPbr && display !== TankopediaDisplay.StaticArmor ? NON_PBR_FACTOR : 1; !hasPbr && display !== TankopediaDisplay.StaticArmor ? NON_PBR_FACTOR : 1;
useEffect(() => {
invalidate();
}, [requestedDisplay === display]);
const apply = useCallback((t: number) => { const apply = useCallback((t: number) => {
if (wrapper.current === null) return; if (!wrapper.current) return;
for (const child of wrapper.current.children) { for (const child of wrapper.current.children) {
if (child instanceof SpotLight) { if (child instanceof SpotLight) {