소스 검색

renaming stereogram to Stereoscopic
Integrating Raanan update on beta computation for ArcRotateCamera

David Catuhe 10 년 전
부모
커밋
72a52fd4ec

+ 35 - 16
Babylon/Cameras/babylon.arcRotateCamera.js

@@ -323,7 +323,7 @@ var BABYLON;
             }
             }
             // Inertia
             // Inertia
             if (this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset != 0) {
             if (this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset != 0) {
-                this.alpha += this.inertialAlphaOffset;
+                this.alpha += this.beta <= 0 ? -this.inertialAlphaOffset : this.inertialAlphaOffset;
                 this.beta += this.inertialBetaOffset;
                 this.beta += this.inertialBetaOffset;
                 this.radius -= this.inertialRadiusOffset;
                 this.radius -= this.inertialRadiusOffset;
                 this.inertialAlphaOffset *= this.inertia;
                 this.inertialAlphaOffset *= this.inertia;
@@ -337,18 +337,32 @@ var BABYLON;
                     this.inertialRadiusOffset = 0;
                     this.inertialRadiusOffset = 0;
             }
             }
             // Limits
             // Limits
+            if (this.lowerBetaLimit === null || this.lowerBetaLimit === undefined) {
+                if (this.beta > Math.PI) {
+                    this.beta = this.beta - (2 * Math.PI);
+                }
+            }
+            else {
+                if (this.beta < this.lowerBetaLimit) {
+                    this.beta = this.lowerBetaLimit;
+                }
+            }
+            if (this.upperBetaLimit === null || this.upperBetaLimit === undefined) {
+                if (this.beta < -Math.PI) {
+                    this.beta = this.beta + (2 * Math.PI);
+                }
+            }
+            else {
+                if (this.beta > this.upperBetaLimit) {
+                    this.beta = this.upperBetaLimit;
+                }
+            }
             if (this.lowerAlphaLimit && this.alpha < this.lowerAlphaLimit) {
             if (this.lowerAlphaLimit && this.alpha < this.lowerAlphaLimit) {
                 this.alpha = this.lowerAlphaLimit;
                 this.alpha = this.lowerAlphaLimit;
             }
             }
             if (this.upperAlphaLimit && this.alpha > this.upperAlphaLimit) {
             if (this.upperAlphaLimit && this.alpha > this.upperAlphaLimit) {
                 this.alpha = this.upperAlphaLimit;
                 this.alpha = this.upperAlphaLimit;
             }
             }
-            if (this.lowerBetaLimit && this.beta < this.lowerBetaLimit) {
-                this.beta = this.lowerBetaLimit;
-            }
-            if (this.upperBetaLimit && this.beta > this.upperBetaLimit) {
-                this.beta = this.upperBetaLimit;
-            }
             if (this.lowerRadiusLimit && this.radius < this.lowerRadiusLimit) {
             if (this.lowerRadiusLimit && this.radius < this.lowerRadiusLimit) {
                 this.radius = this.lowerRadiusLimit;
                 this.radius = this.lowerRadiusLimit;
             }
             }
@@ -375,19 +389,24 @@ var BABYLON;
             var cosb = Math.cos(this.beta);
             var cosb = Math.cos(this.beta);
             var sinb = Math.sin(this.beta);
             var sinb = Math.sin(this.beta);
             var target = this._getTargetPosition();
             var target = this._getTargetPosition();
-            target.addToRef(new BABYLON.Vector3(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb), this._newPosition);
-            if (this.getScene().collisionsEnabled && this.checkCollisions) {
+            target.addToRef(new BABYLON.Vector3(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb), this.position);
+            if (this.checkCollisions) {
                 this._collider.radius = this.collisionRadius;
                 this._collider.radius = this.collisionRadius;
-                this._newPosition.subtractToRef(this.position, this._collisionVelocity);
+                this.position.subtractToRef(this._previousPosition, this._collisionVelocity);
                 this._collisionTriggered = true;
                 this._collisionTriggered = true;
-                this.getScene().collisionCoordinator.getNewPosition(this.position, this._collisionVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);
+                this.getScene().collisionCoordinator.getNewPosition(this._previousPosition, this._collisionVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);
             }
             }
-            else {
-                this.position.copyFrom(this._newPosition);
-                BABYLON.Matrix.LookAtLHToRef(this.position, target, this.upVector, this._viewMatrix);
-                this._viewMatrix.m[12] += this.targetScreenOffset.x;
-                this._viewMatrix.m[13] += this.targetScreenOffset.y;
+            var up = this.upVector.clone();
+            if (this.beta < 0) {
+                up = up.negate();
             }
             }
