feat: improved visualisation and x4 data import

This commit is contained in:
2026-03-18 20:58:17 -04:00
parent 358122a74a
commit f98c47a8a7
45 changed files with 32840 additions and 1482 deletions

View File

@@ -1,5 +1,14 @@
import * as THREE from "three";
import type { Selectable } from "./viewerTypes";
import type {
CelestialVisual,
ClaimVisual,
ConstructionSiteVisual,
NodeVisual,
PlanetVisual,
Selectable,
ShipVisual,
StructureVisual,
} from "./viewerTypes";
/**
* System rendering layer.
@@ -9,7 +18,7 @@ import type { Selectable } from "./viewerTypes";
*/
export class SystemLayer {
readonly scene = new THREE.Scene();
readonly camera = new THREE.PerspectiveCamera(50, 1, 0.1, 50000);
readonly camera = new THREE.PerspectiveCamera(50, 1, 0.0001, 300000);
readonly celestialGroup = new THREE.Group();
readonly nodeGroup = new THREE.Group();
@@ -20,6 +29,14 @@ export class SystemLayer {
readonly selectableTargets = new Map<THREE.Object3D, Selectable>();
readonly planetVisuals: PlanetVisual[] = [];
readonly shipVisuals = new Map<string, ShipVisual>();
readonly celestialVisuals = new Map<string, CelestialVisual>();
readonly nodeVisuals = new Map<string, NodeVisual>();
readonly stationVisuals = new Map<string, StructureVisual>();
readonly claimVisuals = new Map<string, ClaimVisual>();
readonly constructionSiteVisuals = new Map<string, ConstructionSiteVisual>();
constructor() {
this.scene.add(new THREE.AmbientLight(0x90a6c0, 0.55));
const keyLight = new THREE.DirectionalLight(0xdcecff, 1.3);
@@ -44,4 +61,8 @@ export class SystemLayer {
this.camera.aspect = aspect;
this.camera.updateProjectionMatrix();
}
render(renderer: THREE.WebGLRenderer) {
renderer.render(this.scene, this.camera);
}
}