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
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
view3D | View3D | Instance of the View3D | ||
options | object | ✔️ | {} | Options |
options.features | object | ✔️ | {} | Additional features(see XRSessionInit) of the WebXR session. |
options.vertical | boolean | ✔️ | false | Whether to place 3D model vertically on the wall. |
options.overlayRoot | HTMLElement | string | null | ✔️ | dom-overlay 's root element. You can set either HTMLElement or query selector for that element. | |
options.useLightEstimation | boolean | ✔️ | true | Whether to use light-estimation feature. |
options.rotate | boolean | ARSwirlControlOptions | ✔️ | true | Options for the rotate control inside the AR session. You can disable rotate control by giving false . |
options.translate | boolean | ARTranslateControlOptions | ✔️ | true | Options for the translate control inside the AR session. You can disable translate control by giving false . |
options.scale | boolean | ARScaleControlOptions | ✔️ | true | Options for the scale control inside the AR session. You can disable scale control by giving false . |
options.ring | FloorIndicatorOptions | ✔️ | {} | Options for the floor ring. |
options.deadzone | DeadzoneCheckerOptions | ✔️ | {} | 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
Return availability of this session
Returns: Promise<boolean>
- A Promise that resolves availability of this session(boolean).
enter
Enter session
Returns: Promise
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
view3D | Instance of the View3D |
exit
Exit this session