xrfragment/src/3rd/js/three/xrf/dynamic/camera.js

15 lines
362 B
JavaScript
Raw Normal View History

2024-02-08 19:40:43 +01:00
// switch camera when multiple cameras for url #mycameraname
xrf.addEventListener('dynamicKey', (opts) => {
// select active camera if any
let {id,match,v} = opts
match.map( (w) => {
w.nodes.map( (node) => {
if( node.isCamera ){
console.log("switching camera to cam: "+node.name)
xrf.model.camera = node
}
})
})
})