浏览代码

WebVR: Updated to 1.0.

Mr.doob 8 年之前
父节点
当前提交
63653152c7
共有 1 个文件被更改,包括 9 次插入12 次删除
  1. 9 12
      examples/js/vr/WebVR.js

+ 9 - 12
examples/js/vr/WebVR.js

@@ -7,13 +7,20 @@ var WEBVR = {
 
 	isLatestAvailable: function () {
 
-		return navigator.getVRDisplays !== undefined;
+		console.warn( 'WEBVR: isLatestAvailable() is being deprecated. Use .isAvailable() instead.' );
+		return this.isAvailable();
 
 	},
 
 	isAvailable: function () {
 
-		return navigator.getVRDisplays !== undefined || navigator.getVRDevices !== undefined;
+		return navigator.getVRDisplays !== undefined;
+
+	},
+
+	getDisplays: function () {
+
+		return navigator.getVRDisplays();
 
 	},
 
@@ -29,10 +36,6 @@ var WEBVR = {
 
 			} );
 
-		} else if ( navigator.getVRDevices ) {
-
-			message = 'Your browser supports WebVR but not the latest version. See <a href="http://webvr.info">webvr.info</a> for more info.';
-
 		} else {
 
 			message = 'Your browser does not support WebVR. See <a href="http://webvr.info">webvr.info</a> for assistance.';
@@ -100,12 +103,6 @@ var WEBVR = {
 
 		return button;
 
-	},
-
-	getDisplays: function() {
-
-		return navigator.getVRDisplays();
-
 	}
 
 };