Class EasyARSession
- Пространство имен
- easyar
Управляет AR session в scene и data flow всего lifecycle. Этот компонент является точкой входа AR. Одновременно не допускается несколько active instances. Все функции компонентов EasyAR можно использовать только после завершения инициализации Session.
Примечания
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.
Свойства
blockHolder
Получает BlockHolder
get blockHolder(): BlockHolder;
megaTracker
Получает MegaTracker
get megaTracker(): easyar.MegaTracker;
state
Получает current Session status
get state(): SessionState;
Методы
xrCamera
Получает XRCamera in the scene used by the Session
get xrCamera(): xrfs.XRCamera;
Возвращаемое значение
dumpLog(signal)
Начинает и останавливает log recording. Can be called at any time.
dumpLog(signal: boolean): string;
Параметры
signalПередайте true для начала и false для остановки.
Возвращаемое значение
{string} returns the file path; when starting, it returns a string with length 0.
dumpSession(signal)
Начинает и останавливает Session data recording. Can be called at any time.
dumpSession(signal: boolean): string;
Параметры
signalПередайте true для начала и false для остановки.
Возвращаемое значение
{string} returns the file path; when starting, it returns a string with length 0.
loadAnnotation(id)
Загружает annotations. Can only be called after Session.start succeeds.
loadAnnotation(id: string): Promise<easyar.ema.IEma>;
Параметры
idannotationID。
Возвращаемое значение
{easyar.ema.IEma}
pause()
Приостанавливает ARSession; updates of Tracker and camera will stop (note that they will not be controlled again by xrframe at this time).
pause(): void;
Возвращаемое значение
{void}
resume()
Возобновляет ARSession; updates of Tracker and camera will resume.
resume(): void;
Возвращаемое значение
{void}
setDeviceOrientation(deviceOrientation)
Устанавливает current device orientation. Can be called at any time and takes effect immediately.
setDeviceOrientation(deviceOrientation: DeviceOrientation): void;
Параметры
deviceOrientationТекущая device orientation.
Возвращаемое значение
{void}
setGeoLocationInput(inputMode, geoLocation)
Устанавливает current GPS input mode. Can only be called before Session.start and takes effect after start.
setGeoLocationInput(inputMode: easyar.GeoLocationInputMode, geoLocation?: easyar.GeoLocation): void;
Параметры
inputModeGPS input mode.
geoLocationGPS information.
Возвращаемое значение
{void}
setPlaneDetectionErrorBehavior(behavior)
Задает поведение при abnormal plane detection в WeChat Mini Program.
setPlaneDetectionErrorBehavior(behavior: () => void): void;
Параметры
behaviorПередайте callback function.
Возвращаемое значение
{void}
start(options)
Запускает Session.
start(options?: SessionStartOptions): Promise<void>;
Параметры
optionsoptions startup options, optional.
Возвращаемое значение
{Promise
}
stop()
Останавливает Session. At this time, all BlockController instances and Trackers used by the Session will be destroyed.
stop(): void;
Возвращаемое значение
{void}