forked from phenom/healer-man
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
@@ -0,0 +1,14 @@
|
||||
import type { DungeonDefinition } from "../game/dungeonTypes";
|
||||
|
||||
export function dungeonRenderDistance(dungeon: DungeonDefinition): number {
|
||||
const boundsDistance = 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 fogFar = dungeon.presentation.fog.far;
|
||||
// Linear fog has completely obscured surfaces at this camera-space depth.
|
||||
// The background must use the fog color so clipping cannot reveal a horizon.
|
||||
return Number.isFinite(fogFar) && fogFar > 1
|
||||
? Math.min(boundsDistance, fogFar)
|
||||
: boundsDistance;
|
||||
}
|
||||
Reference in new issue
Block a user