feat: 3 scene rendering setup

This commit is contained in:
2026-03-18 08:49:51 -04:00
parent 933c6afd08
commit 358122a74a
33 changed files with 1094 additions and 1132 deletions

View File

@@ -9,7 +9,7 @@ import type {
import type {
OrbitalAnchor,
WorldState,
ZoomLevel,
PovLevel,
} from "./viewerTypes";
import type { ZoomBlend } from "./viewerConstants";
@@ -112,19 +112,19 @@ export function computeZoomBlend(distance: number): ZoomBlend {
return {
localWeight: 1 - localToSystem,
systemWeight: Math.min(localToSystem, 1 - systemToUniverse),
universeWeight: systemToUniverse,
galaxyWeight: systemToUniverse,
};
}
export function classifyZoomLevel(distance: number): ZoomLevel {
export function classifyPovLevel(distance: number): PovLevel {
const blend = computeZoomBlend(distance);
if (blend.localWeight >= blend.systemWeight && blend.localWeight >= blend.universeWeight) {
if (blend.localWeight >= blend.systemWeight && blend.localWeight >= blend.galaxyWeight) {
return "local";
}
if (blend.systemWeight >= blend.universeWeight) {
if (blend.systemWeight >= blend.galaxyWeight) {
return "system";
}
return "universe";
return "galaxy";
}
export function toThreeVector(vector: Vector3Dto): THREE.Vector3 {