Fix planet and ship lighting regression
This commit is contained in:
@@ -1086,6 +1086,8 @@ export class GameApp {
|
|||||||
}
|
}
|
||||||
this.camera.updateProjectionMatrix();
|
this.camera.updateProjectionMatrix();
|
||||||
|
|
||||||
|
const focusedSystemId = this.findNearestSystem(this.getCameraFocus()).definition.id;
|
||||||
|
|
||||||
this.systems.forEach((system) => {
|
this.systems.forEach((system) => {
|
||||||
const universe = this.viewLevel === "universe";
|
const universe = this.viewLevel === "universe";
|
||||||
|
|
||||||
@@ -1106,6 +1108,7 @@ export class GameApp {
|
|||||||
});
|
});
|
||||||
|
|
||||||
system.star.visible = !universe;
|
system.star.visible = !universe;
|
||||||
|
system.light.visible = !universe && system.definition.id === focusedSystemId;
|
||||||
system.strategicMarker.visible = universe;
|
system.strategicMarker.visible = universe;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -394,6 +394,7 @@ export interface SolarSystemInstance {
|
|||||||
center: THREE.Vector3;
|
center: THREE.Vector3;
|
||||||
planets: PlanetInstance[];
|
planets: PlanetInstance[];
|
||||||
star: THREE.Object3D;
|
star: THREE.Object3D;
|
||||||
|
light: THREE.PointLight;
|
||||||
gravityWellRadius: number;
|
gravityWellRadius: number;
|
||||||
orbitLines: THREE.LineLoop[];
|
orbitLines: THREE.LineLoop[];
|
||||||
asteroidDecorations: THREE.Object3D[];
|
asteroidDecorations: THREE.Object3D[];
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ function createSolarSystem(
|
|||||||
root.add(glow);
|
root.add(glow);
|
||||||
|
|
||||||
const light = new THREE.PointLight(definition.starColor, 3.2, 2800, 1.2);
|
const light = new THREE.PointLight(definition.starColor, 3.2, 2800, 1.2);
|
||||||
light.castShadow = true;
|
light.castShadow = false;
|
||||||
root.add(light);
|
root.add(light);
|
||||||
|
|
||||||
const planets = definition.planets.map((planetDefinition, index) => {
|
const planets = definition.planets.map((planetDefinition, index) => {
|
||||||
@@ -234,6 +234,7 @@ function createSolarSystem(
|
|||||||
center: new THREE.Vector3(...definition.position),
|
center: new THREE.Vector3(...definition.position),
|
||||||
planets,
|
planets,
|
||||||
star,
|
star,
|
||||||
|
light,
|
||||||
gravityWellRadius: definition.gravityWellRadius,
|
gravityWellRadius: definition.gravityWellRadius,
|
||||||
orbitLines,
|
orbitLines,
|
||||||
asteroidDecorations,
|
asteroidDecorations,
|
||||||
|
|||||||
Reference in New Issue
Block a user