mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-12-01 18:24:06 +00:00
Remove transition hydrology weight
- Drop test-only TransitionGenerationPlan.hydrologyWeightAt - Drop TerrainSample.hydrologyWeight and its validation
This commit is contained in:
1 parent
df7aa2ef16
commit
490016b56a
3 files changed
+5
-19
No files matched your search
@@ -114,11 +114,9 @@ final class TransitionBoundarySampler {
|
|||||||
Math.min(distance, terrainWidth),
|
Math.min(distance, terrainWidth),
|
||||||
terrainWidth
|
terrainWidth
|
||||||
);
|
);
|
||||||
double hydrologyWeight = newEpochWeight;
|
|
||||||
return new TransitionGenerationPlan.TerrainSample(
|
return new TransitionGenerationPlan.TerrainSample(
|
||||||
Math.min(distance, searchWidth),
|
Math.min(distance, searchWidth),
|
||||||
newEpochWeight,
|
newEpochWeight,
|
||||||
hydrologyWeight,
|
|
||||||
nearest.signatures[0],
|
nearest.signatures[0],
|
||||||
weightedHeight(nearest, true),
|
weightedHeight(nearest, true),
|
||||||
weightedHeight(nearest, false),
|
weightedHeight(nearest, false),
|
||||||
|
|||||||
@@ -88,10 +88,6 @@ public final class TransitionGenerationPlan {
|
|||||||
return terrainSampleAt(blockX, blockZ).newEpochWeight();
|
return terrainSampleAt(blockX, blockZ).newEpochWeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
public double hydrologyWeightAt(int blockX, int blockZ) {
|
|
||||||
return terrainSampleAt(blockX, blockZ).hydrologyWeight();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean allowsNewDiscreteContentAt(int blockX, int blockZ) {
|
public boolean allowsNewDiscreteContentAt(int blockX, int blockZ) {
|
||||||
return !boundary.isHistoricalBlock(blockX, blockZ);
|
return !boundary.isHistoricalBlock(blockX, blockZ);
|
||||||
}
|
}
|
||||||
@@ -191,7 +187,6 @@ public final class TransitionGenerationPlan {
|
|||||||
public record TerrainSample(
|
public record TerrainSample(
|
||||||
double distanceToHistoricalTerrain,
|
double distanceToHistoricalTerrain,
|
||||||
double newEpochWeight,
|
double newEpochWeight,
|
||||||
double hydrologyWeight,
|
|
||||||
TerrainBoundarySignature nearestSignature,
|
TerrainBoundarySignature nearestSignature,
|
||||||
double historicalSurfaceHeight,
|
double historicalSurfaceHeight,
|
||||||
double historicalOceanFloorHeight,
|
double historicalOceanFloorHeight,
|
||||||
@@ -204,9 +199,6 @@ public final class TransitionGenerationPlan {
|
|||||||
if (!Double.isFinite(newEpochWeight) || newEpochWeight < 0D || newEpochWeight > 1D) {
|
if (!Double.isFinite(newEpochWeight) || newEpochWeight < 0D || newEpochWeight > 1D) {
|
||||||
throw new IllegalArgumentException("New epoch weight must be between zero and one");
|
throw new IllegalArgumentException("New epoch weight must be between zero and one");
|
||||||
}
|
}
|
||||||
if (!Double.isFinite(hydrologyWeight) || hydrologyWeight < 0D || hydrologyWeight > 1D) {
|
|
||||||
throw new IllegalArgumentException("Hydrology weight must be between zero and one");
|
|
||||||
}
|
|
||||||
if (nearestSignature != null
|
if (nearestSignature != null
|
||||||
&& (!Double.isFinite(historicalSurfaceHeight)
|
&& (!Double.isFinite(historicalSurfaceHeight)
|
||||||
|| !Double.isFinite(historicalOceanFloorHeight)
|
|| !Double.isFinite(historicalOceanFloorHeight)
|
||||||
@@ -217,11 +209,11 @@ public final class TransitionGenerationPlan {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static TerrainSample newTerrain(double distance) {
|
static TerrainSample newTerrain(double distance) {
|
||||||
return new TerrainSample(distance, 1D, 1D, null, 0D, 0D, 0D);
|
return new TerrainSample(distance, 1D, null, 0D, 0D, 0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
static TerrainSample historicalTerrain() {
|
static TerrainSample historicalTerrain() {
|
||||||
return new TerrainSample(0D, 0D, 0D, null, 0D, 0D, 0D);
|
return new TerrainSample(0D, 0D, null, 0D, 0D, 0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasHistoricalSignature() {
|
public boolean hasHistoricalSignature() {
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ public class TransitionGenerationPlanTest {
|
|||||||
|
|
||||||
assertEquals(0D, plan.newEpochWeightAt(15, 8), 0D);
|
assertEquals(0D, plan.newEpochWeightAt(15, 8), 0D);
|
||||||
assertEquals(1D, plan.newEpochWeightAt(16, 8), 0D);
|
assertEquals(1D, plan.newEpochWeightAt(16, 8), 0D);
|
||||||
assertEquals(1D, plan.hydrologyWeightAt(16, 8), 0D);
|
|
||||||
assertFalse(plan.terrainSampleAt(16, 8).hasHistoricalSignature());
|
assertFalse(plan.terrainSampleAt(16, 8).hasHistoricalSignature());
|
||||||
assertFalse(plan.hasTransitionAtChunk(1, 0));
|
assertFalse(plan.hasTransitionAtChunk(1, 0));
|
||||||
assertEquals(BoundaryGeometryInfluence.none(), plan.geometryAt(16, 8));
|
assertEquals(BoundaryGeometryInfluence.none(), plan.geometryAt(16, 8));
|
||||||
@@ -123,7 +122,7 @@ public class TransitionGenerationPlanTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void samplesTerrainAndHydrologyWithinTheSameFiniteWidth() throws Exception {
|
public void samplesTerrainWithinTheFiniteWidth() throws Exception {
|
||||||
GenerationBoundary boundary = GenerationBoundary.freeze("terrain", List.of(
|
GenerationBoundary boundary = GenerationBoundary.freeze("terrain", List.of(
|
||||||
new GenerationBoundary.ChunkCoordinate(0, 0)
|
new GenerationBoundary.ChunkCoordinate(0, 0)
|
||||||
));
|
));
|
||||||
@@ -138,14 +137,12 @@ public class TransitionGenerationPlanTest {
|
|||||||
assertNotNull(edge.nearestSignature());
|
assertNotNull(edge.nearestSignature());
|
||||||
assertEquals(1D, edge.distanceToHistoricalTerrain(), 0D);
|
assertEquals(1D, edge.distanceToHistoricalTerrain(), 0D);
|
||||||
assertEquals(64D, edge.historicalSurfaceHeight(), 0D);
|
assertEquals(64D, edge.historicalSurfaceHeight(), 0D);
|
||||||
assertEquals(edge.newEpochWeight(), edge.hydrologyWeight(), 0D);
|
|
||||||
assertTrue(edge.newEpochWeight() > 0D);
|
assertTrue(edge.newEpochWeight() > 0D);
|
||||||
assertTrue(edge.newEpochWeight() < 0.001D);
|
assertTrue(edge.newEpochWeight() < 0.001D);
|
||||||
|
|
||||||
assertEquals(1D, plan.newEpochWeightAt(47, 8), 0D);
|
assertEquals(1D, plan.newEpochWeightAt(47, 8), 0D);
|
||||||
assertEquals(1D, plan.hydrologyWeightAt(47, 8), 0D);
|
assertEquals(1D, plan.newEpochWeightAt(63, 8), 0D);
|
||||||
assertEquals(1D, plan.hydrologyWeightAt(63, 8), 0D);
|
assertEquals(1D, plan.newEpochWeightAt(79, 8), 0D);
|
||||||
assertEquals(1D, plan.hydrologyWeightAt(79, 8), 0D);
|
|
||||||
assertTrue(plan.allowsNewFootprint(31, 8, 48, 8));
|
assertTrue(plan.allowsNewFootprint(31, 8, 48, 8));
|
||||||
assertTrue(plan.allowsNewFootprint(47, 8, 63, 8));
|
assertTrue(plan.allowsNewFootprint(47, 8, 63, 8));
|
||||||
}
|
}
|
||||||
@@ -247,7 +244,6 @@ public class TransitionGenerationPlanTest {
|
|||||||
TransitionGenerationPlan.TerrainSample sample = plan.terrainSampleAt(-120, 240);
|
TransitionGenerationPlan.TerrainSample sample = plan.terrainSampleAt(-120, 240);
|
||||||
assertFalse(sample.hasHistoricalSignature());
|
assertFalse(sample.hasHistoricalSignature());
|
||||||
assertEquals(1D, sample.newEpochWeight(), 0D);
|
assertEquals(1D, sample.newEpochWeight(), 0D);
|
||||||
assertEquals(1D, sample.hydrologyWeight(), 0D);
|
|
||||||
assertTrue(plan.allowsNewDiscreteContentAt(-120, 240));
|
assertTrue(plan.allowsNewDiscreteContentAt(-120, 240));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user