public sealed class NearestPerceivedServiceWrites the nearest currently-perceived target into a key, on an interval.
Remarks
doc 37 § Part 3's NearestPerceived. UpdateBlackboardService would not do: an IWorldSensor writes one key and nearest-perceived is naturally two, and the "nearest" it needs is a distance from the listener rather than a value read out of the world. ⚠ Nearest, not freshest — and that is a different node from what the binding does. A binding follows the most recent news, which is what "react to what just happened" means. A service like this one follows the closest thing, which is what "shoot at whichever one is about to reach me" means. Both are wanted, so both exist and neither is a mode of the other.
Methods (2)
public NearestPerceivedService(PerceptionSystem system, SenseMask senses, BlackboardKey target, BlackboardKey? location = null)Writes the nearest currently-perceived target into a key, on an interval.
public override void Tick(in BehaviorContext context, Span<byte> state, float delta)Its interval has elapsed.
Used by (1)
- PerceptionNodesVixen.Ai.Perception