mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-30 01:34:04 +00:00
Grade arms through hills
- Route walks around ground too tall for the bank band and stop short of it - Scan bank profiles and head rays for tall ground and cliffs, and trim the head - Widen the default bank band so banks grade back like a river valley - Measure the steepest bank rise, slot runs and head walls in the probe - Add a sections mode rendering real block cross sections of chosen arms
This commit is contained in:
10 files changed
+412
-52
No files matched your search
+1
-1
@@ -33,7 +33,7 @@ public class IrisHydrologyDefaultsTest {
|
||||
"lakes": { "enabled": true, "minArea": 65536, "maxArea": 4194304 },
|
||||
"deformation": { "maxFill": 6, "bankSlope": 0.2, "bankSteepFactor": 3.5, "bankNoise": 0.2, "caveMask": true },
|
||||
"underground": {
|
||||
"seaInlets": { "enabled": true, "spacing": 192, "length": [64, 256], "maximumBankHeight": 40, "mouthHalfWidth": [13, 15], "headHalfWidth": [2.5, 3], "taper": 1.4, "widthVariation": 0.18, "meanderWidth": 4, "depth": [2, 5], "bankBand": 24, "bankStyle": "SMOOTH" },
|
||||
"seaInlets": { "enabled": true, "spacing": 192, "length": [64, 256], "maximumBankHeight": 44, "mouthHalfWidth": [13, 15], "headHalfWidth": [2.5, 3], "taper": 1.4, "widthVariation": 0.18, "meanderWidth": 4, "depth": [2, 5], "bankBand": 32, "bankStyle": "SMOOTH" },
|
||||
"cavePools": { "enabled": true, "density": 0.15, "minArea": 6, "maxArea": 400, "maxDepth": 4, "radius": 15, "freeboard": [0, 1], "fluid": "water" }
|
||||
},
|
||||
"fluids": [ { "name": "water", "palette": { "palette": [ { "block": "minecraft:water" } ] } } ],
|
||||
|
||||
+3
-3
@@ -38,7 +38,7 @@ public class HydrologySettingsTest {
|
||||
private static final int SEA_LEVEL = 62;
|
||||
private static final int MIN_Y = -64;
|
||||
private static final int MAX_Y = 320;
|
||||
private static final long DEFAULT_FINGERPRINT = 7426172183353655598L;
|
||||
private static final long DEFAULT_FINGERPRINT = -2724181682955020615L;
|
||||
|
||||
@Test
|
||||
public void densityIsBoundedAndChangesThePlanIdentity() {
|
||||
@@ -717,14 +717,14 @@ public class HydrologySettingsTest {
|
||||
assertTrue(inlets.enabled());
|
||||
assertEquals(192, inlets.spacing());
|
||||
assertEquals(new HydrologySettings.IntRange(64, 256), inlets.length());
|
||||
assertEquals(40, inlets.maximumBankHeight());
|
||||
assertEquals(44, inlets.maximumBankHeight());
|
||||
assertEquals(new HydrologySettings.FloatRange(13f, 15f), inlets.mouthHalfWidth());
|
||||
assertEquals(new HydrologySettings.FloatRange(2.5f, 3f), inlets.headHalfWidth());
|
||||
assertEquals(1.4f, inlets.taper(), 0f);
|
||||
assertEquals(0.18f, inlets.widthVariation(), 1e-6f);
|
||||
assertEquals(4f, inlets.meanderWidth(), 0f);
|
||||
assertEquals(new HydrologySettings.IntRange(2, 5), inlets.depth());
|
||||
assertEquals(24, inlets.bankBand());
|
||||
assertEquals(32, inlets.bankBand());
|
||||
assertEquals(IrisBankStyle.SMOOTH, inlets.bankStyle());
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,11 @@ final class SyntheticTerrain implements HydrologyTerrainSource {
|
||||
return new SyntheticTerrain(natural, rainfall, streamsBlocked, area, land);
|
||||
}
|
||||
|
||||
SyntheticTerrain rising(double fromX, double slope) {
|
||||
DoubleBinaryOperator inner = natural;
|
||||
return new SyntheticTerrain((x, z) -> inner.applyAsDouble(x, z) + Math.max(0D, x - fromX) * slope, rainfall, streamsBlocked, pondsBlocked, land);
|
||||
}
|
||||
|
||||
SyntheticTerrain lowered(double depth) {
|
||||
DoubleBinaryOperator inner = natural;
|
||||
return new SyntheticTerrain((x, z) -> inner.applyAsDouble(x, z) - depth, rainfall, streamsBlocked, pondsBlocked, land);
|
||||
|
||||
@@ -179,6 +179,25 @@ public class TidalPlannerTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void armsNeverGradeBanksThroughGroundTooTallForTheBand() {
|
||||
HydrologySettings settings = settings();
|
||||
double wallX = COAST_X + 150D;
|
||||
SyntheticTerrain hill = SyntheticTerrain.lowCoast(COAST_X).rising(wallX, 2D);
|
||||
double graded = 1.5D * settings.underground().seaInlets().maximumBankHeight();
|
||||
List<Reach> arms = arms(planner(settings, hill));
|
||||
assertFalse("a low strip still holds arms", arms.isEmpty());
|
||||
for (Reach arm : arms) {
|
||||
for (int point = 0; point < arm.xs().length; point++) {
|
||||
double side = arm.halfWidth()[point] + settings.underground().seaInlets().bankBand();
|
||||
assertTrue(arm + " grades through " + hill.natural(arm.xs()[point] + side, arm.zs()[point]),
|
||||
hill.natural(arm.xs()[point] + side, arm.zs()[point]) <= SEA + graded + 1D);
|
||||
}
|
||||
double ahead = arm.halfWidth()[0] + settings.underground().seaInlets().bankBand();
|
||||
assertTrue(arm + " ends against a wall", hill.natural(arm.xs()[0] + ahead, arm.zs()[0]) <= SEA + graded + 1D);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void groundBelowTheSeaBesideAnArmCutsTheArmOffAtIt() {
|
||||
SyntheticTerrain plain = SyntheticTerrain.lowCoast(COAST_X);
|
||||
|
||||
@@ -84,7 +84,7 @@ public class SchemaBuilderIdentityTest {
|
||||
@ClassRule
|
||||
public static final PlatformLeakGuard PLATFORM_GUARD = PlatformLeakGuard.clean();
|
||||
|
||||
private static final String EXPECTED_SCHEMA_DIGEST = "deb2538c92e5801beea672d32ded75301a441cf36d102bb09474f1c16f7821cc";
|
||||
private static final String EXPECTED_SCHEMA_DIGEST = "47b8ebadf50c11e9ab5d4293259056f005bac1d8c33ac8cc7d9bcc80c4afba6c";
|
||||
|
||||
private static final List<Class<?>> SCHEMA_ROOTS = List.of(
|
||||
IrisDimension.class,
|
||||
|
||||
Reference in new issue
Block a user