浏览代码

VRControls/VREffect: Fixed more breakage.

Mr.doob 8 年之前
父节点
当前提交
cf9998b7e4
共有 2 个文件被更改,包括 26 次插入8 次删除
  1. 14 4
      examples/js/controls/VRControls.js
  2. 12 4
      examples/js/effects/VREffect.js

+ 14 - 4
examples/js/controls/VRControls.js

@@ -12,8 +12,11 @@ THREE.VRControls = function ( object, onError ) {
 	var standingMatrix = new THREE.Matrix4();
 
 	var frameData = null;
+
 	if ( 'VRFrameData' in window ) {
+
 		frameData = new VRFrameData();
+
 	}
 
 	function gotVRDisplays( displays ) {
@@ -52,15 +55,22 @@ THREE.VRControls = function ( object, onError ) {
 	// standing=true but the VRDisplay doesn't provide stageParameters.
 	this.userHeight = 1.6;
 
-	this.setDisplay = function ( display ) {
+	this.getVRDisplay = function () {
 
-		vrDisplay = display;
+		return vrDisplay;
 
 	};
 
-	this.getDisplay = function () {
+	this.setVRDisplay = function ( value ) {
 
-		return vrDisplay;
+		vrDisplay = value;
+
+	};
+
+	this.getVRDisplays = function () {
+
+		console.warn( 'THREE.VRControls: getVRDisplays() is being deprecated.' );
+		return vrDisplays;
 
 	};
 

+ 12 - 4
examples/js/effects/VREffect.js

@@ -17,6 +17,7 @@ THREE.VREffect = function ( renderer, onError ) {
 	var renderRectL, renderRectR;
 
 	var frameData = null;
+
 	if ( 'VRFrameData' in window ) {
 
 		frameData = new VRFrameData();
@@ -56,15 +57,22 @@ THREE.VREffect = function ( renderer, onError ) {
 	var rendererUpdateStyle = false;
 	var rendererPixelRatio = renderer.getPixelRatio();
 
-	this.setDisplay = function ( display ) {
+	this.getVRDisplay = function () {
 
-		vrDisplay = display;
+		return vrDisplay;
 
 	};
 
-	this.getDisplay = function () {
+	this.setVRDisplay = function ( value ) {
 
-		return vrDisplay;
+		vrDisplay = value;
+
+	};
+
+	this.getVRDisplays = function () {
+
+		console.warn( 'THREE.VREffect: getVRDisplays() is being deprecated.' );
+		return vrDisplays;
 
 	};