From 2eac4346b46a26e29f0bfcceb810a5db34e57871 Mon Sep 17 00:00:00 2001 From: Idonotus Date: Mon, 31 Jul 2023 19:25:31 +0100 Subject: [PATCH] Solar systems render based on the selected planet --- core/src/mindustry/graphics/g3d/PlanetParams.java | 4 ++-- core/src/mindustry/graphics/g3d/PlanetRenderer.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/graphics/g3d/PlanetParams.java b/core/src/mindustry/graphics/g3d/PlanetParams.java index 68141b5f7fc5..5ff40f80afc1 100644 --- a/core/src/mindustry/graphics/g3d/PlanetParams.java +++ b/core/src/mindustry/graphics/g3d/PlanetParams.java @@ -18,10 +18,10 @@ public class PlanetParams{ public Vec3 camUp = new Vec3(0f, 1f, 0f); /** the unit length direction vector of the camera **/ public Vec3 camDir = new Vec3(0, 0, -1); - /** The sun/main planet of the solar system from which everything is rendered. */ - public Planet solarSystem = Planets.sun; /** Planet being looked at. */ public Planet planet = Planets.serpulo; + /** The sun/main planet of the solar system from which everything is rendered. */ + public Planet solarSystem() {return planet.solarSystem;} /** Zoom relative to planet. */ public float zoom = 1f; /** Alpha of orbit rings and other UI elements. */ diff --git a/core/src/mindustry/graphics/g3d/PlanetRenderer.java b/core/src/mindustry/graphics/g3d/PlanetRenderer.java index 812bb2b504bd..6fc117df25b9 100644 --- a/core/src/mindustry/graphics/g3d/PlanetRenderer.java +++ b/core/src/mindustry/graphics/g3d/PlanetRenderer.java @@ -102,8 +102,9 @@ public void render(PlanetParams params){ Events.fire(Trigger.universeDraw); - renderPlanet(params.solarSystem, params); - renderTransparent(params.solarSystem, params); + Planet solarSystem = params.solarSystem(); + renderPlanet(solarSystem, params); + renderTransparent(solarSystem, params); bloom.render();