Mining index: a general targeting index fed by providers; the linear chunk scan goes

Zone.Targets (TargetingIndex) answers Within and best-first Best over
ITargetProvider regions. EntityTargets offers the observer's VisibleEntities;
BeltTargets keys each belt's rocks into kinetic bands and bounds each segment's
annular sector for distance, bearing and visibility. Entity.VisibleChunksInReach
queries the index with DetectionReachPerVisibility, an upper bound from the
sensors' hull. Zone.ChunksNear and AsteroidBelt.InnerRadius are deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-03 15:02:51 +02:00
commit f803151681
11 changed files with 631 additions and 41 deletions

View file

@ -197,4 +197,13 @@ public class Sensor : Behavior, IEventBehavior, IPowerConsumer
var angle = acos(dot(Direction.xz, normalize(diff)));
return Gain(visibility, Evaluate(_data.Sensitivity), _data.SensitivityCurve.Evaluate(angle / PI), length(diff), 1f, false);
}
// An upper bound on sensitivity x response over every bearing, so PassiveRate(v, p) <= v x this / distance
// (Entity.DetectionReachPerVisibility). The curve lies within its control points' hull.
public float PassiveGainBound()
{
var sensitivity = Evaluate(_data.Sensitivity);
var response = _data.SensitivityCurve.HullRange();
return max(sensitivity * response.x, sensitivity * response.y);
}
}