Merge pull request #2992 from DeltaNedas/planetdraw

allow modded planets to customize drawing
This commit is contained in:
Anuken 2020-10-17 17:56:12 -04:00 committed by GitHub
commit 55a8ae083b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -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;

View File

@ -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);
}
}