mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-13 12:16:53 +07:00
Merge pull request #2992 from DeltaNedas/planetdraw
allow modded planets to customize drawing
This commit is contained in:
commit
55a8ae083b
@ -116,9 +116,12 @@ public class PlanetRenderer implements Disposable{
|
||||
bloom.render();
|
||||
}
|
||||
|
||||
|
||||
public void renderPlanet(Planet planet){
|
||||
if(!planet.visible()) return;
|
||||
|
||||
//render planet at offsetted position in the world
|
||||
planet.mesh.render(cam.combined, planet.getTransform(mat));
|
||||
planet.draw(cam.combined, planet.getTransform(mat));
|
||||
|
||||
renderOrbit(planet);
|
||||
|
||||
@ -145,7 +148,7 @@ public class PlanetRenderer implements Disposable{
|
||||
}
|
||||
|
||||
public void renderOrbit(Planet planet){
|
||||
if(planet.parent == null) return;
|
||||
if(planet.parent == null || !planet.visible()) return;
|
||||
|
||||
Vec3 center = planet.parent.position;
|
||||
float radius = planet.orbitRadius;
|
||||
|
@ -268,4 +268,12 @@ public class Planet extends UnlockableContent{
|
||||
public ContentType getContentType(){
|
||||
return ContentType.planet;
|
||||
}
|
||||
|
||||
public boolean visible(){
|
||||
return true;
|
||||
}
|
||||
|
||||
public void draw(Mat3D projection, Mat3D transform){
|
||||
mesh.render(projection, transform);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user