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