mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-03 08:26:11 +00:00
Remove vertical domains for now
This commit is contained in:
parent
957de5d6f7
commit
9aa426ed56
@ -19,6 +19,7 @@
|
||||
package com.volmit.iris.engine;
|
||||
|
||||
import com.google.common.util.concurrent.AtomicDouble;
|
||||
import com.google.gson.Gson;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.actuator.IrisTerrainNormalActuator;
|
||||
@ -33,10 +34,12 @@ import com.volmit.iris.engine.object.dimensional.IrisTerrainMode;
|
||||
import com.volmit.iris.engine.object.feature.IrisFeaturePositional;
|
||||
import com.volmit.iris.engine.object.noise.IrisGenerator;
|
||||
import com.volmit.iris.engine.object.noise.IrisInterpolator;
|
||||
import com.volmit.iris.engine.object.noise.IrisShapedGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.regional.IrisRegion;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
import com.volmit.iris.util.data.DataProvider;
|
||||
import com.volmit.iris.util.function.NoiseProvider;
|
||||
import com.volmit.iris.util.math.M;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
@ -77,16 +80,15 @@ public class IrisComplex implements DataProvider {
|
||||
private ProceduralStream<Biome> trueBiomeDerivativeStream;
|
||||
private ProceduralStream<Double> heightStream;
|
||||
private ProceduralStream<Double> heightStreamNoFeatures;
|
||||
private ProceduralStream<Double> heightDomainStreamNoFeatures;
|
||||
private ProceduralStream<Double> objectChanceStream;
|
||||
private ProceduralStream<Double> maxHeightStream;
|
||||
private ProceduralStream<Double> overlayStream;
|
||||
private ProceduralStream<Double> heightFluidStream;
|
||||
private ProceduralStream<Integer> trueHeightStream;
|
||||
private ProceduralStream<Integer> trueHeightDomainStream;
|
||||
private ProceduralStream<Double> slopeStream;
|
||||
private ProceduralStream<Integer> islandTopStream;
|
||||
private ProceduralStream<Integer> islandBottomStream;
|
||||
private ProceduralStream<Integer> topSurfaceStream;
|
||||
private ProceduralStream<RNG> rngStream;
|
||||
private ProceduralStream<RNG> chunkRngStream;
|
||||
private ProceduralStream<IrisDecorator> terrainSurfaceDecoration;
|
||||
@ -229,25 +231,6 @@ public class IrisComplex implements DataProvider {
|
||||
IrisBiome b = focus != null ? focus : baseBiomeStream.get(x, z);
|
||||
return getHeight(engine, b, x, z, engine.getWorld().seed(), false);
|
||||
}, Interpolated.DOUBLE).clamp(0, engine.getHeight()).cache2D(cacheSize);
|
||||
heightDomainStreamNoFeatures = engine.getDimension().getVerticalDomain().isFlat()
|
||||
? heightStreamNoFeatures
|
||||
: ProceduralStream.of((x, z) -> {
|
||||
double hh = 0;
|
||||
double v, i;
|
||||
|
||||
for(i = 0; i < engine.getHeight(); i++)
|
||||
{
|
||||
double ox = engine.getDimension().getVerticalDomain().get(rng, getData(), i - 12345);
|
||||
double oz = engine.getDimension().getVerticalDomain().get(rng, getData(), i + 54321);
|
||||
v = heightStreamNoFeatures.get(x+ox, z+oz);
|
||||
if(v > hh)
|
||||
{
|
||||
hh = v;
|
||||
}
|
||||
}
|
||||
|
||||
return hh;
|
||||
}, Interpolated.DOUBLE).cache2D(cacheSize);
|
||||
slopeStream = heightStream.slope(3).cache2D(cacheSize);
|
||||
objectChanceStream = ProceduralStream.ofDouble((x, z) -> {
|
||||
if (engine.getDimension().hasFeatures(engine)) {
|
||||
@ -345,7 +328,6 @@ public class IrisComplex implements DataProvider {
|
||||
.convertAware2D((b, xx, zz) -> decorateFor(b, xx, zz, IrisDecorationPart.SEA_SURFACE)).cache2D(cacheSize);
|
||||
seaFloorDecoration = trueBiomeStream
|
||||
.convertAware2D((b, xx, zz) -> decorateFor(b, xx, zz, IrisDecorationPart.SEA_FLOOR)).cache2D(cacheSize);
|
||||
|
||||
trueHeightStream = ProceduralStream.of((x, z) -> {
|
||||
int rx = (int) Math.round(engine.modifyX(x));
|
||||
int rz = (int) Math.round(engine.modifyZ(z));
|
||||
@ -393,26 +375,6 @@ public class IrisComplex implements DataProvider {
|
||||
.get(x, z) : 0);
|
||||
islandBottomStream = islandStream.convertAware2D((i, x, z) ->
|
||||
i ? islandHeightStream.subtract(islandDepthStream).round().get(x, z) : 0);
|
||||
|
||||
trueHeightDomainStream = engine.getDimension().getVerticalDomain().isFlat()
|
||||
? trueHeightStream
|
||||
: ProceduralStream.of((x, z) -> {
|
||||
double hh = 0;
|
||||
double v, i;
|
||||
|
||||
for(i = 0; i < engine.getHeight(); i++)
|
||||
{
|
||||
double ox = engine.getDimension().getVerticalDomain().get(rng, getData(), i - 12345);
|
||||
double oz = engine.getDimension().getVerticalDomain().get(rng, getData(), i + 54321);
|
||||
v = trueHeightStream.get(x+ox, z+oz);
|
||||
if(v > hh)
|
||||
{
|
||||
hh = v;
|
||||
}
|
||||
}
|
||||
|
||||
return (int)Math.round(hh);
|
||||
}, Interpolated.INT).cache2D(cacheSize);
|
||||
//@done
|
||||
}
|
||||
|
||||
|
@ -36,20 +36,18 @@ import org.bukkit.block.data.BlockData;
|
||||
public class IrisTerrainNormalActuator extends EngineAssignedActuator<BlockData> {
|
||||
private static final BlockData AIR = Material.AIR.createBlockData();
|
||||
private static final BlockData BEDROCK = Material.BEDROCK.createBlockData();
|
||||
private static final BlockData GLASS = Material.GLASS.createBlockData();
|
||||
private static final BlockData CAVE_AIR = Material.CAVE_AIR.createBlockData();
|
||||
@Getter
|
||||
private final RNG rng;
|
||||
private final boolean carving;
|
||||
@Getter
|
||||
private int lastBedrock = -1;
|
||||
private IrisShapedGeneratorStyle domain;
|
||||
|
||||
public IrisTerrainNormalActuator(Engine engine) {
|
||||
super(engine, "Terrain");
|
||||
rng = new RNG(engine.getWorld().seed());
|
||||
carving = getDimension().isCarving() && getDimension().getCarveLayers().isNotEmpty();
|
||||
domain = getDimension().getVerticalDomain();
|
||||
domain = domain.isFlat() ? null : domain;
|
||||
}
|
||||
|
||||
@BlockCoordinates
|
||||
@ -148,64 +146,21 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<BlockData>
|
||||
*/
|
||||
@BlockCoordinates
|
||||
public void terrainSliver(int x, int z, int xf, Hunk<BlockData> h) {
|
||||
int i, j, k, realX, realZ, hf, he;
|
||||
int i, realX, realZ, hf, he;
|
||||
IrisBiome biome;
|
||||
|
||||
for (i = 0; i < h.getDepth(); i++) {
|
||||
realX = (int) modX(xf + x);
|
||||
realZ = (int) modZ(i + z);
|
||||
biome = getComplex().getTrueBiomeStream().get(realX, realZ);
|
||||
he = (int) Math.round(Math.min(h.getHeight(), getComplex().getHeightStream().get(realX, realZ)));
|
||||
hf = Math.round(Math.max(Math.min(h.getHeight(), getDimension().getFluidHeight()), he));
|
||||
|
||||
if(domain != null)
|
||||
{
|
||||
int[] heights = new int[h.getHeight()];
|
||||
IrisBiome[] biomes = new IrisBiome[h.getHeight()];
|
||||
int maximum = 0;
|
||||
|
||||
for(j = 0; j < h.getHeight(); j++)
|
||||
{
|
||||
double ox = domain.get(rng, getData(), j - 12345);
|
||||
double oz = domain.get(rng, getData(), j + 54321);
|
||||
biomes[j] = getComplex().getTrueBiomeStream().get(realX+ox, realZ+oz);
|
||||
heights[j] = (int) Math.round(Math.min(h.getHeight(), getComplex().getHeightStream().get(realX+ox, realZ+oz)));
|
||||
maximum = Math.max(maximum, heights[j]);
|
||||
}
|
||||
|
||||
for(j = maximum; j >= 0; j--) {
|
||||
if(fluidOrHeight(heights[j]) < j)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int hi = j;
|
||||
int lo = 0;
|
||||
|
||||
for(k = j; k >= 0; k--)
|
||||
{
|
||||
if(fluidOrHeight(heights[k]) < k)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
lo = k;
|
||||
j = k-1;
|
||||
}
|
||||
|
||||
generateGround(realX, realZ, xf, i, h, hi, lo, heights[hi], fluidOrHeight(heights[hi]), biomes[hi]);
|
||||
}
|
||||
if (hf < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
biome = getComplex().getTrueBiomeStream().get(realX, realZ);
|
||||
he = (int) Math.round(Math.min(h.getHeight(), getComplex().getHeightStream().get(realX, realZ)));
|
||||
hf = Math.round(Math.max(Math.min(h.getHeight(), getDimension().getFluidHeight()), he));
|
||||
|
||||
if (hf < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
generateGround(realX, realZ, xf, i, h, hf, 0, he, hf, biome);
|
||||
}
|
||||
generateGround(realX, realZ, xf, i, h, hf, 0, he, hf, biome);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -330,9 +330,6 @@ public class IrisDimension extends IrisRegistrant {
|
||||
@Desc("Cartographer map trade overrides")
|
||||
private IrisVillagerOverride patchCartographers = new IrisVillagerOverride().setDisableTrade(false);
|
||||
|
||||
@Desc("If defined, warp the terrain vertically by this style. This will cause overhangs & carving-like shapes")
|
||||
private IrisShapedGeneratorStyle verticalDomain = new IrisShapedGeneratorStyle(NoiseStyle.FLAT, 1, 1);
|
||||
|
||||
private final transient AtomicCache<Position2> parallaxSize = new AtomicCache<>();
|
||||
private final transient AtomicCache<CNG> rockLayerGenerator = new AtomicCache<>();
|
||||
private final transient AtomicCache<CNG> fluidLayerGenerator = new AtomicCache<>();
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.object.noise;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
Loading…
x
Reference in New Issue
Block a user