Skip to content

CachedEntityQueryBuilderBase.WithinRadius(Vector2, float) Method

Definition

Namespace: Brine2D.ECS.Query

Filters entities whose Position is within radius of center.

C#
public TSelf WithinRadius(System.Numerics.Vector2 center, float radius);

Parameters

center System.Numerics.Vector2

radius System.Single

Returns

TSelf

Remarks

The position check runs when the cache rebuilds (i.e. on the next structural change after a prior Execute() or ForEach() call). Because position updates do not trigger structural invalidation, the cached result may be stale if entities move between structural changes. Use the one-shot WithinRadius\(Vector2, float\) for queries that must reflect the current frame's positions every frame.