Skip to content

Commit

Permalink
Solar systems render based on the selected planet
Browse files Browse the repository at this point in the history
  • Loading branch information
Idonotus committed Jul 31, 2023
1 parent e4bc6e2 commit 2eac434
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/src/mindustry/graphics/g3d/PlanetParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
5 changes: 3 additions & 2 deletions core/src/mindustry/graphics/g3d/PlanetRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 2eac434

Please sign in to comment.