Class EasyARSession
- Espaço de nomes
- easyar
Controla a AR session na scene e o data flow de todo o lifecycle. Este componente e o ponto de entrada de AR. Varias instancias active nao sao permitidas ao mesmo tempo. Todas as funcoes dos componentes EasyAR so podem ser usadas depois que a inicializacao da Session for concluida.
Comentários
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.
Propriedades
blockHolder
Obtem BlockHolder
get blockHolder(): BlockHolder;
megaTracker
Obtem MegaTracker
get megaTracker(): easyar.MegaTracker;
state
Obtem current Session status
get state(): SessionState;
Métodos
xrCamera
Obtem XRCamera in the scene used by the Session
get xrCamera(): xrfs.XRCamera;
Retorna
dumpLog(signal)
Inicia e para log recording. Can be called at any time.
dumpLog(signal: boolean): string;
Parâmetros
signalPasse true para iniciar e false para parar.
Retorna
{string} returns the file path; when starting, it returns a string with length 0.
dumpSession(signal)
Inicia e para Session data recording. Can be called at any time.
dumpSession(signal: boolean): string;
Parâmetros
signalPasse true para iniciar e false para parar.
Retorna
{string} returns the file path; when starting, it returns a string with length 0.
loadAnnotation(id)
Carrega annotations. Can only be called after Session.start succeeds.
loadAnnotation(id: string): Promise<easyar.ema.IEma>;
Parâmetros
idannotationID。
Retorna
{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;
Retorna
{void}
resume()
Retoma ARSession; updates of Tracker and camera will resume.
resume(): void;
Retorna
{void}
setDeviceOrientation(deviceOrientation)
Define current device orientation. Can be called at any time and takes effect immediately.
setDeviceOrientation(deviceOrientation: DeviceOrientation): void;
Parâmetros
deviceOrientationAtual device orientation.
Retorna
{void}
setGeoLocationInput(inputMode, geoLocation)
Define 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.
Retorna
{void}
setPlaneDetectionErrorBehavior(behavior)
Define o behavior quando a plane detection do WeChat Mini Program esta anormal.
setPlaneDetectionErrorBehavior(behavior: () => void): void;
Parâmetros
behaviorPasse uma callback function.
Retorna
{void}
start(options)
Inicia Session.
start(options?: SessionStartOptions): Promise<void>;
Parâmetros
optionsoptions startup options, optional.
Retorna
{Promise
}
stop()
Para Session. At this time, all BlockController instances and Trackers used by the Session will be destroyed.
stop(): void;
Retorna
{void}