This commit is contained in:
Anuken
2020-11-16 19:43:56 -05:00
parent 3b609f698a
commit f296d23cfa
17 changed files with 52 additions and 19 deletions

View File

@@ -11,6 +11,7 @@ import mindustry.world.*;
public abstract class PlanetGenerator extends BasicGenerator implements HexMesher{
protected IntSeq ints = new IntSeq();
protected Sector sector;
protected Simplex noise = new Simplex();
/** Should generate sector bases for a planet. */
public void generateSector(Sector sector){
@@ -46,6 +47,12 @@ public abstract class PlanetGenerator extends BasicGenerator implements HexMeshe
}
@Override
protected float noise(float x, float y, double octaves, double falloff, double scl, double mag){
Vec3 v = sector.rect.project(x, y);
return (float)noise.octaveNoise3D(octaves, falloff, 1f / scl, v.x, v.y, v.z) * (float)mag;
}
public void generate(Tiles tiles, Sector sec){
this.tiles = tiles;
this.sector = sec;

View File

@@ -16,7 +16,6 @@ import mindustry.world.*;
import static mindustry.Vars.*;
public class SerpuloPlanetGenerator extends PlanetGenerator{
Simplex noise = new Simplex();
RidgedPerlin rid = new RidgedPerlin(1, 2);
BaseGenerator basegen = new BaseGenerator();
float scl = 5f;