wip(assembler): round S1 -- one Core voxel-size source; per-tile feature lists (islands)
AVoxelWorld::CoreVoxelSizeCm (default 25, 32 voxels/tile) flows through plan, field, mesher, content, water, atmosphere, edits and collision. Staged-owner BuildHost passes at 20 cm (SurfaceWorld + islands, W1/W8/W16, anchors, BP edits, collision) with a fixed-25cm negative control; default-size hashes match round 4; Core off stays legacy 12.5 cm. Reusable BuildWorldAssemblyFeatureTileListV1; wired into FloatingIslands only so far. 256-island stress: tile p95 112.5 -> 2.0 ms, 0 mismatches, dropped-feature control fails. Content placement measured (no populated cells): island ground search 7.25 ms/cell vs legacy 0.29 ms -- open. Outside-review evaluation in Round5/REPORT.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MmSoF64BbRFmk9C3p1VsBJ
This commit is contained in:
1 parent
111cf3d262
commit
d6e69420e8
25 files changed
+2136
-250
No files matched your search
@@ -9,6 +9,9 @@
|
||||
#include "VoxelStrateManager.h"
|
||||
#include "VoxelTerrainOpDefinition.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
|
||||
struct FStandaloneParitySample
|
||||
{
|
||||
FVector PositionVoxels;
|
||||
@@ -38,6 +41,8 @@ struct FStandaloneOwnerWorld
|
||||
bool bGenerateSkirts = true;
|
||||
int32 SkirtCells = 2;
|
||||
int32 LODOctaveDrop = 0;
|
||||
std::uint32_t OwnerVoxelSizeMicrons = 125000;
|
||||
std::uint32_t CoreVoxelSizeMicrons = 250000;
|
||||
};
|
||||
|
||||
namespace StandaloneOwnerLoader
|
||||
@@ -294,22 +299,41 @@ namespace StandaloneOwnerLoader
|
||||
|
||||
inline bool Resolve(const VFJson::Value& Root, FStandaloneOwnerWorld& Out, std::string& Error)
|
||||
{
|
||||
if (Root.Get("voxel_size_cm").Number() != VOXEL_SIZE)
|
||||
{
|
||||
Error = "export voxel_size_cm does not match the standalone VOXEL_SIZE";
|
||||
return false;
|
||||
}
|
||||
const VFJson::Value& OwnerVoxelSize = Root.Get("owner_voxel_size_cm");
|
||||
const VFJson::Value& CoreVoxelSize = Root.Get("core_voxel_size_cm");
|
||||
const VFJson::Value& CoreVoxelSizeMicrons = Root.Get("core_voxel_size_microns");
|
||||
const VFJson::Value& OwnerVoxelSize = Root.Get("owner_voxel_size_cm");
|
||||
const VFJson::Value& OwnerVoxelSizeMicrons = Root.Get("owner_voxel_size_microns");
|
||||
const VFJson::Value& OwnerToCoreScale = Root.Get("owner_to_core_length_scale");
|
||||
if (!std::holds_alternative<std::nullptr_t>(OwnerVoxelSize.Data)
|
||||
&& (!OwnerVoxelSize.IsNumber() || OwnerVoxelSize.Number() != 12.5
|
||||
|| !CoreVoxelSize.IsNumber() || CoreVoxelSize.Number() != 25.0
|
||||
|| !OwnerToCoreScale.IsNumber() || OwnerToCoreScale.Number() != 0.5))
|
||||
const double CoreCm = CoreVoxelSize.Number(Root.Get("voxel_size_cm").Number(VOXEL_SIZE));
|
||||
const double OwnerCm = OwnerVoxelSize.Number(VOXEL_SIZE * 0.5);
|
||||
const double CoreMicrons = CoreVoxelSizeMicrons.Number(CoreCm * 10000.0);
|
||||
const double OwnerMicrons = OwnerVoxelSizeMicrons.Number(OwnerCm * 10000.0);
|
||||
if (!std::isfinite(CoreCm) || !std::isfinite(OwnerCm)
|
||||
|| CoreCm < VOXEL_SIZE * 0.5 || CoreCm > VOXEL_SIZE || OwnerCm <= 0.0
|
||||
|| std::abs(CoreMicrons - CoreCm * 10000.0) > 0.01
|
||||
|| std::abs(OwnerMicrons - OwnerCm * 10000.0) > 0.01
|
||||
|| !Root.Get("voxel_size_cm").IsNumber()
|
||||
|| std::abs(Root.Get("voxel_size_cm").Number() - CoreCm) > 0.0001)
|
||||
{
|
||||
Error = "owner-to-Core import scale must be 12.5 cm to 25 cm at a 0.5 length ratio";
|
||||
Error = "exported Core voxel size is invalid or inconsistent: core_cm="
|
||||
+ std::to_string(CoreCm) + " owner_cm=" + std::to_string(OwnerCm)
|
||||
+ " root_voxel_cm=" + std::to_string(Root.Get("voxel_size_cm").Number())
|
||||
+ " core_microns=" + std::to_string(CoreMicrons)
|
||||
+ " owner_microns=" + std::to_string(OwnerMicrons);
|
||||
return false;
|
||||
}
|
||||
const double ExpectedRatio = OwnerCm / CoreCm;
|
||||
const bool bHasImportScale = OwnerVoxelSize.IsNumber()
|
||||
|| CoreVoxelSize.IsNumber() || OwnerToCoreScale.IsNumber();
|
||||
if (bHasImportScale && (!OwnerVoxelSize.IsNumber() || !CoreVoxelSize.IsNumber()
|
||||
|| !OwnerToCoreScale.IsNumber()
|
||||
|| std::abs(OwnerToCoreScale.Number() - ExpectedRatio) > 1.0e-9))
|
||||
{
|
||||
Error = "owner-to-Core import scale does not match the resolved voxel sizes";
|
||||
return false;
|
||||
}
|
||||
Out.OwnerVoxelSizeMicrons = static_cast<std::uint32_t>(std::llround(OwnerMicrons));
|
||||
Out.CoreVoxelSizeMicrons = static_cast<std::uint32_t>(std::llround(CoreMicrons));
|
||||
Out.Seed = static_cast<int32>(Root.Get("seed").Integer());
|
||||
Out.ClipRadius = static_cast<int32>(Root.Get("clip_radius").Integer(6));
|
||||
Out.MaxClipLevel = static_cast<int32>(Root.Get("max_clip_level").Integer(8));
|
||||
|
||||
Reference in new issue
Block a user