Class EasyARSession
- Espacio de nombres
- easyar
Controla la AR session en la scene y el data flow de todo el lifecycle. Este componente es el punto de entrada de AR. No se permiten varias instancias active al mismo tiempo. Todas las funciones de los componentes EasyAR solo pueden usarse despues de completar la inicializacion de Session.
Observaciones
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.
Propiedades
blockHolder
Obtiene BlockHolder
get blockHolder(): BlockHolder;
megaTracker
Obtiene MegaTracker
get megaTracker(): easyar.MegaTracker;
state
Obtiene current Session status
get state(): SessionState;
Métodos
xrCamera
Obtiene XRCamera in the scene used by the Session
get xrCamera(): xrfs.XRCamera;
Devuelve
dumpLog(signal)
Inicia y detiene log recording. Can be called at any time.
dumpLog(signal: boolean): string;
Parámetros
signalPase true para iniciar y false para detener.
Devuelve
{string} returns the file path; when starting, it returns a string with length 0.
dumpSession(signal)
Inicia y detiene Session data recording. Can be called at any time.
dumpSession(signal: boolean): string;
Parámetros
signalPase true para iniciar y false para detener.
Devuelve
{string} returns the file path; when starting, it returns a string with length 0.
loadAnnotation(id)
Carga annotations. Can only be called after Session.start succeeds.
loadAnnotation(id: string): Promise<easyar.ema.IEma>;
Parámetros
idannotationID。
Devuelve
{easyar.ema.IEma}
pause()
Pausa ARSession; updates of Tracker and camera will stop (note that they will not be controlled again by xrframe at this time).
pause(): void;
Devuelve
{void}
resume()
Reanuda ARSession; updates of Tracker and camera will resume.
resume(): void;
Devuelve
{void}
setDeviceOrientation(deviceOrientation)
Establece current device orientation. Can be called at any time and takes effect immediately.
setDeviceOrientation(deviceOrientation: DeviceOrientation): void;
Parámetros
deviceOrientationActual device orientation.
Devuelve
{void}
setGeoLocationInput(inputMode, geoLocation)
Establece current GPS input mode. Can only be called before Session.start and takes effect after start.
setGeoLocationInput(inputMode: easyar.GeoLocationInputMode, geoLocation?: easyar.GeoLocation): void;
Parámetros
inputModeGPS input mode.
geoLocationGPS information.
Devuelve
{void}
setPlaneDetectionErrorBehavior(behavior)
Establece el comportamiento cuando la plane detection de WeChat Mini Program es anormal.
setPlaneDetectionErrorBehavior(behavior: () => void): void;
Parámetros
behaviorPase una callback function.
Devuelve
{void}
start(options)
Inicia Session.
start(options?: SessionStartOptions): Promise<void>;
Parámetros
optionsoptions startup options, optional.
Devuelve
{Promise
}
stop()
Detiene Session. At this time, all BlockController instances and Trackers used by the Session will be destroyed.
stop(): void;
Devuelve
{void}