Last active
December 20, 2015 23:13
-
-
Save DigiTec/0587a2ce5ff86ce29726 to your computer and use it in GitHub Desktop.
Breakouts of the WebVR specification for embedding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gHMD, gPositionSensor; | |
navigator.getVRDevices().then(function(devices) { | |
for (var i = 0; i < devices.length; ++i) { | |
if (devices[i] instanceof HMDVRDevice) { | |
gHMD = devices[i]; | |
break; | |
} | |
} | |
if (gHMD) { | |
for (var i = 0; i < devices.length; ++i) { | |
if (devices[i] instanceof PositionSensorVRDevice && devices[i].hardwareUnitId === gHMD.hardwareUnitId) { | |
gPositionSensor = devices[i]; | |
break; | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment