feat: 3 scene rendering setup
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user