AFrame Events
This section describes events emitted by the xrweb
, xrface
and xrhand
A-Frame components.
You can listen for these events in your web application to call a function that handles the event.
Events Emitted by xrconfig
​
The following events are emitted by xrconfig
(which is automatically added if you only use xrweb
, xrface
, xrhand
or xrlayers
):
Event Emitted | Description |
---|---|
camerastatuschange | This event is emitted when the status of the camera changes. See onCameraStatusChange from XR8.addCameraPipelineModule() for more information on the possible status. |
realityerror | This event is emitted when an error has occured when initializing 8th Wall Web. This is the recommended time at which any error messages should be displayed. The XR8.XrDevice() API can help with determining what type of error messaging should be displayed. |
realityready | This event is emitted when 8th Wall Web has initialized and at least one frame has been successfully processed. This is the recommended time at which any loading elements should be hidden. |
screenshoterror | This event is emitted in response to the screenshotrequest event resulting in an error. |
screenshotready | This event is emitted in response to the screenshotrequest event being being completed successfully. The JPEG compressed image of the AFrame canvas will be provided. |
Events Emitted by xrweb
​
Event Emitted | Description |
---|---|
xrimageloading | This event is emitted when detection image loading begins. |
xrimagescanning | This event is emitted when all detection images have been loaded and scanning has begun. |
xrimagefound | This event is emitted when an image target is first found. |
xrimageupdated | This event is emitted when an image target changes position, rotation or scale. |
xrimagelost | This event is emitted when an image target is no longer being tracked. |
xrmeshfound | This event is emitted when a mesh is first found either after start or after a recenter(). |
xrmeshupdated | This event is emitted when the first mesh found changes position or rotation. |
xrmeshlost | This event is emitted when recenter() is called. |
xrprojectwayspotscanning | This event is emitted when all Project Wayspots have been loaded for scanning. |
xrprojectwayspotfound | This event is emitted when a Project Wayspot is first found. |
xrprojectwayspotupdated | This event is emitted when a Project Wayspot changes position or rotation. |
xrprojectwayspotlost | This event is emitted when a Project Wayspot is no longer being tracked. |
xrtrackingstatus | This event is emitted when XR8.XrController starts and any time tracking status or reason changes. |
Events Emitted by xrface
​
Event Emitted | Description |
---|---|
xrfaceloading | This event is emitted when loading begins for additional face AR resources. |
xrfacescanning | This event is emitted when AR resources have been loaded and scanning has begun. |
xrfacefound | This event is emitted when a face is first found. |
xrfaceupdated | This event is emitted when face is subsequently found. |
xrfacelost | This event is emitted when a face is no longer being tracked. |
xrmouthopened | This event is emitted when a tracked face's mouth opens. |
xrmouthclosed | This event is emitted when a tracked face's mouth closes. |
xrlefteyeopened | This event is emitted when a tracked face's left eye opens. |
xrlefteyeclosed | This event is emitted when a tracked face's left eye closes. |
xrrighteyeopened | This event is emitted when a tracked face's right eye opens. |
xrrighteyeclosed | This event is emitted when a tracked face's right eye closes. |
xrlefteyebrowraised | This event is emitted when a tracked face's left eyebrow is raised from its initial position when the face was found. |
xrlefteyebrowlowered | This event is emitted when a tracked face's left eyebrow is lowered to its initial position when the face was found. |
xrrighteyebrowraised | This event is emitted when a tracked face's right eyebrow is raised from its initial position when the face was found. |
xrrighteyebrowlowered | This event is emitted when a tracked face's right eyebrow is lowered to its initial position when the face was found. |
xrlefteyewinked | This event is emitted when a tracked face's left eye closes and opens within 750ms while the right eye remains open. |
xrrighteyewinked | This event is emitted when a tracked face's right eye closes and opens within 750ms while the left eye remains open. |
xrblinked | This event is emitted when a tracked face's eyes blink. |
xrinterpupillarydistance | This event is emitted when a tracked face's distance in millimeters between the centers of each pupil is first detected. |
Events Emitted by xrhand
​
Event Emitted | Description |
---|---|
xrhandloading | This event is emitted when loading begins for additional hand AR resources. |
xrhandscanning | This event is emitted when AR resources have been loaded and scanning has begun. |
xrhandfound | This event is emitted when a hand is first found. |
xrhandupdated | This event is emitted when hand is subsequently found. |
xrhandlost | This event is emitted when a hand is no longer being tracked. |