web-ifc-viewer
web-ifc-viewer copied to clipboard
Adding example VR controls to webXr in viewer
per request from Marcos - I've added a couple base VR controller functionalities to the ifc-viewer library. This includes movement / fly around using right controller 'squeeze' and element highlighting use left controller 'select' (and clear with 'squeeze').
Hey @craigliesinger if you solve the merge conflicts, I'll merge! Thanks a lot for the contribution
Thanks @agviegas ; I'm a github novice so having way to hard of a time figuring out how to resolve it without the write access to do it directly in Github. I'll try to figure it out soon. The code for context in PR is right and not sure why it gets hung up with a conflict: `private render = () => { if (this.isThisBeingDisposed) return; if (this.stats) this.stats.begin(); const isWebXR = this.options.webXR || false; if (isWebXR) { document.body.appendChild(VRButton.createButton(this.getRenderer())); this.getRenderer().xr.enabled = true; this.renderForWebXR(); } else { requestAnimationFrame(this.render); } this.updateAllComponents(); if (this.stats) this.stats.end(); };
private renderForWebXR = () => { const newAnimationLoop = () => { this.webXrMoveTracking(); this.getRenderer().render(this.getScene(), this.getCamera()); }; this.getRenderer().setAnimationLoop(newAnimationLoop); };
webXrMoveTracking = () => {}; `