Skip to main content

WebARSession

class WebARSession implements ARSession

WebXR based abstract AR session class

Properties
Methods

constructor

new WebARSession(view3D, options, options.features, options.vertical, options.overlayRoot, options.useLightEstimation, options.rotate, options.translate, options.scale, options.ring, options.deadzone, options.initialScale)

Create new instance of WebARSession

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
view3DView3DInstance of the View3D
optionsobject✔️{}Options
options.featuresobject✔️{}Additional features(see XRSessionInit) of the WebXR session.
options.verticalboolean✔️falseWhether to place 3D model vertically on the wall.
options.overlayRootHTMLElement | string | null✔️dom-overlay's root element. You can set either HTMLElement or query selector for that element.
options.useLightEstimationboolean✔️trueWhether to use light-estimation feature.
options.rotateboolean | ARSwirlControlOptions✔️trueOptions for the rotate control inside the AR session. You can disable rotate control by giving false.
options.translateboolean | ARTranslateControlOptions✔️trueOptions for the translate control inside the AR session. You can disable translate control by giving false.
options.scaleboolean | ARScaleControlOptions✔️trueOptions for the scale control inside the AR session. You can disable scale control by giving false.
options.ringFloorIndicatorOptions✔️{}Options for the floor ring.
options.deadzoneDeadzoneCheckerOptions✔️{}Control's deadzone options.
options.initialScale"auto" | number✔️"auto"Initial scale of the model. If set to "auto", it will modify big overflowing 3D model's scale to fit the screen when it's initially displayed. This won't increase the 3D model's scale more than 1.

Properties

control

ARControl instance of this session

Type: ARFloorControl

Methods

isAvailable

static

Return availability of this session

Returns: Promise<boolean>

  • A Promise that resolves availability of this session(boolean).

enter

async

Enter session

Returns: Promise

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
view3DInstance of the View3D

exit

async

Exit this session