xrfragment-haxe/src/3rd/js/three/xrf/#.js

14 lines
444 B
JavaScript
Raw Normal View History

2023-10-27 16:55:48 +02:00
xrf.frag.defaultPredefinedViews = (opts) => {
let {scene,model} = opts;
2023-10-27 16:55:48 +02:00
scene.traverse( (n) => {
if( n.userData && n.userData['#'] ){
let frag = xrf.URI.parse( n.userData['#'] )
2024-01-30 09:58:00 +00:00
if( !n.parent && document.location.hash.length < 2){
xrf.navigator.to( n.userData['#'] ) // evaluate static XR fragments
}else{
xrf.hashbus.pub( n.userData['#'] ) // evaluate static XR fragments
}
}
2023-10-27 16:55:48 +02:00
})
}