Planet cleanup

This commit is contained in:
Anuken
2020-01-18 17:03:03 -05:00
parent 47695f1f8c
commit b2f9b2ef77
6 changed files with 59 additions and 40 deletions

View File

@@ -18,9 +18,10 @@ public class PlanetMesh{
private boolean lines = false;
private float radius = 1f, intensity = 0.2f;
private PlanetGenerator gen = new PlanetGenerator();
private final PlanetGenerator gen;
public PlanetMesh(int divisions){
public PlanetMesh(int divisions, PlanetGenerator gen){
this.gen = gen;
this.grid = PlanetGrid.newGrid(divisions);
int vertices = grid.tiles.length * 12 * (3 + 3 + 1);
@@ -115,7 +116,7 @@ public class PlanetMesh{
}
private Color color(Vec3 v){
return gen.getColor(v, elevation(v));
return gen.getColor(v);
}
private void verts(Vec3 a, Vec3 b, Vec3 c, Vec3 normal, Color color){