This commit is contained in:
Leon van Kammen 2023-07-04 15:23:10 +02:00
parent ee5ce9e32a
commit e5438e9fee
1 changed files with 13 additions and 4 deletions

View File

@ -3,11 +3,12 @@
xrf.frag.src = function(v, opts){
opts.embedded = v // indicate embedded XR fragment
let { mesh, model, camera, scene, renderer, THREE} = opts
let src = new THREE.Group()
if( v.string[0] == "#" ){ // local
console.log(" └ instancing src")
let frag = xrfragment.URI.parse(v.string)
console.log(" └ instancing src")
let src = new THREE.Group()
let frag = xrfragment.URI.parse(v.string)
const localSRC = () => {
// apply embedded XR fragments
setTimeout( () => {
@ -38,4 +39,12 @@ xrf.frag.src = function(v, opts){
if( !opts.recursive ) mesh.material.visible = false // lets hide the preview object because deleting disables animations+nested objs
},10)
}
const externalSRC = () => {
console.dir(frag)
}
if( v.string[0] == "#" ) localSRC() // local
else externalSRC()
}