Refactored planet rendering to different classes
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
package mindustry.maps.planet;
|
||||
|
||||
import arc.graphics.*;
|
||||
import arc.math.geom.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
public interface PlanetGenerator{
|
||||
float getHeight(Vec3 position);
|
||||
Color getColor(Vec3 position);
|
||||
void generate(Vec3 position, TileGen tile);
|
||||
void decorate(Tiles tiles, Sector sec);
|
||||
}
|
||||
@@ -13,8 +13,7 @@ import mindustry.world.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
//TODO refactor into generic planet class
|
||||
public class TestPlanetGenerator extends BasicGenerator implements PlanetGenerator{
|
||||
public class TestPlanetGenerator extends PlanetGenerator{
|
||||
Simplex noise = new Simplex();
|
||||
RidgedPerlin rid = new RidgedPerlin(1, 2);
|
||||
float scl = 5f;
|
||||
@@ -68,7 +67,7 @@ public class TestPlanetGenerator extends BasicGenerator implements PlanetGenerat
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate(Vec3 position, TileGen tile){
|
||||
public void genTile(Vec3 position, TileGen tile){
|
||||
tile.floor = getBlock(position);
|
||||
tile.block = tile.floor.asFloor().wall;
|
||||
|
||||
@@ -81,15 +80,6 @@ public class TestPlanetGenerator extends BasicGenerator implements PlanetGenerat
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decorate(Tiles tiles, Sector sec){
|
||||
this.tiles = tiles;
|
||||
this.sector = sec;
|
||||
rand.setSeed(sec.id);
|
||||
|
||||
generate(tiles);
|
||||
}
|
||||
|
||||
Block getBlock(Vec3 position){
|
||||
float height = rawHeight(position);
|
||||
position = Tmp.v33.set(position).scl(scl);
|
||||
|
||||
Reference in New Issue
Block a user