Skip to content

@orillusion/core


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() ​

static bindUpdate(view, component, call): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:91

Parameters ​

view ​

View3D

component ​

IComponent

call ​

Function

Returns ​

void


unBindUpdate() ​

static unBindUpdate(view, component): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:101

Parameters ​

view ​

View3D

component ​

IComponent

Returns ​

void


bindLateUpdate() ​

static bindLateUpdate(view, component, call): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:109

Parameters ​

view ​

View3D

component ​

IComponent

call ​

Function

Returns ​

void


unBindLateUpdate() ​

static unBindLateUpdate(view, component): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:119

Parameters ​

view ​

View3D

component ​

IComponent

Returns ​

void


bindBeforeUpdate() ​

static bindBeforeUpdate(view, component, call): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:127

Parameters ​

view ​

View3D

component ​

IComponent

call ​

Function

Returns ​

void


unBindBeforeUpdate() ​

static unBindBeforeUpdate(view, component): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:137

Parameters ​

view ​

View3D

component ​

IComponent

Returns ​

void


bindCompute() ​

static bindCompute(view, component, call): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:145

Parameters ​

view ​

View3D

component ​

IComponent

call ​

Function

Returns ​

void


unBindCompute() ​

static unBindCompute(view, component): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:155

Parameters ​

view ​

View3D

component ​

IComponent

Returns ​

void


bindGraphic() ​

static bindGraphic(view, component, call): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:163

Parameters ​

view ​

View3D

component ​

IComponent

call ​

Function

Returns ​

void


unBindGraphic() ​

static unBindGraphic(view, component): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:173

Parameters ​

view ​

View3D

component ​

IComponent

Returns ​

void


appendWaitStart() ​

static appendWaitStart(component): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:181

Parameters ​

component ​

IComponent

Returns ​

void


removeWaitStart() ​

static removeWaitStart(obj, component): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:194

Parameters ​

obj ​

Object3D

component ​

IComponent

Returns ​

void


bindEnablePick() ​

static bindEnablePick(view, component, call): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:205

Parameters ​

view ​

View3D

component ​

ColliderComponent

call ​

Function

Returns ​

void


unBindEnablePick() ​

static unBindEnablePick(view, component): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:215

Parameters ​

view ​

View3D

component ​

ColliderComponent

Returns ​

void


register() ​

static register(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 ​

View3D

ctor ​

Function

component ​

IComponent

Returns ​

void


unregister() ​

static unregister(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 ​

View3D

ctor ​

Function

component ​

IComponent

Returns ​

void


collectByTypeLayered() ​

static collectByTypeLayered<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 ​

View3D

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() ​

static removeView(view): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:313

Parameters ​

view ​

View3D

Returns ​

void


removeNullViewEntriesForCtx() ​

static removeNullViewEntriesForCtx(ctx): void

Defined in: src/gfx/renderJob/collect/ComponentCollect.ts:329

Parameters ​

ctx ​

unknown

Returns ​

void