提交 329082c7 编写于 作者: B Brian Peiris

Use the first VR position sensor we see.

This fixes things for Firefox since the latest builds include both an
Oculus device and a Cardboard device, even if you're on a desktop PC.
上级 03b8391b
......@@ -19,13 +19,15 @@ THREE.VRControls = function ( object, onError ) {
vrInputs.push( devices[ i ] );
break; // We keep the first we encounter
}
}
if ( onError ) onError( 'HMD not available' );
};
}
if ( navigator.getVRDevices ) {
......@@ -41,7 +43,7 @@ THREE.VRControls = function ( object, onError ) {
this.update = function () {
for ( var i = 0; i < vrInputs.length; i++ ) {
for ( var i = 0; i < vrInputs.length; i ++ ) {
var vrInput = vrInputs[ i ];
......@@ -65,7 +67,7 @@ THREE.VRControls = function ( object, onError ) {
this.resetSensor = function () {
for ( var i = 0; i < vrInputs.length; i++ ) {
for ( var i = 0; i < vrInputs.length; i ++ ) {
var vrInput = vrInputs[ i ];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册