Table of Contents

Class EasyARSession

Ruang Nama
easyar

Mengontrol AR session di scene dan mengontrol data flow seluruh lifecycle. Komponen ini adalah entry point AR. Beberapa instance active tidak diizinkan pada saat yang sama. Semua fungsi komponen EasyAR hanya dapat digunakan setelah inisialisasi Session selesai.

EasyARSession

Keterangan

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.

Properti

blockHolder

Mendapatkan BlockHolder

get blockHolder(): BlockHolder;

megaTracker

Mendapatkan MegaTracker

get megaTracker(): easyar.MegaTracker;

state

Mendapatkan current Session status

get state(): SessionState;

Metode

xrCamera

Mendapatkan XRCamera in the scene used by the Session

get xrCamera(): xrfs.XRCamera;

Mengembalikan

dumpLog(signal)

Memulai dan menghentikan log recording. Can be called at any time.

dumpLog(signal: boolean): string;

Parameter

signal

Teruskan true untuk mulai dan false untuk berhenti.

Mengembalikan

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

dumpSession(signal)

Memulai dan menghentikan Session data recording. Can be called at any time.

dumpSession(signal: boolean): string;

Parameter

signal

Teruskan true untuk mulai dan false untuk berhenti.

Mengembalikan

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

loadAnnotation(id)

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

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

Parameter

id

annotationID。

Mengembalikan

{easyar.ema.IEma}

pause()

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

pause(): void;

Mengembalikan

{void}

resume()

Melanjutkan ARSession; updates of Tracker and camera will resume.

resume(): void;

Mengembalikan

{void}

setDeviceOrientation(deviceOrientation)

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

setDeviceOrientation(deviceOrientation: DeviceOrientation): void;

Parameter

deviceOrientation

Saat ini device orientation.

Mengembalikan

{void}

setGeoLocationInput(inputMode, geoLocation)

Mengatur 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

Mode input GPS.

geoLocation

Informasi GPS.

Mengembalikan

{void}

setPlaneDetectionErrorBehavior(behavior)

Mengatur behavior saat plane detection WeChat Mini Program abnormal.

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

Parameter

behavior

Teruskan callback function.

Mengembalikan

{void}

start(options)

Memulai Session.

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

Parameter

options

options startup options, optional.

Mengembalikan

{Promise}

stop()

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

stop(): void;

Mengembalikan

{void}