refactor(generator): delete the pre-operator-stack archetype functions
With the operator stack as the only density path, the per-archetype density functions have no caller left in the game: - Delete UVoxelGenerator::GetSlabDensity, GetMazeDensity, GetSurfaceDensity, SurfaceDensityFromColumn, GetVerticalShaftDensity and GetFloatingIslandDensity (~1000 lines) with their declarations. - Drop GetDensityWithParams' OutWarpedPosition out-parameter; only the native GetDensityAt branch removed in the previous commit used it. - OpStack Slab/Maze/VerticalShaft/FloatingIsland and SurfaceHeight tests: remove the stack-vs-legacy comparisons; keep decomposition, finiteness, liveness, window-invariance, cache-cost and box-verdict checks (Shaft cache timing now measures the stack source). - PassageLandsInOpenSpace: the source-only footing probe evaluates the archetype stack built without a strate manager instead of the deleted functions. - Comments that cited the deleted functions now cite the operators (FSlabVoidSource, FLatticeCorridorSource, FIslandBlobSource, ...). GSurfColCache is documented as ClassifyTile's column cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01URDGLsu7c4nunqNFPJEFPU
This commit is contained in:
15 files changed
+253
-1698
No files matched your search
@@ -8,6 +8,7 @@
|
||||
#include "Misc/AutomationTest.h"
|
||||
|
||||
#include "VoxelCaveMorphology.h"
|
||||
#include "VoxelDensityOpStack.h"
|
||||
#include "VoxelDensityPrimitives.h"
|
||||
#include "VoxelForgeTestFixture.h"
|
||||
#include "VoxelPassageGeometry.h"
|
||||
@@ -900,11 +901,27 @@ bool FVoxelForgePassageLandsInOpenSpaceTest::RunTest(const FString& Parameters)
|
||||
++NumFootingChecked;
|
||||
|
||||
// The live world's passage modifier is intentionally absent here. The endpoint is
|
||||
// already known to be passage-carved, so this second generator checks the archetype
|
||||
// source itself: air at the landing and solid immediately below it.
|
||||
TStrongObjectPtr<UVoxelGenerator> SourceOnlyGenerator(
|
||||
NewObject<UVoxelGenerator>(GetTransientPackage(), NAME_None, RF_Transient));
|
||||
SourceOnlyGenerator->InitializeSettings(World.Settings.Get());
|
||||
// already known to be passage-carved, so the archetype's own stack, built without a
|
||||
// strate manager (hence without passage carving), checks the source itself: air at
|
||||
// the landing and solid immediately below it.
|
||||
const UVoxelGenerator& LiveGenerator = *World.Generator;
|
||||
FVoxelOpStack SourceStack;
|
||||
FVoxelOpContext SourceContext;
|
||||
SourceContext.Seed = (uint32)LiveGenerator.Seed;
|
||||
SourceContext.LayoutVersion = World.StrateManager->GetLayoutVersion();
|
||||
SourceContext.StrateTopWorldZ = StrateTopZ;
|
||||
SourceContext.StrateBottomWorldZ = StrateBottomZ;
|
||||
SourceContext.WorldRadiusVoxels = LiveGenerator.WorldRadiusVoxels;
|
||||
SourceContext.EdgeSealThickness = LiveGenerator.EdgeSealThickness;
|
||||
// The generator resets the shaft-connector hand-off around every density query; a
|
||||
// direct stack evaluation must model that boundary too.
|
||||
auto EvalSource = [&SourceStack](float QueryX, float QueryY, float QueryZ)
|
||||
{
|
||||
VoxelPassageGeometry::ResetVerticalShaftConnectorAirMarker();
|
||||
const float SourceDensity = SourceStack.EvalMC(QueryX, QueryY, QueryZ);
|
||||
VoxelPassageGeometry::ResetVerticalShaftConnectorAirMarker();
|
||||
return SourceDensity;
|
||||
};
|
||||
|
||||
float LandingDensity = 0.0f;
|
||||
float FootingDensity = 0.0f;
|
||||
@@ -915,13 +932,16 @@ bool FVoxelForgePassageLandsInOpenSpaceTest::RunTest(const FString& Parameters)
|
||||
FMazeGenerationParams P = Definition->MazeParams;
|
||||
P.StrateTopWorldZ = StrateTopZ;
|
||||
P.StrateBottomWorldZ = StrateBottomZ;
|
||||
LandingDensity = SourceOnlyGenerator->GetMazeDensity(
|
||||
SuggestedPoint.X, SuggestedPoint.Y, SuggestedPoint.Z, P);
|
||||
VoxelDensityOps::BuildMazeStack(SourceStack, P, LiveGenerator.Seed,
|
||||
LiveGenerator.OriginSpineRadius, /*StrateManager*/nullptr);
|
||||
SourceStack.PrepareChunk(SourceContext);
|
||||
LandingDensity = EvalSource(
|
||||
SuggestedPoint.X, SuggestedPoint.Y, SuggestedPoint.Z);
|
||||
const float FloorProbeZ = SuggestedPoint.Z
|
||||
- FMath::Max(P.CorridorRadius, 0.5f)
|
||||
- P.SurfaceRoughness * VOXEL_NOISE_SCALE * 1.5f - 3.0f;
|
||||
FootingDensity = SourceOnlyGenerator->GetMazeDensity(
|
||||
SuggestedPoint.X, SuggestedPoint.Y, FloorProbeZ, P);
|
||||
FootingDensity = EvalSource(
|
||||
SuggestedPoint.X, SuggestedPoint.Y, FloorProbeZ);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -930,11 +950,14 @@ bool FVoxelForgePassageLandsInOpenSpaceTest::RunTest(const FString& Parameters)
|
||||
FVerticalShaftParams P = Definition->VerticalShaftParams;
|
||||
P.StrateTopWorldZ = StrateTopZ;
|
||||
P.StrateBottomWorldZ = StrateBottomZ;
|
||||
LandingDensity = SourceOnlyGenerator->GetVerticalShaftDensity(
|
||||
SuggestedPoint.X, SuggestedPoint.Y, SuggestedPoint.Z, P);
|
||||
VoxelDensityOps::BuildVerticalShaftStack(SourceStack, P, LiveGenerator.Seed,
|
||||
LiveGenerator.OriginSpineRadius, /*StrateManager*/nullptr);
|
||||
SourceStack.PrepareChunk(SourceContext);
|
||||
LandingDensity = EvalSource(
|
||||
SuggestedPoint.X, SuggestedPoint.Y, SuggestedPoint.Z);
|
||||
const float FloorProbeZ = StrateBottomZ + P.BoundarySealThickness * 0.5f;
|
||||
FootingDensity = SourceOnlyGenerator->GetVerticalShaftDensity(
|
||||
SuggestedPoint.X, SuggestedPoint.Y, FloorProbeZ, P);
|
||||
FootingDensity = EvalSource(
|
||||
SuggestedPoint.X, SuggestedPoint.Y, FloorProbeZ);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -943,10 +966,13 @@ bool FVoxelForgePassageLandsInOpenSpaceTest::RunTest(const FString& Parameters)
|
||||
FFloatingIslandParams P = Definition->FloatingIslandParams;
|
||||
P.StrateTopWorldZ = StrateTopZ;
|
||||
P.StrateBottomWorldZ = StrateBottomZ;
|
||||
LandingDensity = SourceOnlyGenerator->GetFloatingIslandDensity(
|
||||
SuggestedPoint.X, SuggestedPoint.Y, SuggestedPoint.Z, P);
|
||||
FootingDensity = SourceOnlyGenerator->GetFloatingIslandDensity(
|
||||
SuggestedPoint.X, SuggestedPoint.Y, SuggestedPoint.Z - 1.0f, P);
|
||||
VoxelDensityOps::BuildFloatingIslandStack(SourceStack, P, LiveGenerator.Seed,
|
||||
LiveGenerator.OriginSpineRadius, /*StrateManager*/nullptr);
|
||||
SourceStack.PrepareChunk(SourceContext);
|
||||
LandingDensity = EvalSource(
|
||||
SuggestedPoint.X, SuggestedPoint.Y, SuggestedPoint.Z);
|
||||
FootingDensity = EvalSource(
|
||||
SuggestedPoint.X, SuggestedPoint.Y, SuggestedPoint.Z - 1.0f);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user