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.
Protected_Whether the hierarchy has been built for this entity — set once _buildHierarchy has parented it. Read by subclasses that gate work on the entity being in the scene graph.
Gets the id of the pc-asset to use for the model.
The asset ID.
Sets the id of the pc-asset to use for the model.
The asset ID.
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.
The root entity of the instantiated model content, parented beneath the host entity.
null until the container asset has loaded and been instantiated, after a failed load,
and again once the element has been removed from the document.
The content root entity, or null.
Gets the enabled state of the entity.
Whether the entity is enabled.
Sets the enabled state of the entity.
Whether the entity is enabled.
Gets the name of the entity.
The name of the entity.
Sets the name of the entity.
The name of the entity.
Gets the tags of the entity.
The tags of the entity.
Sets the tags of the entity.
The tags of the entity.
Protected_Starts (or restarts) the content load once the host has been parented. Readiness is not announced here — it tracks the content settling, not the host entering the scene graph.
Protected_Extends the owner reset for the content: the engine's destroy cascade has already taken the content root down with the host subtree, so only the reference and the in-flight load are dropped here. The next build re-creates the host and re-instantiates the content.
The host entity that was destroyed.
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 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 snapshot of the instantiated node tree, or null while there is none (the
container asset has not loaded, or the element has left the document). One call grounds a
session — a browser console, a test, an agent — in the vocabulary pc-node binding
resolves against: the instantiated names (HierarchyNode.name), paths, match
indices, attached component types and the material assignments of render components
(HierarchyNode.materials). String(...) of the result, or of any node in it,
is the printable form.
The snapshot is plain data, computed afresh each call: it does not follow later changes to the hierarchy, and mutating it changes nothing. It covers the instantiated content only — the host entity the element fronts is not part of the asset's node tree.
The root of the instantiated node tree, or null.
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 ModelElement interface provides properties and methods for manipulating
<pc-model>elements. The ModelElement interface also inherits the properties and methods of the HTMLElement interface.The element creates and fronts a stable host entity:
entityis that host, created when the application builds its hierarchy and kept acrossassetchanges, so the element's transform and tags are instance placement that composes with whatever transform the asset authored on its root. The instantiated content is parented beneath the host and exposed as contentEntity.The element becomes ready once its current asset selection has settled: the container asset has loaded and its content root has been parented beneath the host, the load has failed (
contentEntitystaysnull— listen forerror, or checkcontentEntity, to tell the outcomes apart), or no asset is assigned at all. Changingassetre-arms readiness and instantiates anew, so aready()obtained after the change resolves against the new content. Apc-modeloutside apc-app, or referencing an unknown asset id, warns and never becomes ready.The pointer events below are dispatched by the containing
<pc-app>element when the pointer intersects the model's geometry, exactly as for<pc-entity>— a hit on a content node that nopc-nodefronts resolves to this element.Attribute
enabled - The enabled state of the model.
Attribute
name - The name of the model.
Attribute
position - The position of the model.
Attribute
rotation - The rotation of the model.
Attribute
scale - The scale of the model.
Attribute
tags - The tags of the model.
Attribute
onpointerenter - Script to run when the pointer moves onto the model.
Attribute
onpointerleave - Script to run when the pointer moves off the model.
Attribute
onpointermove - Script to run when the pointer moves over the model.
Attribute
onpointerdown - Script to run when a pointer button is pressed over the model.
Attribute
onpointerup - Script to run when a pointer button is released over the model.
Fires
pointerenter - Fired when the pointer moves onto the model.
Fires
pointerleave - Fired when the pointer moves off the model.
Fires
pointermove - Fired when the pointer moves over the model.
Fires
pointerdown - Fired when a pointer button is pressed over the model.
Fires
pointerup - Fired when a pointer button is released over the model.
Fires
load - Fired each time a container asset finishes instantiating, including re-instantiation after
assetchanges. Does not bubble — listen on this element, or use a capture-phase listener on an ancestor.Fires
error - Fired when the container asset fails to load, with the engine's error in
message. Does not bubble. The element still becomes ready — readiness means the load settled, not that it succeeded.