Преглед на файлове

Fix for Firefox WebVR (again)

Brian Peiris преди 10 години
родител
ревизия
c9fd6070ed
променени са 1 файла, в които са добавени 3 реда и са изтрити 7 реда
  1. 3 7
      examples/js/controls/VRControls.js

+ 3 - 7
examples/js/controls/VRControls.js

@@ -11,15 +11,11 @@ THREE.VRControls = function ( object, onError ) {
 
 	function filterInvalidDevices( devices ) {
 
-		var
-			OculusDeviceName = 'VR Position Device (oculus)',
-			CardboardDeviceName = 'VR Position Device (cardboard)';
-
-
 		// Exclude Cardboard position sensor if Oculus exists.
+
 		var oculusDevices = devices.filter( function ( device ) {
 
-			return device.deviceName === OculusDeviceName;
+			return device.deviceName.toLowerCase().indexOf('oculus') !== -1;
 
 		} );
 
@@ -27,7 +23,7 @@ THREE.VRControls = function ( object, onError ) {
 
 			return devices.filter( function ( device ) {
 
-				return device.deviceName !== CardboardDeviceName;
+				return device.deviceName.toLowerCase().indexOf('cardboard') === -1;
 
 			} );