+            BABYLON.Matrix.LookAtLHToRef(this.position, target, up, this._viewMatrix);
+            this._previousAlpha = this.alpha;
+            this._previousBeta = this.beta;
+            this._previousRadius = this.radius;
+            this._previousPosition.copyFrom(this.position);
+            this._viewMatrix.m[12] += this.targetScreenOffset.x;
+            this._viewMatrix.m[13] += this.targetScreenOffset.y;
             return this._viewMatrix;
             return this._viewMatrix;
         };
         };
         ArcRotateCamera.prototype.zoomOn = function (meshes) {
         ArcRotateCamera.prototype.zoomOn = function (meshes) {

+ 60 - 48
Babylon/Cameras/babylon.arcRotateCamera.ts

@@ -340,16 +340,13 @@
         }
         }
 
 
         public _checkInputs(): void {
         public _checkInputs(): void {
-
             //if (async) collision inspection was triggered, don't update the camera's position - until the collision callback was called.
             //if (async) collision inspection was triggered, don't update the camera's position - until the collision callback was called.
             if (this._collisionTriggered) {
             if (this._collisionTriggered) {
                 return;
                 return;
             }
             }
-
             // Keyboard
             // Keyboard
             for (var index = 0; index < this._keys.length; index++) {
             for (var index = 0; index < this._keys.length; index++) {
                 var keyCode = this._keys[index];
                 var keyCode = this._keys[index];
-
                 if (this.keysLeft.indexOf(keyCode) !== -1) {
                 if (this.keysLeft.indexOf(keyCode) !== -1) {
                     this.inertialAlphaOffset -= 0.01;
                     this.inertialAlphaOffset -= 0.01;
                 } else if (this.keysUp.indexOf(keyCode) !== -1) {
                 } else if (this.keysUp.indexOf(keyCode) !== -1) {
@@ -359,42 +356,53 @@
                 } else if (this.keysDown.indexOf(keyCode) !== -1) {
                 } else if (this.keysDown.indexOf(keyCode) !== -1) {
                     this.inertialBetaOffset += 0.01;
                     this.inertialBetaOffset += 0.01;
                 }
                 }
-            }
-
+            }			
+			
             // Inertia
             // Inertia
             if (this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset != 0) {
             if (this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset != 0) {
-
-                this.alpha += this.inertialAlphaOffset;
+                this.alpha += this.beta <= 0 ? -this.inertialAlphaOffset : this.inertialAlphaOffset;
                 this.beta += this.inertialBetaOffset;
                 this.beta += this.inertialBetaOffset;
                 this.radius -= this.inertialRadiusOffset;
                 this.radius -= this.inertialRadiusOffset;
-
                 this.inertialAlphaOffset *= this.inertia;
                 this.inertialAlphaOffset *= this.inertia;
                 this.inertialBetaOffset *= this.inertia;
                 this.inertialBetaOffset *= this.inertia;
                 this.inertialRadiusOffset *= this.inertia;
                 this.inertialRadiusOffset *= this.inertia;
-
                 if (Math.abs(this.inertialAlphaOffset) < Engine.Epsilon)
                 if (Math.abs(this.inertialAlphaOffset) < Engine.Epsilon)
                     this.inertialAlphaOffset = 0;
                     this.inertialAlphaOffset = 0;
-
                 if (Math.abs(this.inertialBetaOffset) < Engine.Epsilon)
                 if (Math.abs(this.inertialBetaOffset) < Engine.Epsilon)
                     this.inertialBetaOffset = 0;
                     this.inertialBetaOffset = 0;
-
                 if (Math.abs(this.inertialRadiusOffset) < Engine.Epsilon)
                 if (Math.abs(this.inertialRadiusOffset) < Engine.Epsilon)
                     this.inertialRadiusOffset = 0;
                     this.inertialRadiusOffset = 0;
             }
             }
 
 
             // Limits
             // Limits
+            if (this.lowerBetaLimit === null || this.lowerBetaLimit === undefined) {
+                if (this.beta > Math.PI) {
+                    this.beta = this.beta - (2 * Math.PI);
+                }
+            } else {
+                if (this.beta < this.lowerBetaLimit) {
+                    this.beta = this.lowerBetaLimit;
+                }
+            }
+
+            if (this.upperBetaLimit === null || this.upperBetaLimit === undefined) {
+                if (this.beta < -Math.PI) {
+                    this.beta = this.beta + (2 * Math.PI);
+                }
+            } else {
+                if (this.beta > this.upperBetaLimit) {
+                    this.beta = this.upperBetaLimit;
+                }
+            }
+
             if (this.lowerAlphaLimit && this.alpha < this.lowerAlphaLimit) {
             if (this.lowerAlphaLimit && this.alpha < this.lowerAlphaLimit) {
                 this.alpha = this.lowerAlphaLimit;
                 this.alpha = this.lowerAlphaLimit;
             }
             }
             if (this.upperAlphaLimit && this.alpha > this.upperAlphaLimit) {
             if (this.upperAlphaLimit && this.alpha > this.upperAlphaLimit) {
                 this.alpha = this.upperAlphaLimit;
                 this.alpha = this.upperAlphaLimit;
             }
             }
-            if (this.lowerBetaLimit && this.beta < this.lowerBetaLimit) {
-                this.beta = this.lowerBetaLimit;
-            }
-            if (this.upperBetaLimit && this.beta > this.upperBetaLimit) {
-                this.beta = this.upperBetaLimit;
-            }
+
+
             if (this.lowerRadiusLimit && this.radius < this.lowerRadiusLimit) {
             if (this.lowerRadiusLimit && this.radius < this.lowerRadiusLimit) {
                 this.radius = this.lowerRadiusLimit;
                 this.radius = this.lowerRadiusLimit;
             }
             }
@@ -428,22 +436,26 @@
             var sinb = Math.sin(this.beta);
             var sinb = Math.sin(this.beta);
 
 
             var target = this._getTargetPosition();
             var target = this._getTargetPosition();
-
-            target.addToRef(new Vector3(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb), this._newPosition);
-			
-			if (this.getScene().collisionsEnabled && this.checkCollisions) {
+            target.addToRef(new Vector3(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb), this.position);
+            if (this.checkCollisions) {
                 this._collider.radius = this.collisionRadius;
                 this._collider.radius = this.collisionRadius;
-                this._newPosition.subtractToRef(this.position, this._collisionVelocity);
-
+                this.position.subtractToRef(this._previousPosition, this._collisionVelocity);
                 this._collisionTriggered = true;
                 this._collisionTriggered = true;
-                this.getScene().collisionCoordinator.getNewPosition(this.position, this._collisionVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);
-            } else {
-				this.position.copyFrom(this._newPosition);
-				Matrix.LookAtLHToRef(this.position, target, this.upVector, this._viewMatrix);
-				this._viewMatrix.m[12] += this.targetScreenOffset.x;
-				this._viewMatrix.m[13] += this.targetScreenOffset.y;
-			}
+                this.getScene().collisionCoordinator.getNewPosition(this._previousPosition, this._collisionVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);
+            }
+
+            var up = this.upVector.clone();
+            if (this.beta < 0) {
+                up = up.negate();
+            }
 
 
+            Matrix.LookAtLHToRef(this.position, target, up, this._viewMatrix);
+            this._previousAlpha = this.alpha;
+            this._previousBeta = this.beta;
+            this._previousRadius = this.radius;
+            this._previousPosition.copyFrom(this.position);
+            this._viewMatrix.m[12] += this.targetScreenOffset.x;
+            this._viewMatrix.m[13] += this.targetScreenOffset.y;
             return this._viewMatrix;
             return this._viewMatrix;
         }
         }
 
 
