work in progress [might break]

This commit is contained in:
Leon van Kammen 2023-11-30 17:51:01 +01:00
parent 796790990d
commit 07ab3d5715
2 changed files with 4 additions and 3 deletions

View file

@ -38,10 +38,10 @@ window.AFRAME.registerComponent('xrf', {
mesh.material.visible = false mesh.material.visible = false
let el = document.createElement("a-entity") let el = document.createElement("a-entity")
el.setAttribute("xrf-get", mesh.name ) el.setAttribute("xrf-get", mesh.name )
el.setAttribute("class","floor ray") el.setAttribute("class","floor")
$('a-scene').appendChild(el) $('a-scene').appendChild(el)
}) })
blinkControls = blinkControls.components['blink-controls'].update({collisionEntities:true}) blinkControls.components['blink-controls'].update({collisionEntities:true})
} }
}) })

View file

@ -14,9 +14,10 @@ window.AFRAME.registerComponent('xrf-get', {
setTimeout( () => { setTimeout( () => {
if( !this.mesh && this.el.className.match(/ray/) ){ if( !this.mesh ){
let scene = AFRAME.XRF.scene let scene = AFRAME.XRF.scene
let mesh = this.mesh = scene.getObjectByName(meshname); let mesh = this.mesh = scene.getObjectByName(meshname);
if( !this.el.className.match(/ray/) ) this.el.className += " ray"
if (!mesh){ if (!mesh){
console.error("mesh with name '"+meshname+"' not found in model") console.error("mesh with name '"+meshname+"' not found in model")
return; return;