Table of Contents

Class EasyARSession

Spazio dei nomi
easyar

Controlla la AR session nella scene e il data flow dell'intero lifecycle. Questo componente e il punto di ingresso di AR. Non sono consentite piu istanze active contemporaneamente. Tutte le funzioni dei componenti EasyAR possono essere usate solo dopo il completamento dell'inizializzazione della Session.

EasyARSession

Osservazioni

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.

Proprietà

blockHolder

Ottiene BlockHolder

get blockHolder(): BlockHolder;

megaTracker

Ottiene MegaTracker

get megaTracker(): easyar.MegaTracker;

state

Ottiene current Session status

get state(): SessionState;

Metodi

xrCamera

Ottiene XRCamera in the scene used by the Session

get xrCamera(): xrfs.XRCamera;

Valore restituito

dumpLog(signal)

Avvia e arresta log recording. Can be called at any time.

dumpLog(signal: boolean): string;

Parametri

signal

Passare true per avviare e false per arrestare.

Valore restituito

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

dumpSession(signal)

Avvia e arresta Session data recording. Can be called at any time.

dumpSession(signal: boolean): string;

Parametri

signal

Passare true per avviare e false per arrestare.

Valore restituito

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

loadAnnotation(id)

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

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

Parametri

id

annotationID。

Valore restituito

{easyar.ema.IEma}

pause()

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

pause(): void;

Valore restituito

{void}

resume()

Riprende ARSession; updates of Tracker and camera will resume.

resume(): void;

Valore restituito

{void}

setDeviceOrientation(deviceOrientation)

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

setDeviceOrientation(deviceOrientation: DeviceOrientation): void;

Parametri

deviceOrientation

Attuale device orientation.

Valore restituito

{void}

setGeoLocationInput(inputMode, geoLocation)

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

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

Parametri

inputMode

GPS input mode.

geoLocation

GPS information.

Valore restituito

{void}

setPlaneDetectionErrorBehavior(behavior)

Imposta il behavior quando la plane detection di WeChat Mini Program e anomala.

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

Parametri

behavior

Passare una callback function.

Valore restituito

{void}

start(options)

Avvia Session.

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

Parametri

options

options startup options, optional.

Valore restituito

{Promise}

stop()

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

stop(): void;

Valore restituito

{void}