@@ -451,24 +463,24 @@
 
 
             if (this.getScene().workerCollisions && this.checkCollisions) {
             if (this.getScene().workerCollisions && this.checkCollisions) {
                 newPosition.multiplyInPlace(this._collider.radius);
                 newPosition.multiplyInPlace(this._collider.radius);
-			}
-			
-			if(!collidedMesh) {
-				this._previousPosition.copyFrom(this.position);
-				this.setPosition(this._newPosition);
-				this.position.copyFrom(this._newPosition);
-			} else {
-				this.setPosition(this._previousPosition);
-				this.position.copyFrom(this._previousPosition);
-			
-				if (this.onCollide) {
-				   this.onCollide(collidedMesh);
-				} 
-			}
-			
-			Matrix.LookAtLHToRef(this.position, this._getTargetPosition(), this.upVector, this._viewMatrix);
-			this._viewMatrix.m[12] += this.targetScreenOffset.x;
-			this._viewMatrix.m[13] += this.targetScreenOffset.y;
+            }
+
+            if (!collidedMesh) {
+                this._previousPosition.copyFrom(this.position);
+                this.setPosition(this._newPosition);
+                this.position.copyFrom(this._newPosition);
+            } else {
+                this.setPosition(this._previousPosition);
+                this.position.copyFrom(this._previousPosition);
+
+                if (this.onCollide) {
+                    this.onCollide(collidedMesh);
+                }
+            }
+
+            Matrix.LookAtLHToRef(this.position, this._getTargetPosition(), this.upVector, this._viewMatrix);
+            this._viewMatrix.m[12] += this.targetScreenOffset.x;
+            this._viewMatrix.m[13] += this.targetScreenOffset.y;
 
 
             this._collisionTriggered = false;
             this._collisionTriggered = false;
         }
         }

