Protected_The application element this entity is registered with, cached at registration time so the entity can be unregistered even once this element has left the DOM.
The nearest ancestor <pc-app> element, or null if this element has no <pc-app>
ancestor. The search starts at the parent, so an element never resolves to itself.
The closest app element, or null.
The nearest ancestor element that fronts an entity — <pc-entity>, <pc-model> or
<pc-node> — or null if this element has no such ancestor. The search starts at the
parent, so an element never resolves to itself.
The closest entity-fronting element, or null.
Gets the enabled override.
The enabled state, or null while no override is set.
Sets the enabled override. null clears it, restoring the authored state.
The enabled state, or null.
Gets which match to bind.
The match index, or null when unset.
Sets which match to bind when name matches more than one node, 0-based in depth-first
order. A change retargets, like name. null means unset - required when the name is
ambiguous, optional otherwise.
The match index, or null.
Sets the material overrides: a sparse mapping from selector to pc-material id, applied
to the bound node's authored render component. A name:X key selects every mesh instance
whose baseline material is named X; an index:N key selects mesh instance N and wins
over a name rule for the same instance. Assignments no rule matches keep their baseline
materials. null clears the mapping, restoring every baseline assignment.
Gets the name of the node to bind.
The node name.
Sets the name of the node to bind. A change retargets: the current binding's overrides
revert and the new name resolves afresh. name on a pc-node is never a rename of the
authored node - it is only ever a reference.
The node name.
The path of the bound node below the search root, /-separated, or null while not
bound.
The bound node's path, or null.
Sets the local scale override. null clears it, restoring the authored scale.
The scale, or null.
The binding state: pending until the host instantiates and name resolves, bound
once decorated, missing/ambiguous/duplicate when resolution failed (each also
warns). Useful for asserting a document's bindings programmatically.
The binding state.
Gets the tags override.
The tags, or null while no override is set.
Sets the tags override. null clears it, restoring the authored tags.
The tags, or null.
Protected_Called when the element is fully initialized and ready. Subclasses should call this when
they're ready. Resolves the ready promise and dispatches a bubbling, composed ready
event. Signals at most once per readiness cycle: a repeat call before _resetReady
has re-armed the promise does nothing.
Protected_Registers entity as this element's backing entity with the owning application, which
joins engine nodes back to elements by identity (never by name).
The entity to register.
Protected_Returns the ready promise to its pending state. Subclasses should call this when the
resource their readiness announced is torn down (typically from disconnectedCallback),
so that a later re-initialization can signal readiness again. Does nothing while the
promise is still pending — an in-flight waiter carries over to the next readiness cycle
rather than being stranded on a promise nothing will ever resolve.
Protected_Removes the registration for entity.
The entity to unregister.
Protected_Tracks whether an inline onpointer* attribute is present. The browser itself compiles and
runs these attributes — they are standard GlobalEventHandlers, so setting one replaces
the previous handler and removing it removes the handler, exactly like onclick on any
HTML element. But because they bypass EventTarget.addEventListener, the connect/disconnect
bookkeeping that lets the application lazily attach its canvas pointer handlers must be
kept in sync here.
The attribute name (e.g. 'onpointerdown').
The attribute value, or null when the attribute has been removed.
Returns a promise that resolves with this element when it's ready. This is the low-level primitive underlying whenReady, which is the recommended way to wait for elements.
Readiness tracks the element's current lifecycle: once a ready element is torn down (for example by removing it from the document), this returns a fresh promise that resolves when the element is next ready. A promise obtained earlier stays resolved — call this again after re-inserting an element rather than reusing a promise from before its removal.
A promise that resolves with this element when it's ready.
The NodeElement interface provides properties and methods for manipulating
<pc-node>elements. The NodeElement interface also inherits the properties and methods of the HTMLElement interface.A
pc-nodeis an override element: wherepc-entitycreates an entity,pc-nodebinds to a node apc-modelloaded and declares overrides against the authored asset — components to add, properties to change, content to attach. Attributes present apply as overrides; attributes absent leave authored values untouched, and removing an attribute (or assigningnullto the matching property) restores the authored value.nameselects among the host model's nodes (first match in depth-first order), nesting apc-nodeinside another scopes the search to that subtree, andindexpicks among identically named matches. Whennamematches more than one node and noindexis given, the element warns and binds nothing.The element becomes ready once bound, and never while unresolved — a missing or ambiguous name warns and records the failure in
state, readiness stays unresolved, and descendants wait with it.The pointer events below are dispatched by the containing
<pc-app>element when the pointer intersects the bound node's geometry, exactly as for<pc-entity>.Attribute
name - The name of the node to bind, resolved within the nearest ancestor
pc-model(orpc-node) once it has instantiated.Attribute
index - Which match to bind when
namematches more than one node, 0-based in depth-first order. Optional for a unique match; required for an ambiguous one.Attribute
enabled - Overrides the node's enabled state.
Attribute
position - Overrides the node's local position, as an "x y z" triple.
Attribute
rotation - Overrides the node's local rotation (Euler angles), as an "x y z" triple.
Attribute
scale - Overrides the node's local scale, as an "x y z" triple.
Attribute
tags - Overrides the node's tags, separated by spaces or commas.
Attribute
material-overrides - Overrides material assignments on the bound node's render component, as a JSON object from selector to
pc-materialid — for example{"name:CarPaint": "candy-red", "index:7": "smoked-glass"}. Aname:Xkey selects every mesh instance whose baseline material is namedX; anindex:Nkey selects mesh instanceNand wins over a name rule for the same instance. Assignments no rule matches keep their baseline materials, and removing the attribute restores all of them. Usepc-model.hierarchy()to discover the names and indices a node offers.Attribute
onpointerenter - Script to run when the pointer moves onto the node.
Attribute
onpointerleave - Script to run when the pointer moves off the node.
Attribute
onpointermove - Script to run when the pointer moves over the node.
Attribute
onpointerdown - Script to run when a pointer button is pressed over the node.
Attribute
onpointerup - Script to run when a pointer button is released over the node.
Fires
pointerenter - Fired when the pointer moves onto the node.
Fires
pointerleave - Fired when the pointer moves off the node.
Fires
pointermove - Fired when the pointer moves over the node.
Fires
pointerdown - Fired when a pointer button is pressed over the node.
Fires
pointerup - Fired when a pointer button is released over the node.