Release Healer Man 0.1.26
This commit is contained in:
1 parent
e7cc588bfc
commit
147c2804d4
27 files changed
+1010
-55
No files matched your search
+17
-12
@@ -1,13 +1,14 @@
|
||||
import {
|
||||
useCallback,
|
||||
useEffect,
|
||||
useLayoutEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
useSyncExternalStore,
|
||||
type PointerEvent as ReactPointerEvent,
|
||||
} from "react";
|
||||
import { Canvas } from "@react-three/fiber";
|
||||
import { Canvas, useThree } from "@react-three/fiber";
|
||||
import { Physics } from "@react-three/rapier";
|
||||
import { requireDungeonDefinition } from "../game/dungeonRegistry";
|
||||
import { spawnMatchesDifficulty } from "../game/mobPopulation";
|
||||
@@ -19,6 +20,7 @@ import {
|
||||
} from "../game/inputManager";
|
||||
import { useGameStore } from "../game/store";
|
||||
import { DungeonEnvironment } from "./DungeonEnvironment";
|
||||
import { dungeonRenderDistance } from "./dungeonRenderDistance";
|
||||
import { MobPopulation } from "./MobPopulation";
|
||||
import { PartyPopulation } from "./PartyPopulation";
|
||||
import { GroundEffectTelegraphs } from "./GroundEffectTelegraphs";
|
||||
@@ -69,6 +71,17 @@ import {
|
||||
suppressCompletedDungeonPopulation,
|
||||
} from "../game/dungeonEncounterSpawns";
|
||||
|
||||
function DungeonCameraRange({ far }: { readonly far: number }) {
|
||||
const camera = useThree((state) => state.camera);
|
||||
useLayoutEffect(() => {
|
||||
// Canvas preserves its camera across encounters; initial camera props alone
|
||||
// do not update the clipping distance when switching dungeon packages.
|
||||
camera.far = far;
|
||||
camera.updateProjectionMatrix();
|
||||
}, [camera, far]);
|
||||
return null;
|
||||
}
|
||||
|
||||
export function GameScene() {
|
||||
const activeDungeonId = useGameStore((state) => state.activeDungeonId);
|
||||
const gameMode = useGameStore((state) => state.gameMode);
|
||||
@@ -85,16 +98,7 @@ export function GameScene() {
|
||||
const completedObjectiveIds = gameMode === "dungeon"
|
||||
? activeDungeonCompletedObjectiveIds(activeDungeonId)
|
||||
: [];
|
||||
const cameraFar = Math.max(
|
||||
950,
|
||||
Math.min(
|
||||
10_000,
|
||||
Math.hypot(
|
||||
dungeon.bounds.max[0] - dungeon.bounds.min[0],
|
||||
dungeon.bounds.max[2] - dungeon.bounds.min[2],
|
||||
) * 1.35,
|
||||
),
|
||||
);
|
||||
const cameraFar = dungeonRenderDistance(dungeon);
|
||||
const stagePresentation = resolveStagePresentation(gameMode, manastormEncounter, {
|
||||
title: dungeon.title,
|
||||
mapId: dungeon.mapId,
|
||||
@@ -332,6 +336,7 @@ export function GameScene() {
|
||||
powerPreference: safeGraphics ? "default" : "high-performance",
|
||||
}}
|
||||
>
|
||||
<DungeonCameraRange far={cameraFar} />
|
||||
{frameloop === "never" && targetFps !== null && (
|
||||
<CappedFrameLoop
|
||||
active={documentVisible || sharedOnline}
|
||||
@@ -355,7 +360,7 @@ export function GameScene() {
|
||||
/>
|
||||
)}
|
||||
{import.meta.env.DEV && <DevelopmentPerformanceProbe />}
|
||||
<color attach="background" args={[dungeon.presentation.background]} />
|
||||
<color attach="background" args={[dungeon.presentation.fog.color]} />
|
||||
<fog attach="fog" args={[dungeon.presentation.fog.color, dungeon.presentation.fog.near, dungeon.presentation.fog.far]} />
|
||||
<ambientLight intensity={dungeon.presentation.ambientLight.intensity} color={dungeon.presentation.ambientLight.color} />
|
||||
<hemisphereLight args={[
|
||||
|
||||
Reference in new issue
Block a user