+ 10 - 10
Babylon/Cameras/babylon.camera.js

@@ -152,16 +152,16 @@ var BABYLON;
             enumerable: true,
             enumerable: true,
             configurable: true
             configurable: true
         });
         });
-        Object.defineProperty(Camera, "SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM", {
+        Object.defineProperty(Camera, "SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC", {
             get: function () {
             get: function () {
-                return Camera._SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM;
+                return Camera._SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC;
             },
             },
             enumerable: true,
             enumerable: true,
             configurable: true
             configurable: true
         });
         });
-        Object.defineProperty(Camera, "SUB_CAMERA_MODE_VERTICAL_STEREOGRAM", {
+        Object.defineProperty(Camera, "SUB_CAMERA_MODE_VERTICAL_STEREOSCOPIC", {
             get: function () {
             get: function () {
-                return Camera._SUB_CAMERA_MODE_VERTICAL_STEREOGRAM;
+                return Camera._SUB_CAMERA_MODE_VERTICAL_STEREOSCOPIC;
             },
             },
             enumerable: true,
             enumerable: true,
             configurable: true
             configurable: true
@@ -441,12 +441,12 @@ var BABYLON;
                         effect.setTextureFromPostProcess("leftSampler", postProcessA);
                         effect.setTextureFromPostProcess("leftSampler", postProcessA);
                     };
                     };
                     break;
                     break;
-                case Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM:
-                case Camera.SUB_CAMERA_MODE_VERTICAL_STEREOGRAM:
-                    var isStereogramHoriz = this._subCameraMode === Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM;
+                case Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC:
+                case Camera.SUB_CAMERA_MODE_VERTICAL_STEREOSCOPIC:
+                    var isStereoscopicHoriz = this._subCameraMode === Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC;
                     postProcessA = new BABYLON.PassPostProcess("passthru", 1.0, camA);
                     postProcessA = new BABYLON.PassPostProcess("passthru", 1.0, camA);
                     camA.isIntermediate = true;
                     camA.isIntermediate = true;
-                    postProcessB = new BABYLON.StereogramInterlacePostProcess("st_interlace", camB, postProcessA, isStereogramHoriz);
+                    postProcessB = new BABYLON.StereoscopicInterlacePostProcess("st_interlace", camB, postProcessA, isStereoscopicHoriz);
                     break;
                     break;
                 case Camera.SUB_CAMERA_MODE_VR:
                 case Camera.SUB_CAMERA_MODE_VR:
                     metrics = metrics || VRCameraMetrics.GetDefault();
                     metrics = metrics || VRCameraMetrics.GetDefault();
@@ -510,8 +510,8 @@ var BABYLON;
         Camera._FOVMODE_HORIZONTAL_FIXED = 1;
         Camera._FOVMODE_HORIZONTAL_FIXED = 1;
         Camera._SUB_CAMERA_MODE_NONE = 0;
         Camera._SUB_CAMERA_MODE_NONE = 0;
         Camera._SUB_CAMERA_MODE_ANAGLYPH = 1;
         Camera._SUB_CAMERA_MODE_ANAGLYPH = 1;
-        Camera._SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM = 2;
-        Camera._SUB_CAMERA_MODE_VERTICAL_STEREOGRAM = 3;
+        Camera._SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC = 2;
+        Camera._SUB_CAMERA_MODE_VERTICAL_STEREOSCOPIC = 3;
         Camera._SUB_CAMERA_MODE_VR = 4;
         Camera._SUB_CAMERA_MODE_VR = 4;
         Camera._SUB_CAMERAID_A = 0;
         Camera._SUB_CAMERAID_A = 0;
         Camera._SUB_CAMERAID_B = 1;
         Camera._SUB_CAMERAID_B = 1;

+ 10 - 10
Babylon/Cameras/babylon.camera.ts

@@ -75,8 +75,8 @@
 
 
         private static _SUB_CAMERA_MODE_NONE = 0;
         private static _SUB_CAMERA_MODE_NONE = 0;
         private static _SUB_CAMERA_MODE_ANAGLYPH = 1;
         private static _SUB_CAMERA_MODE_ANAGLYPH = 1;
-        private static _SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM = 2;
-        private static _SUB_CAMERA_MODE_VERTICAL_STEREOGRAM = 3;
+        private static _SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC = 2;
+        private static _SUB_CAMERA_MODE_VERTICAL_STEREOSCOPIC = 3;
         private static _SUB_CAMERA_MODE_VR = 4;
         private static _SUB_CAMERA_MODE_VR = 4;
 
 
         private static _SUB_CAMERAID_A = 0;
         private static _SUB_CAMERAID_A = 0;
@@ -106,12 +106,12 @@
             return Camera._SUB_CAMERA_MODE_ANAGLYPH;
             return Camera._SUB_CAMERA_MODE_ANAGLYPH;
         }
         }
 
 
