Table of Contents

Class EasyARSession

Espace de noms
easyar

Controle l'AR session dans la scene et le data flow de tout le lifecycle. Ce composant est le point d'entree AR. Plusieurs instances active ne sont pas autorisees en meme temps. Toutes les fonctions des composants EasyAR ne peuvent etre utilisees qu'apres la fin de l'initialisation de Session.

EasyARSession

Remarques

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the EasyARSession class.

Propriétés

blockHolder

Obtient BlockHolder

get blockHolder(): BlockHolder;

megaTracker

Obtient MegaTracker

get megaTracker(): easyar.MegaTracker;

state

Obtient current Session status

get state(): SessionState;

Méthodes

xrCamera

Obtient XRCamera in the scene used by the Session

get xrCamera(): xrfs.XRCamera;

Retours

dumpLog(signal)

Demarre et arrete log recording. Can be called at any time.

dumpLog(signal: boolean): string;

Paramètres

signal

Passez true pour demarrer et false pour arreter.

Retours

{string} returns the file path; when starting, it returns a string with length 0.

dumpSession(signal)

Demarre et arrete Session data recording. Can be called at any time.

dumpSession(signal: boolean): string;

Paramètres

signal

Passez true pour demarrer et false pour arreter.

Retours

{string} returns the file path; when starting, it returns a string with length 0.

loadAnnotation(id)

Charge les annotations. Can only be called after Session.start succeeds.

loadAnnotation(id: string): Promise<easyar.ema.IEma>;

Paramètres

id

annotationID。

Retours

{easyar.ema.IEma}

pause()

Met en pause ARSession; updates of Tracker and camera will stop (note that they will not be controlled again by xrframe at this time).

pause(): void;

Retours

{void}

resume()

Reprend ARSession; updates of Tracker and camera will resume.

resume(): void;

Retours

{void}

setDeviceOrientation(deviceOrientation)

Definit current device orientation. Can be called at any time and takes effect immediately.

setDeviceOrientation(deviceOrientation: DeviceOrientation): void;

Paramètres

deviceOrientation

Actuelle device orientation.

Retours

{void}

setGeoLocationInput(inputMode, geoLocation)

Definit current GPS input mode. Can only be called before Session.start and takes effect after start.

setGeoLocationInput(inputMode: easyar.GeoLocationInputMode, geoLocation?: easyar.GeoLocation): void;

Paramètres

inputMode

GPS input mode.

geoLocation

GPS information.

Retours

{void}

setPlaneDetectionErrorBehavior(behavior)

Definit le behavior lorsque la plane detection du WeChat Mini Program est anormale.

setPlaneDetectionErrorBehavior(behavior: () => void): void;

Paramètres

behavior

Passez une callback function.

Retours

{void}

start(options)

Demarre Session.

start(options?: SessionStartOptions): Promise<void>;

Paramètres

options

options startup options, optional.

Retours

{Promise}

stop()

Arrete Session. At this time, all BlockController instances and Trackers used by the Session will be destroyed.

stop(): void;

Retours

{void}