Skip to content

Commit

Permalink
fix: Interstellar viewscreen no longer shows the Flight Director view.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderson1993 committed Feb 9, 2023
1 parent 945dd22 commit e8c9840
Showing 1 changed file with 30 additions and 25 deletions.
55 changes: 30 additions & 25 deletions client/src/components/Starmap/InterstellarMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,35 +59,40 @@ export function InterstellarMap({children}: {children: React.ReactNode}) {
const viewingMode = useStarmapStore(store => store.viewingMode);

const isStation = viewingMode === "station";
const isViewscreen = viewingMode === "viewscreen";

return (
<Suspense fallback={null}>
<Starfield radius={lightYearToLightMinute(INTERSTELLAR_MAX_DISTANCE)} />
<CameraControls
ref={orbitControls}
enabled={controlsEnabled}
maxDistance={lightYearToLightMinute(INTERSTELLAR_MAX_DISTANCE)}
minDistance={1}
mouseButtons={{
left: ACTION.TRUCK,
right: ACTION.ROTATE,
middle: ACTION.DOLLY,
wheel: ACTION.DOLLY,
}}
dollyToCursor={isStation}
dollySpeed={0.5}
/>
<PolarGrid
rotation={[0, (2 * Math.PI) / 12, 0]}
args={[
lightYearToLightMinute(INTERSTELLAR_MAX_DISTANCE),
12,
20,
64,
0xffffff,
0xffffff,
]}
/>
{!isViewscreen && (
<>
<CameraControls
ref={orbitControls}
enabled={controlsEnabled}
maxDistance={lightYearToLightMinute(INTERSTELLAR_MAX_DISTANCE)}
minDistance={1}
mouseButtons={{
left: ACTION.TRUCK,
right: ACTION.ROTATE,
middle: ACTION.DOLLY,
wheel: ACTION.DOLLY,
}}
dollyToCursor={isStation}
dollySpeed={0.5}
/>
<PolarGrid
rotation={[0, (2 * Math.PI) / 12, 0]}
args={[
lightYearToLightMinute(INTERSTELLAR_MAX_DISTANCE),
12,
20,
64,
0xffffff,
0xffffff,
]}
/>
</>
)}
{children}
</Suspense>
);
Expand Down

0 comments on commit e8c9840

Please sign in to comment.