Image AFrameAdapter
Import
js
import { AFrameAdapter } from 'monolook/image/aframe'Constructor
js
const adapter = new AFrameAdapter({
sceneEl,
showVideo: true,
container: document.body
})| Opción | Tipo | Requerido | Default |
|---|---|---|---|
sceneEl | HTMLElement | Sí | - |
showVideo | boolean | No | true |
container | HTMLElement | No | document.body |
Métodos
| Método | Devuelve | Descripción |
|---|---|---|
attach(tracker) | void | Conecta con MonolookImage |
detach() | void | Desconecta listeners |
addARContent(targetId, el, options?) | void | Asocia entidad A-Frame a target |
removeARContent(targetId) | void | Elimina contenido AR |
setupVideoBackground() | void | Crea fondo de vídeo |
setup() | void | Configura fondo y cámara tras tracker.start() |
destroy() | void | Limpieza |
Notas
| Punto | Valor |
|---|---|
| A-Frame | Cargar por CDN antes de tu script |
| THREE | Usa window.AFRAME.THREE |
| Cámara | Usar <a-entity camera> y desactivar look-controls / wasd-controls |