-        public static get SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM(): number {
-            return Camera._SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM;
+        public static get SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC(): number {
+            return Camera._SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC;
         }
         }
 
 
-        public static get SUB_CAMERA_MODE_VERTICAL_STEREOGRAM(): number {
-            return Camera._SUB_CAMERA_MODE_VERTICAL_STEREOGRAM;
+        public static get SUB_CAMERA_MODE_VERTICAL_STEREOSCOPIC(): number {
+            return Camera._SUB_CAMERA_MODE_VERTICAL_STEREOSCOPIC;
         }
         }
 
 
         public static get SUB_CAMERA_MODE_VR(): number {
         public static get SUB_CAMERA_MODE_VR(): number {
@@ -501,13 +501,13 @@
                     };
                     };
                     break;
                     break;
 
 
-                case Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM:
-                case Camera.SUB_CAMERA_MODE_VERTICAL_STEREOGRAM:
-                    var isStereogramHoriz = this._subCameraMode === Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM;
+                case Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC:
+                case Camera.SUB_CAMERA_MODE_VERTICAL_STEREOSCOPIC:
+                    var isStereoscopicHoriz = this._subCameraMode === Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC;
                     postProcessA = new PassPostProcess("passthru", 1.0, camA);
                     postProcessA = new PassPostProcess("passthru", 1.0, camA);
                     camA.isIntermediate = true;
                     camA.isIntermediate = true;
 
 
-                    postProcessB = new StereogramInterlacePostProcess("st_interlace", camB, postProcessA, isStereogramHoriz);
+                    postProcessB = new StereoscopicInterlacePostProcess("st_interlace", camB, postProcessA, isStereoscopicHoriz);
                     break;
                     break;
 
 
                 case Camera.SUB_CAMERA_MODE_VR:
                 case Camera.SUB_CAMERA_MODE_VR:

+ 0 - 37
Babylon/Cameras/babylon.stereogramCamera.js

@@ -1,37 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    __.prototype = b.prototype;
-    d.prototype = new __();
-};
-var BABYLON;
-(function (BABYLON) {
-    var StereogramFreeCamera = (function (_super) {
-        __extends(StereogramFreeCamera, _super);
-        function StereogramFreeCamera(name, position, eyeSpace, isVertical, scene) {
-            _super.call(this, name, position, scene);
-            this.setSubCameraMode(isVertical ? BABYLON.Camera.SUB_CAMERA_MODE_VERTICAL_STEREOGRAM : BABYLON.Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM, eyeSpace);
-        }
-        return StereogramFreeCamera;
-    })(BABYLON.FreeCamera);
-    BABYLON.StereogramFreeCamera = StereogramFreeCamera;
-    var StereogramArcRotateCamera = (function (_super) {
-        __extends(StereogramArcRotateCamera, _super);
-        function StereogramArcRotateCamera(name, alpha, beta, radius, target, eyeSpace, isVertical, scene) {
-            _super.call(this, name, alpha, beta, radius, target, scene);
-            this.setSubCameraMode(isVertical ? BABYLON.Camera.SUB_CAMERA_MODE_VERTICAL_STEREOGRAM : BABYLON.Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM, eyeSpace);
-        }
-        return StereogramArcRotateCamera;
-    })(BABYLON.ArcRotateCamera);
-    BABYLON.StereogramArcRotateCamera = StereogramArcRotateCamera;
-    var StereogramGamepadCamera = (function (_super) {
-        __extends(StereogramGamepadCamera, _super);
-        function StereogramGamepadCamera(name, position, eyeSpace, isVertical, scene) {
-            _super.call(this, name, position, scene);
-            this.setSubCameraMode(isVertical ? BABYLON.Camera.SUB_CAMERA_MODE_VERTICAL_STEREOGRAM : BABYLON.Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM, eyeSpace);
-        }
-        return StereogramGamepadCamera;
-    })(BABYLON.GamepadCamera);
-    BABYLON.StereogramGamepadCamera = StereogramGamepadCamera;
-})(BABYLON || (BABYLON = {}));
-//# sourceMappingURL=babylon.stereogramCamera.js.map

