Merge branch 'eureka/aetheria-release-mining-4b' into eureka/aetheria-release-mining-4a
This commit is contained in:
commit
dab89ecd63
4 changed files with 532 additions and 77 deletions
|
|
@ -726,6 +726,24 @@ public class Zone
|
|||
return AsteroidBelts[belt].Pose(index, time, parentPosition, size);
|
||||
}
|
||||
|
||||
// Mining Cut 4b: the one owner of a chunk's planar velocity, the central difference of the pose function at zone
|
||||
// time. Derived on every read, never stored: the intercept, the fire-time projection and the mount's sweep all
|
||||
// read it here.
|
||||
public float2 ChunkVelocity(ChunkId chunk)
|
||||
{
|
||||
const double h = .05;
|
||||
var ahead = ChunkPose(chunk.Field, chunk.Index, _time + h).xy;
|
||||
var behind = ChunkPose(chunk.Field, chunk.Index, _time - h).xy;
|
||||
return (ahead - behind) / (float) (2 * h);
|
||||
}
|
||||
|
||||
// A chunk's radius in schematic cells: what visibility and a shot's silhouette both measure it in.
|
||||
public float ChunkCells(ChunkId chunk) => ChunkRadius(chunk) / SchematicCellSize;
|
||||
|
||||
// Mining Cut 4b: absorbed impacts on chunks, published by FireControl once per rock hit -- the chunk's own
|
||||
// Entity.Capabilities, since a chunk is not an Entity. Presentations subscribe; nothing here decides.
|
||||
public readonly CapabilityEvents ChunkCapabilities = new CapabilityEvents();
|
||||
|
||||
// Mining Cut 3 (docs/mining-cut-refresh.md): how bright a chunk is -- Reflector's rule (cross-section × the light
|
||||
// on it), with the field kind's reflectivity per schematic cell times the chunk's area in cells. Computed when
|
||||
// asked; nothing about it is stored. A worn chunk shrinks and dims; a broken one, or one of a kindless belt, is dark.
|
||||
|
|
@ -734,7 +752,7 @@ public class Zone
|
|||
if (!ChunkExists(chunk)) return 0f;
|
||||
var kind = _itemManager.ItemData.Get(((AsteroidBeltData) Planets[chunk.Field]).Kind);
|
||||
if (kind == null) return 0f;
|
||||
var cells = ChunkRadius(chunk) / _itemManager.GameplaySettings.SchematicCellSize;
|
||||
var cells = ChunkCells(chunk);
|
||||
return kind.CrossSection * PI * cells * cells * GetLight(ChunkPose(chunk.Field, chunk.Index).xy);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue