#pragma once #include "CoreMinimal.h" /** * The plain data types of the world definition (DESIGN_UE.md sections 2.2, 2.7 - 2.12): SDF primitives, deposits, * beacons, places. Metres, Unreal axes (+X down-canyon, +Y east, +Z up). Split from DescentWorldDef.h so the density * function (DescentSDF.h) and the definition (DescentWorldDef.h) can include each other's data without a cycle. */ namespace Descent::World { /** 0 ferrite (orange, 60 cr), 1 cobalt (cyan, 120 cr), 2 pearl (magenta, 260 cr) (v2). */ enum class EOreType : uint8 { Ferrite = 0, Cobalt = 1, Pearl = 2, }; /** The glow colour of an ore type (section 7.8, v2). */ FLinearColor OreGlowColor(EOreType Type); const TCHAR* OreName(EOreType Type); /** One piece of a tube: a capsule of varying radius. Tube is an index into FDescentWorldDef::Tubes (-1 for a worm). */ struct FSegment { FVector A = FVector::ZeroVector; FVector B = FVector::ZeroVector; double Ra = 0.0; double Rb = 0.0; bool bBig = false; // carrier-scale: low wall noise, counts as a carrier route int32 Tube = -1; }; /** An ellipsoid void. Radii are the semi-axes along X, Y, Z. */ struct FChamber { FName Id; FVector C = FVector::ZeroVector; FVector R = FVector::OneVector; double K = 10.0; // smooth-union blend bool bHonest = false; // full-pressure void (section 2.9) }; /** A vertical cylinder void. */ struct FWell { FName Id; double X = 0.0, Y = 0.0, R = 80.0, Z0 = 0.0, Z1 = 0.0; // Z0 bottom, Z1 top }; struct FPore { FVector C = FVector::ZeroVector; double R = 0.0; }; /** Rock added back across a well: a thin slab with a slot too small for the carrier and a Tender crack. */ struct FShelf { FName Id; double X = 0.0, Y = 0.0, Zc = 0.0, T = 3.0, Rclip = 88.0; FVector2D Axis = FVector2D(1.0, 0.0); // unit vector along the slot, in plan double Half = 0.0, W = 0.0; // slot half-length (end to end) and half-width TArray Crack; double CrackR = 3.4; }; /** Rock added back as an elliptical ring across a gallery. */ struct FPinch { FName Id; FVector C = FVector::ZeroVector; FVector Dir = FVector::XAxisVector; FVector Side = FVector::YAxisVector; FVector Up = FVector::ZAxisVector; double Half = 0.0, Ax = 0.0, Ay = 0.0, TubeR = 34.0; int32 Tube = -1; double S = 0.0; // metres along the gallery }; /** Rock added back as an annulus inside a well. */ struct FRing { FName Id; int32 Well = -1; double Zc = 0.0, Half = 7.0, RInner = 56.0; }; struct FSpongeZone { FName Id; FBox Box = FBox(ForceInit); }; /** A designed tube: a gallery (turtle path, big) or a Tender tube (Catmull-Rom through points). Pts are (X, Y, Z, radius). */ struct FTube { FName Id; FString Name; bool bBig = false; TArray Pts; TArray Cum; // cumulative length along Pts (galleries) double Len = 0.0; }; struct FDeposit { FVector A = FVector::ZeroVector; // capsule end points FVector B = FVector::ZeroVector; double R = 0.0; EOreType Type = EOreType::Ferrite; FVector N = FVector::ZAxisVector; // outward wall normal FVector P = FVector::ZeroVector; // surface point the vein sits behind int32 Yield = 0; // loose chunks it gives when fully mined }; struct FBeacon { FName Id; FString Name; FString Who; FVector P = FVector::ZeroVector; FString Text; }; /** A named place for `Descent.World.Goto` and the tour scenarios. */ struct FPlace { FName Name; FVector PosM = FVector::ZeroVector; FVector LookAtM = FVector::ZeroVector; // a sensible thing to look at from there }; /** The point of a gallery at a given distance along it. */ struct FTubeSample { FVector P = FVector::ZeroVector; double R = 0.0; double YawRad = 0.0; double PitchRad = 0.0; FVector Dir = FVector::XAxisVector; }; }