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

.getOrientation()? #21

Open
iraladson opened this issue Jan 17, 2014 · 0 comments
Open

.getOrientation()? #21

iraladson opened this issue Jan 17, 2014 · 0 comments

Comments

@iraladson
Copy link

Hey,

I'm trying to track down the point where the Oculus rotation values are taken from the USB and brought into the vr.state.hmd.rotation variable. So far I've been able to track it to line 489, but I have a few questions.

  1. what is global['vr_driver']? Right now, I'm assuming 'global' is the window object and ['vr_driver'] is some property on it, but I'm not to sure. When is 'global' defined? Is it the window object or am I completely off on that?

  2. The .getOrientation() method that takes 'state.hmd.rotation' as a parameter...I have no idea what it means. Is it a primitive function? I can't find any reference to it in vr.js. Is it defined elsewhere?

Thanks for anything you can tell me. Just trying learn. The code I reference is below. Awesome library btw.

vr.DriverDataSource.prototype.poll = function(state) { //line 485
var present = this.driver_.isPresent();
state.hmd.present = present;
if (present) {
this.driver_.getOrientation(state.hmd.rotation); //<<---THIS LINE line 489
} else {
state.hmd.rotation[0] = state.hmd.rotation[1] = state.hmd.rotation[2] = 0;
state.hmd.rotation[3] = 0;
}

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

No branches or pull requests

1 participant