DebugRegistryImpl
Defined in: DebugRegistryImpl.ts:11
Concrete implementation of the DebugRegistry interface.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DebugRegistryImpl():
DebugRegistryImpl
Returns
Section titled “Returns”DebugRegistryImpl
Properties
Section titled “Properties”contributors
Section titled “contributors”
readonlycontributors:Map<string,DebugContributor>
Defined in: DebugRegistryImpl.ts:12
enabled
Section titled “enabled”enabled:
boolean=false
Defined in: DebugRegistryImpl.ts:15
vectors
Section titled “vectors”
readonlyvectors:VectorDrawStore
Defined in: DebugRegistryImpl.ts:14
Backs drawVector; read by the built-in vectors contributor.
Methods
Section titled “Methods”drawVector()
Section titled “drawVector()”drawVector(
entity,vector,options?): () =>void
Defined in: DebugRegistryImpl.ts:26
Draw an arrow on entity for a vector that is read fresh every frame —
velocity, aim direction, knockback, steering output.
// tryResolve, not use(): use() throws without DebugPlugin installed.const debug = this.context.tryResolve(DebugRegistryKey);this.stopArrow = debug?.drawVector(this.entity, () => agent.velocity, { scale: 0.35, color: 0x4ade80, minLength: 1,});The arrow starts at the entity’s world position (plus options.origin)
and points along the vector. Nothing is retained but the provider itself:
it is called once per frame while the overlay is on and the vectors
contributor’s arrows flag is enabled, and not at all otherwise — a
drawVector call in a hot path costs nothing while debug is off.
Returns a disposer that stops the drawing. Calling it twice is harmless. The registration is also dropped when the entity’s life ends — destroyed, or a pool member whose lease ended — so a provider closure never outlives the entity it draws for, and a per-lease registration never accumulates.
Parameters
Section titled “Parameters”entity
Section titled “entity”Entity
vector
Section titled “vector”options?
Section titled “options?”Returns
Section titled “Returns”() => void
Implementation of
Section titled “Implementation of”isEnabled()
Section titled “isEnabled()”isEnabled():
boolean
Defined in: DebugRegistryImpl.ts:34
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”isFlagEnabled()
Section titled “isFlagEnabled()”isFlagEnabled(
contributorName,flag):boolean
Defined in: DebugRegistryImpl.ts:38
Parameters
Section titled “Parameters”contributorName
Section titled “contributorName”string
string
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”register()
Section titled “register()”register(
contributor):void
Defined in: DebugRegistryImpl.ts:18
Parameters
Section titled “Parameters”contributor
Section titled “contributor”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”setFlag()
Section titled “setFlag()”setFlag(
contributorName,flag,value):void
Defined in: DebugRegistryImpl.ts:51
Parameters
Section titled “Parameters”contributorName
Section titled “contributorName”string
string
boolean
Returns
Section titled “Returns”void
toggle()
Section titled “toggle()”toggle():
void
Defined in: DebugRegistryImpl.ts:42
Returns
Section titled “Returns”void
toggleFlag()
Section titled “toggleFlag()”toggleFlag(
contributorName,flag):void
Defined in: DebugRegistryImpl.ts:46
Parameters
Section titled “Parameters”contributorName
Section titled “contributorName”string
string
Returns
Section titled “Returns”void