+ 37 - 0
Babylon/Cameras/babylon.stereoscopicCamera.js

@@ -0,0 +1,37 @@
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    __.prototype = b.prototype;
+    d.prototype = new __();
+};
+var BABYLON;
+(function (BABYLON) {
+    var StereoscopicFreeCamera = (function (_super) {
+        __extends(StereoscopicFreeCamera, _super);
+        function StereoscopicFreeCamera(name, position, eyeSpace, isVertical, scene) {
+            _super.call(this, name, position, scene);
+            this.setSubCameraMode(isVertical ? BABYLON.Camera.SUB_CAMERA_MODE_VERTICAL_STEREOSCOPIC : BABYLON.Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC, eyeSpace);
+        }
+        return StereoscopicFreeCamera;
+    })(BABYLON.FreeCamera);
+    BABYLON.StereoscopicFreeCamera = StereoscopicFreeCamera;
+    var StereoscopicArcRotateCamera = (function (_super) {
+        __extends(StereoscopicArcRotateCamera, _super);
+        function StereoscopicArcRotateCamera(name, alpha, beta, radius, target, eyeSpace, isVertical, scene) {
+            _super.call(this, name, alpha, beta, radius, target, scene);
+            this.setSubCameraMode(isVertical ? BABYLON.Camera.SUB_CAMERA_MODE_VERTICAL_STEREOSCOPIC : BABYLON.Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC, eyeSpace);
+        }
+        return StereoscopicArcRotateCamera;
+    })(BABYLON.ArcRotateCamera);
+    BABYLON.StereoscopicArcRotateCamera = StereoscopicArcRotateCamera;
+    var StereoscopicGamepadCamera = (function (_super) {
+        __extends(StereoscopicGamepadCamera, _super);
+        function StereoscopicGamepadCamera(name, position, eyeSpace, isVertical, scene) {
+            _super.call(this, name, position, scene);
+            this.setSubCameraMode(isVertical ? BABYLON.Camera.SUB_CAMERA_MODE_VERTICAL_STEREOSCOPIC : BABYLON.Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC, eyeSpace);
+        }
+        return StereoscopicGamepadCamera;
+    })(BABYLON.GamepadCamera);
+    BABYLON.StereoscopicGamepadCamera = StereoscopicGamepadCamera;
+})(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.stereoscopicCamera.js.map

+ 6 - 6
Babylon/Cameras/babylon.stereogramCamera.ts

@@ -1,23 +1,23 @@
 module BABYLON {
 module BABYLON {
-    export class StereogramFreeCamera extends FreeCamera {
+    export class StereoscopicFreeCamera extends FreeCamera {
         constructor(name: string, position: Vector3, eyeSpace: number, isVertical: boolean, scene: Scene) {
         constructor(name: string, position: Vector3, eyeSpace: number, isVertical: boolean, scene: Scene) {
             super(name, position, scene);
             super(name, position, scene);
 
 
-            this.setSubCameraMode(isVertical ? Camera.SUB_CAMERA_MODE_VERTICAL_STEREOGRAM : Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM, eyeSpace);
+            this.setSubCameraMode(isVertical ? Camera.SUB_CAMERA_MODE_VERTICAL_STEREOSCOPIC : Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC, eyeSpace);
         }
         }
     }
     }
 
 
-    export class StereogramArcRotateCamera extends ArcRotateCamera {
+    export class StereoscopicArcRotateCamera extends ArcRotateCamera {
         constructor(name: string, alpha: number, beta: number, radius: number, target, eyeSpace: number, isVertical: boolean, scene:Scene) {
         constructor(name: string, alpha: number, beta: number, radius: number, target, eyeSpace: number, isVertical: boolean, scene:Scene) {
             super(name, alpha, beta, radius, target, scene);
             super(name, alpha, beta, radius, target, scene);
-            this.setSubCameraMode(isVertical ? Camera.SUB_CAMERA_MODE_VERTICAL_STEREOGRAM : Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM, eyeSpace);
+            this.setSubCameraMode(isVertical ? Camera.SUB_CAMERA_MODE_VERTICAL_STEREOSCOPIC : Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC, eyeSpace);
         }
         }
     }
     }
 
 
-    export class StereogramGamepadCamera extends GamepadCamera {
+    export class StereoscopicGamepadCamera extends GamepadCamera {
         constructor(name: string, position: Vector3, eyeSpace: number, isVertical: boolean, scene: Scene) {
         constructor(name: string, position: Vector3, eyeSpace: number, isVertical: boolean, scene: Scene) {
             super(name, position, scene);
             super(name, position, scene);
-            this.setSubCameraMode(isVertical ? Camera.SUB_CAMERA_MODE_VERTICAL_STEREOGRAM : Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOGRAM, eyeSpace);
+            this.setSubCameraMode(isVertical ? Camera.SUB_CAMERA_MODE_VERTICAL_STEREOSCOPIC : Camera.SUB_CAMERA_MODE_HORIZONTAL_STEREOSCOPIC, eyeSpace);
         }
         }
     }
     }
 } 
 } 

+ 7 - 7
Babylon/PostProcess/babylon.stereogramInterlacePostProcess.js

@@ -6,11 +6,11 @@ var __extends = (this && this.__extends) || function (d, b) {
 };
 };
 var BABYLON;
 var BABYLON;
 (function (BABYLON) {
 (function (BABYLON) {
-    var StereogramInterlacePostProcess = (function (_super) {
-        __extends(StereogramInterlacePostProcess, _super);
-        function StereogramInterlacePostProcess(name, camB, postProcessA, isStereogramHoriz, samplingMode) {
+    var StereoscopicInterlacePostProcess = (function (_super) {
+        __extends(StereoscopicInterlacePostProcess, _super);
+        function StereoscopicInterlacePostProcess(name, camB, postProcessA, isStereoscopicHoriz, samplingMode) {
             var _this = this;
             var _this = this;
-            _super.call(this, name, "stereogramInterlace", ['stepSize'], ['camASampler'], 1, camB, samplingMode, camB.getScene().getEngine(), false, isStereogramHoriz ? "#define IS_STEREOGRAM_HORIZ 1" : undefined);
+            _super.call(this, name, "stereoscopicInterlace", ['stepSize'], ['camASampler'], 1, camB, samplingMode, camB.getScene().getEngine(), false, isStereoscopicHoriz ? "#define IS_STEREOSCOPIC_HORIZ 1" : undefined);
             this._stepSize = new BABYLON.Vector2(1 / this.width, 1 / this.height);
             this._stepSize = new BABYLON.Vector2(1 / this.width, 1 / this.height);
             this.onSizeChanged = function () {
             this.onSizeChanged = function () {
                 _this._stepSize = new BABYLON.Vector2(1 / _this.width, 1 / _this.height);
                 _this._stepSize = new BABYLON.Vector2(1 / _this.width, 1 / _this.height);
@@ -20,8 +20,8 @@ var BABYLON;
                 effect.setFloat2("stepSize", _this._stepSize.x, _this._stepSize.y);
                 effect.setFloat2("stepSize", _this._stepSize.x, _this._stepSize.y);
             };
             };
         }
         }
-        return StereogramInterlacePostProcess;
+        return StereoscopicInterlacePostProcess;
     })(BABYLON.PostProcess);
     })(BABYLON.PostProcess);
-    BABYLON.StereogramInterlacePostProcess = StereogramInterlacePostProcess;
+    BABYLON.StereoscopicInterlacePostProcess = StereoscopicInterlacePostProcess;
 })(BABYLON || (BABYLON = {}));
 })(BABYLON || (BABYLON = {}));
