Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding example VR controls to webXr in viewer #155

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

craigliesinger
Copy link
Contributor

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').

@agviegas
Copy link
Collaborator

Hey @craigliesinger if you solve the merge conflicts, I'll merge! Thanks a lot for the contribution

@craigliesinger
Copy link
Contributor Author

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 = () => {}; `

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants