Mining 4b: a shot at a rock goes through FireControl's one fire path and wears it; the rock is a disc
Designated/Bears/Solve/HitProbability/TravelDirection/PredictedIntercept take TargetRef; PendingShot and ShotOutcome carry Chunk; Zone.ChunkVelocity is the one rock velocity owner; Silhouette's Gaussian sum is the one integrator the rock disc also reads; Apply wears the rock or detonates at its centre; a rock broken in flight is a miss. Deletes the untargeted-round stopgap. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c47a34115c
commit
152f97ba0c
2 changed files with 185 additions and 67 deletions
|
|
@ -715,6 +715,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.
|
||||
|
|
@ -723,7 +741,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