TriggerSystemOptions
Defined in: src/modules/collision/trigger.ts:14
Options for makeTriggerSystem. The system factory accepts a
broadphase (which pairs to consider), an optional narrowphase
(which pairs actually overlap), and a callback that fires on each
confirmed overlap. Pair ordering is whatever the broadphase yields;
the system never reorders or de-duplicates.
This is intentionally minimal — most of the work lives in the
broadphase closure, which consumers tailor to their world
(spatial index queries, tag iteration, one-vs-many checks, …).
Type Parameters
Section titled “Type Parameters”TCtx
Properties
Section titled “Properties”broadphase
Section titled “broadphase”
readonlybroadphase: (ctx) =>Iterable<readonly [EntityId,EntityId]>
Defined in: src/modules/collision/trigger.ts:27
Broadphase: yields the ordered pairs [a, b] to test this tick.
Typical patterns: tagA × tagB, sourceId × spatialIndex.queryNear,
or an exhaustive pairwise loop for tiny tag sets.
The generator should not emit the same pair twice unless the consumer intentionally wants the callback to fire twice.
Parameters
Section titled “Parameters”TCtx
Returns
Section titled “Returns”Iterable<readonly [EntityId, EntityId]>
readonlyoptionalname?:string
Defined in: src/modules/collision/trigger.ts:15
onOverlap
Section titled “onOverlap”
readonlyonOverlap: (ctx,a,b) =>void
Defined in: src/modules/collision/trigger.ts:29
Fires once per confirmed overlap.
Parameters
Section titled “Parameters”TCtx
Returns
Section titled “Returns”void
overlaps?
Section titled “overlaps?”
readonlyoptionaloverlaps?: (ctx,a,b) =>boolean
Defined in: src/modules/collision/trigger.ts:35
Narrowphase: returns true if the pair actually overlaps. Omit
when the broadphase already performs an exact test (e.g. a grid
cell lookup that only returns co-located entities).
Parameters
Section titled “Parameters”TCtx
Returns
Section titled “Returns”boolean
phase?
Section titled “phase?”
readonlyoptionalphase?:string
Defined in: src/modules/collision/trigger.ts:16
runAfter?
Section titled “runAfter?”
readonlyoptionalrunAfter?: readonlystring[]
Defined in: src/modules/collision/trigger.ts:17
runBefore?
Section titled “runBefore?”
readonlyoptionalrunBefore?: readonlystring[]
Defined in: src/modules/collision/trigger.ts:18