-//# sourceMappingURL=babylon.stereogramInterlacePostProcess.js.map
+//# sourceMappingURL=babylon.stereoscopicInterlacePostProcess.js.map

+ 3 - 3
Babylon/PostProcess/babylon.stereogramInterlacePostProcess.ts

@@ -1,9 +1,9 @@
 module BABYLON {
 module BABYLON {
-    export class StereogramInterlacePostProcess extends PostProcess {
+    export class StereoscopicInterlacePostProcess extends PostProcess {
         private _stepSize : Vector2;
         private _stepSize : Vector2;
 
 
-        constructor(name: string, camB: Camera, postProcessA : PostProcess, isStereogramHoriz: boolean, samplingMode?: number) {
-            super(name, "stereogramInterlace", ['stepSize'], ['camASampler'], 1, camB, samplingMode, camB.getScene().getEngine(), false, isStereogramHoriz ? "#define IS_STEREOGRAM_HORIZ 1" : undefined);
+        constructor(name: string, camB: Camera, postProcessA : PostProcess, isStereoscopicHoriz: boolean, samplingMode?: number) {
+            super(name, "stereoscopicInterlace", ['stepSize'], ['camASampler'], 1, camB, samplingMode, camB.getScene().getEngine(), false, isStereoscopicHoriz ? "#define IS_STEREOSCOPIC_HORIZ 1" : undefined);
             
             
             this._stepSize = new Vector2(1 / this.width, 1 / this.height);
             this._stepSize = new Vector2(1 / this.width, 1 / this.height);
 
 

+ 1 - 1
Babylon/Shaders/stereogramInterlace.fragment.fx

@@ -18,7 +18,7 @@ void main(void)
     vec3 frag1;
     vec3 frag1;
     vec3 frag2;
     vec3 frag2;
     
     
-#ifdef IS_STEREOGRAM_HORIZ
+#ifdef IS_STEREOSCOPIC_HORIZ
 	    useCamB = vUV.x > 0.5;
 	    useCamB = vUV.x > 0.5;
 	    texCoord1 = vec2(useCamB ? (vUV.x - 0.5) * 2.0 : vUV.x * 2.0, vUV.y);
 	    texCoord1 = vec2(useCamB ? (vUV.x - 0.5) * 2.0 : vUV.x * 2.0, vUV.y);
 	    texCoord2 = vec2(texCoord1.x + stepSize.x, vUV.y);
 	    texCoord2 = vec2(texCoord1.x + stepSize.x, vUV.y);

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 74 - 55
babylon.2.1-rc.debug.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 23 - 26
babylon.2.1-rc.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 22 - 25
babylon.2.1-rc.noworker.js


+ 2 - 1
what's new - 2.1 - proposal.md

@@ -12,11 +12,12 @@
     - New Loaders folder with a first additionnal plugin: [STL](http://doc.babylonjs.com/page.php?p=25109)  ([raananw](http://www.github.com/raananw), [deltakosh](http://www.github.com/deltakosh))
     - New Loaders folder with a first additionnal plugin: [STL](http://doc.babylonjs.com/page.php?p=25109)  ([raananw](http://www.github.com/raananw), [deltakosh](http://www.github.com/deltakosh))
     - Gulp building process revamped, updated and simplified and now includes a config.json ([raananw](http://www.github.com/raananw)) 
     - Gulp building process revamped, updated and simplified and now includes a config.json ([raananw](http://www.github.com/raananw)) 
  - **Updates**
  - **Updates**
+ 	- Better beta angle support for ArcRotateCamera ([raananw](http://www.github.com/raananw))
     - Better video textures support ([deltakosh](http://www.github.com/deltakosh))
     - Better video textures support ([deltakosh](http://www.github.com/deltakosh))
     - Cameras hierarchy rework ([deltakosh](http://www.github.com/deltakosh))
     - Cameras hierarchy rework ([deltakosh](http://www.github.com/deltakosh))
     - New ```Camera.setSubCameraMode``` to control 3D rendering of any camera (Anaglyph, Stereo, VR) ([Palmer-JC](http://www.github.com/Palmer-JC))
     - New ```Camera.setSubCameraMode``` to control 3D rendering of any camera (Anaglyph, Stereo, VR) ([Palmer-JC](http://www.github.com/Palmer-JC))
     - VR cameras can disable distortion postprocess to get more performance ([deltakosh](http://www.github.com/deltakosh))
     - VR cameras can disable distortion postprocess to get more performance ([deltakosh](http://www.github.com/deltakosh))
-    - New cameras: AnaglyphGamepadCamera, StereogramFreeCamera, StereogramArcRotateCamera, StereogramGamepadCamera ([deltakosh](http://www.github.com/deltakosh))
+    - New cameras: AnaglyphGamepadCamera, StereoscopicFreeCamera, StereoscopicArcRotateCamera, StereoscopicGamepadCamera ([deltakosh](http://www.github.com/deltakosh))
     - New ```MultiMaterial.clone()``` function ([deltakosh](http://www.github.com/deltakosh))
     - New ```MultiMaterial.clone()``` function ([deltakosh](http://www.github.com/deltakosh))
     - Faster ```mesh.computeNormals()``` function ([jbousquie](https://github.com/jbousquie))
     - Faster ```mesh.computeNormals()``` function ([jbousquie](https://github.com/jbousquie))
     - Added the ability [to dynamically update or to morph](http://doc.babylonjs.com/page.php?p=25096) an mesh instance ([jbousquie](https://github.com/jbousquie))
     - Added the ability [to dynamically update or to morph](http://doc.babylonjs.com/page.php?p=25096) an mesh instance ([jbousquie](https://github.com/jbousquie))