Class: ComponentCollect
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:17
Static registry of live components, keyed by View3D. Holds the per-view lifecycle callback lists (update / lateUpdate / beforeUpdate / compute / pick / graphic) that the engine drives each frame, plus a type-keyed index used by render passes and other systems to enumerate every instance of a component class in a view. View entries are evicted on engine dispose to avoid leaking scene trees and callbacks.
Constructors
Constructor
new ComponentCollect():
ComponentCollect
Returns
ComponentCollect
Methods
bindUpdate()
staticbindUpdate(view,component,call):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:91
Parameters
view
component
call
Function
Returns
void
unBindUpdate()
staticunBindUpdate(view,component):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:101
Parameters
view
component
Returns
void
bindLateUpdate()
staticbindLateUpdate(view,component,call):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:109
Parameters
view
component
call
Function
Returns
void
unBindLateUpdate()
staticunBindLateUpdate(view,component):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:119
Parameters
view
component
Returns
void
bindBeforeUpdate()
staticbindBeforeUpdate(view,component,call):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:127
Parameters
view
component
call
Function
Returns
void
unBindBeforeUpdate()
staticunBindBeforeUpdate(view,component):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:137
Parameters
view
component
Returns
void
bindCompute()
staticbindCompute(view,component,call):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:145
Parameters
view
component
call
Function
Returns
void
unBindCompute()
staticunBindCompute(view,component):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:155
Parameters
view
component
Returns
void
bindGraphic()
staticbindGraphic(view,component,call):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:163
Parameters
view
component
call
Function
Returns
void
unBindGraphic()
staticunBindGraphic(view,component):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:173
Parameters
view
component
Returns
void
appendWaitStart()
staticappendWaitStart(component):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:181
Parameters
component
Returns
void
removeWaitStart()
staticremoveWaitStart(obj,component):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:194
Parameters
obj
component
Returns
void
bindEnablePick()
staticbindEnablePick(view,component,call):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:205
Parameters
view
component
call
Function
Returns
void
unBindEnablePick()
staticunBindEnablePick(view,component):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:215
Parameters
view
component
Returns
void
register()
staticregister(view,ctor,component):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:233
Add comp to the type-keyed registry under (view, ctor). Used by ComponentBase.onEnable to make the instance discoverable via collectByTypeLayered.
ctor should be the component's concrete class ((this as any).constructor from the instance). Subclasses are registered under their own class — a query for the parent class will not enumerate subclass instances. Idempotent.
Parameters
view
ctor
Function
component
Returns
void
unregister()
staticunregister(view,ctor,component):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:253
Remove comp from the type-keyed registry. Empty inner sets are left in place so the next register call can reuse them without a fresh allocation. Idempotent.
Parameters
view
ctor
Function
component
Returns
void
collectByTypeLayered()
staticcollectByTypeLayered<T>(view,ctor,layerMask,out):T[]
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:286
Collect all live components of ctor registered against view whose visibleLayer intersects layerMask. Pass VisibleLayer.All (0xFFFFFFFF) to skip layer filtering — the bitwise AND then matches every bit.
The caller owns out: it is cleared (length = 0) on entry and populated in place, so a pass can hold a scratch array as a member field and reuse it across frames without GC pressure (mirrors EntityCollect.getLayerLists's buffer-reuse pattern). The returned reference is the same out for chaining.
Callers that want to honour a camera's cullingMask should pre-AND it into layerMask themselves; the predicate inside does not re-read camera state.
Type Parameters
T
T extends IComponent & object
Parameters
view
The View3D this pass executes against. A null view returns immediately.
ctor
Function
Concrete component class to enumerate. Must match what register stored — i.e. the subclass, not a base.
layerMask
number
Already-combined pass × camera mask.
out
T[]
Scratch array, owned by the caller; mutated.
Returns
T[]
removeView()
staticremoveView(view):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:313
Parameters
view
Returns
void
removeNullViewEntriesForCtx()
staticremoveNullViewEntriesForCtx(ctx):void
Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:329
Parameters
ctx
unknown
Returns
void

