소스 검색

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;
 
 	};