Table of Contents

Class EasyARSession

Namespace
easyar

Steuert die AR session in der scene und den data flow des gesamten lifecycle. Diese Komponente ist der Einstiegspunkt fur AR. Mehrere active instances sind gleichzeitig nicht erlaubt. Alle Funktionen der EasyAR-Komponenten konnen erst nach Abschluss der Session-Initialisierung verwendet werden.

EasyARSession

Hinweise

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.

Eigenschaften

blockHolder

Ruft ab BlockHolder

get blockHolder(): BlockHolder;

megaTracker

Ruft ab MegaTracker

get megaTracker(): easyar.MegaTracker;

state

Ruft ab current Session status

get state(): SessionState;

Methoden

xrCamera

Ruft ab XRCamera in the scene used by the Session

get xrCamera(): xrfs.XRCamera;

Rückgabewert

dumpLog(signal)

Startet und stoppt log recording. Can be called at any time.

dumpLog(signal: boolean): string;

Parameter

signal

Ubergeben Sie true zum Starten und false zum Stoppen.

Rückgabewert

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

dumpSession(signal)

Startet und stoppt Session data recording. Can be called at any time.

dumpSession(signal: boolean): string;

Parameter

signal

Ubergeben Sie true zum Starten und false zum Stoppen.

Rückgabewert

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

loadAnnotation(id)

Ladt annotations. Can only be called after Session.start succeeds.

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

Parameter

id

annotationID。

Rückgabewert

{easyar.ema.IEma}

pause()

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

pause(): void;

Rückgabewert

{void}

resume()

Setzt fort ARSession; updates of Tracker and camera will resume.

resume(): void;

Rückgabewert

{void}

setDeviceOrientation(deviceOrientation)

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

setDeviceOrientation(deviceOrientation: DeviceOrientation): void;

Parameter

deviceOrientation

Aktuelle device orientation.

Rückgabewert

{void}

setGeoLocationInput(inputMode, geoLocation)

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

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

Parameter

inputMode

GPS input mode.

geoLocation

GPS information.

Rückgabewert

{void}

setPlaneDetectionErrorBehavior(behavior)

Legt das Verhalten fest, wenn die plane detection im WeChat Mini Program abnormal ist.

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

Parameter

behavior

Ubergeben Sie eine callback function.

Rückgabewert

{void}

start(options)

Startet Session.

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

Parameter

options

options startup options, optional.

Rückgabewert

{Promise}

stop()

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

stop(): void;

Rückgabewert

{void}