ARHandler Class
AR class handles all the augmented reality related tasks.
Can be used to detect if the host system is capable of displaying AR content and checks for the availability of WebXR with the required modes.
Item Index
Methods
Attributes
Methods
arAvailable
()
Boolean
Check if there is any AR API available, on the device.
Checks if there is support for WebAR or WebXR.
Returns:
True if the browser supports AR.
enterAR
-
renderer
-
onSuccess
Enter virtual reality mode using WebXR or WebAR depending on the API available.
If booth API are available the WebXR API is used.
When displaying AR content the display.requestAnimationFrame should be used to call the render method.
Parameters:
-
renderer
WebGLRendererRenderer used to draw the scene.
-
onSuccess
FunctionMethod called if the application entered AR successfully.
exitAR
-
renderer
Enter virtual reality mode, if the application is not running on AR mode does not do anything.
Parameters:
-
renderer
WebGLRendererRenderer used to draw the scene.
getXRSession
()
Promise
Get WebXR session.
Returns:
Promise used to get the XR session, receives the session as argument.
Attributes
ADDITIVE
String
static
Primarily used by AR devices with transparent lenses which directly allow reality to pass through to the user's eyes.
ALPHA_BLEND
String
static
Used by headsets or goggles which use cameras to capture the real world and display it digitally on the screen or screens used to render the content for the user to see, this offers a way to create an AR presentation using a VR device.