David Catuhe пре 6 година
родитељ
комит
b25ee36824

Разлика између датотеке није приказан због своје велике величине
+ 1505 - 1482
Playground/babylon.d.txt


+ 1 - 1
Viewer/package.json

@@ -42,4 +42,4 @@
     "dependencies": {
         "pepjs": "^0.4.3"
     }
-}
+}

Разлика између датотеке није приказан због своје велике величине
+ 5212 - 5189
dist/preview release/babylon.d.ts


Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/preview release/babylon.js


+ 85 - 9
dist/preview release/babylon.max.js

@@ -23465,6 +23465,10 @@ var BABYLON;
              */
             _this.customRenderTargets = new Array();
             /**
+             * When set, the camera will render to this render target instead of the default canvas
+             */
+            _this.customDefaultRenderTarget = null;
+            /**
              * Observable triggered when the camera view matrix has changed.
              */
             _this.onViewMatrixChangedObservable = new BABYLON.Observable();
@@ -24375,6 +24379,10 @@ var BABYLON;
          */
         Camera.RIG_MODE_WEBVR = 21;
         /**
+         * Custom rig mode allowing rig cameras to be populated manually with any number of cameras
+         */
+        Camera.RIG_MODE_CUSTOM = 22;
+        /**
          * Defines if by default attaching controls should prevent the default javascript event to continue.
          */
         Camera.ForceAttachControlToAlwaysPreventDefault = false;
@@ -29046,7 +29054,18 @@ var BABYLON;
                     step.action(this.activeCamera);
                 }
                 this._intermediateRendering = false;
-                engine.restoreDefaultFramebuffer(); // Restore back buffer if needed
+                if (this.activeCamera.customDefaultRenderTarget) {
+                    var internalTexture = this.activeCamera.customDefaultRenderTarget.getInternalTexture();
+                    if (internalTexture) {
+                        engine.bindFramebuffer(internalTexture);
+                    }
+                    else {
+                        BABYLON.Tools.Error("Camera contains invalid customDefaultRenderTarget");
+                    }
+                }
+                else {
+                    engine.restoreDefaultFramebuffer(); // Restore back buffer if needed
+                }
             }
             this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
             // Prepare Frame
@@ -91811,7 +91830,7 @@ var BABYLON;
      * The Motion Blur Post Process which blurs an image based on the objects velocity in scene.
      * Velocity can be affected by each object's rotation, position and scale depending on the transformation speed.
      * As an example, all you have to do is to create the post-process:
-     *  var mb = new BABYLON.MotionBlurProcess(
+     *  var mb = new BABYLON.MotionBlurPostProcess(
      *      'mb', // The name of the effect.
      *      scene, // The scene containing the objects to blur according to their velocity.
      *      1.0, // The required width/height ratio to downsize to before computing the render pass.
@@ -91819,8 +91838,8 @@ var BABYLON;
      * );
      * Then, all objects moving, rotating and/or scaling will be blurred depending on the transformation speed.
      */
-    var MotionBlurProcess = /** @class */ (function (_super) {
-        __extends(MotionBlurProcess, _super);
+    var MotionBlurPostProcess = /** @class */ (function (_super) {
+        __extends(MotionBlurPostProcess, _super);
         /**
          * Creates a new instance MotionBlurPostProcess
          * @param name The name of the effect.
@@ -91833,7 +91852,7 @@ var BABYLON;
          * @param textureType Type of textures used when performing the post process. (default: 0)
          * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
          */
-        function MotionBlurProcess(name, scene, options, camera, samplingMode, engine, reusable, textureType, blockCompilation) {
+        function MotionBlurPostProcess(name, scene, options, camera, samplingMode, engine, reusable, textureType, blockCompilation) {
             if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
             if (blockCompilation === void 0) { blockCompilation = false; }
             var _this = _super.call(this, name, "motionBlur", ["motionStrength", "motionScale", "screenSize"], ["velocitySampler"], options, camera, samplingMode, engine, reusable, "#define SAMPLES 64.0", textureType, undefined, null, blockCompilation) || this;
@@ -91862,7 +91881,7 @@ var BABYLON;
             };
             return _this;
         }
-        Object.defineProperty(MotionBlurProcess.prototype, "motionBlurSamples", {
+        Object.defineProperty(MotionBlurPostProcess.prototype, "motionBlurSamples", {
             /**
              * Gets the number of iterations are used for motion blur quality. Default value is equal to 32
              */
@@ -91883,16 +91902,16 @@ var BABYLON;
          * Disposes the post process.
          * @param camera The camera to dispose the post process on.
          */
-        MotionBlurProcess.prototype.dispose = function (camera) {
+        MotionBlurPostProcess.prototype.dispose = function (camera) {
             if (this._geometryBufferRenderer) {
                 // Clear previous transformation matrices dictionary used to compute objects velocities
                 this._geometryBufferRenderer._previousTransformationMatrices = {};
             }
             _super.prototype.dispose.call(this, camera);
         };
-        return MotionBlurProcess;
+        return MotionBlurPostProcess;
     }(BABYLON.PostProcess));
-    BABYLON.MotionBlurProcess = MotionBlurProcess;
+    BABYLON.MotionBlurPostProcess = MotionBlurPostProcess;
 })(BABYLON || (BABYLON = {}));
 
 //# sourceMappingURL=babylon.motionBlurPostProcess.js.map
@@ -108210,6 +108229,63 @@ var BABYLON;
 
 //# sourceMappingURL=babylon.vrExperienceHelper.js.map
 
+
+var BABYLON;
+(function (BABYLON) {
+    /**
+     * WebXR Camera which holds the views for the xrSession
+     * @see https://doc.babylonjs.com/how_to/webxr
+     */
+    var WebXRCamera = /** @class */ (function (_super) {
+        __extends(WebXRCamera, _super);
+        /**
+         * Creates a new webXRCamera, this should only be set at the camera after it has been updated by the xrSessionManager
+         * @param name the name of the camera
+         * @param scene the scene to add the camera to
+         */
+        function WebXRCamera(name, scene) {
+            var _this = _super.call(this, name, BABYLON.Vector3.Zero(), scene) || this;
+            // Initial camera configuration
+            _this.minZ = 0;
+            _this.rotationQuaternion = new BABYLON.Quaternion();
+            _this.cameraRigMode = BABYLON.Camera.RIG_MODE_CUSTOM;
+            _this._updateNumberOfRigCameras(1);
+            return _this;
+        }
+        WebXRCamera.prototype._updateNumberOfRigCameras = function (viewCount) {
+            if (viewCount === void 0) { viewCount = 1; }
+            while (this.rigCameras.length < viewCount) {
+                var newCamera = new BABYLON.TargetCamera("view: " + this.rigCameras.length, BABYLON.Vector3.Zero(), this.getScene());
+                newCamera.minZ = 0;
+                newCamera.parent = this;
+                this.rigCameras.push(newCamera);
+            }
+            while (this.rigCameras.length > viewCount) {
+                var removedCamera = this.rigCameras.pop();
+                if (removedCamera) {
+                    removedCamera.dispose();
+                }
+            }
+        };
+        /** @hidden */
+        WebXRCamera.prototype._updateForDualEyeDebugging = function (pupilDistance) {
+            if (pupilDistance === void 0) { pupilDistance = 0.01; }
+            // Create initial camera rigs
+            this._updateNumberOfRigCameras(2);
+            this.rigCameras[0].viewport = new BABYLON.Viewport(0, 0, 0.5, 1.0);
+            this.rigCameras[0].position.x = -pupilDistance / 2;
+            this.rigCameras[0].customDefaultRenderTarget = null;
+            this.rigCameras[1].viewport = new BABYLON.Viewport(0.5, 0, 0.5, 1.0);
+            this.rigCameras[1].position.x = pupilDistance / 2;
+            this.rigCameras[1].customDefaultRenderTarget = null;
+        };
+        return WebXRCamera;
+    }(BABYLON.FreeCamera));
+    BABYLON.WebXRCamera = WebXRCamera;
+})(BABYLON || (BABYLON = {}));
+
+//# sourceMappingURL=babylon.webXRCamera.js.map
+
 // Mainly based on these 2 articles :
 // Creating an universal virtual touch joystick working for all Touch models thanks to Hand.JS : http://blogs.msdn.com/b/davrous/archive/2013/02/22/creating-an-universal-virtual-touch-joystick-working-for-all-touch-models-thanks-to-hand-js.aspx
 // & on Seb Lee-Delisle original work: http://seb.ly/2011/04/multi-touch-game-controller-in-javascripthtml5-for-ipad/

+ 85 - 9
dist/preview release/babylon.no-module.max.js

@@ -23432,6 +23432,10 @@ var BABYLON;
              */
             _this.customRenderTargets = new Array();
             /**
+             * When set, the camera will render to this render target instead of the default canvas
+             */
+            _this.customDefaultRenderTarget = null;
+            /**
              * Observable triggered when the camera view matrix has changed.
              */
             _this.onViewMatrixChangedObservable = new BABYLON.Observable();
@@ -24342,6 +24346,10 @@ var BABYLON;
          */
         Camera.RIG_MODE_WEBVR = 21;
         /**
+         * Custom rig mode allowing rig cameras to be populated manually with any number of cameras
+         */
+        Camera.RIG_MODE_CUSTOM = 22;
+        /**
          * Defines if by default attaching controls should prevent the default javascript event to continue.
          */
         Camera.ForceAttachControlToAlwaysPreventDefault = false;
@@ -29013,7 +29021,18 @@ var BABYLON;
                     step.action(this.activeCamera);
                 }
                 this._intermediateRendering = false;
-                engine.restoreDefaultFramebuffer(); // Restore back buffer if needed
+                if (this.activeCamera.customDefaultRenderTarget) {
+                    var internalTexture = this.activeCamera.customDefaultRenderTarget.getInternalTexture();
+                    if (internalTexture) {
+                        engine.bindFramebuffer(internalTexture);
+                    }
+                    else {
+                        BABYLON.Tools.Error("Camera contains invalid customDefaultRenderTarget");
+                    }
+                }
+                else {
+                    engine.restoreDefaultFramebuffer(); // Restore back buffer if needed
+                }
             }
             this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
             // Prepare Frame
@@ -91778,7 +91797,7 @@ var BABYLON;
      * The Motion Blur Post Process which blurs an image based on the objects velocity in scene.
      * Velocity can be affected by each object's rotation, position and scale depending on the transformation speed.
      * As an example, all you have to do is to create the post-process:
-     *  var mb = new BABYLON.MotionBlurProcess(
+     *  var mb = new BABYLON.MotionBlurPostProcess(
      *      'mb', // The name of the effect.
      *      scene, // The scene containing the objects to blur according to their velocity.
      *      1.0, // The required width/height ratio to downsize to before computing the render pass.
@@ -91786,8 +91805,8 @@ var BABYLON;
      * );
      * Then, all objects moving, rotating and/or scaling will be blurred depending on the transformation speed.
      */
-    var MotionBlurProcess = /** @class */ (function (_super) {
-        __extends(MotionBlurProcess, _super);
+    var MotionBlurPostProcess = /** @class */ (function (_super) {
+        __extends(MotionBlurPostProcess, _super);
         /**
          * Creates a new instance MotionBlurPostProcess
          * @param name The name of the effect.
@@ -91800,7 +91819,7 @@ var BABYLON;
          * @param textureType Type of textures used when performing the post process. (default: 0)
          * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
          */
-        function MotionBlurProcess(name, scene, options, camera, samplingMode, engine, reusable, textureType, blockCompilation) {
+        function MotionBlurPostProcess(name, scene, options, camera, samplingMode, engine, reusable, textureType, blockCompilation) {
             if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
             if (blockCompilation === void 0) { blockCompilation = false; }
             var _this = _super.call(this, name, "motionBlur", ["motionStrength", "motionScale", "screenSize"], ["velocitySampler"], options, camera, samplingMode, engine, reusable, "#define SAMPLES 64.0", textureType, undefined, null, blockCompilation) || this;
@@ -91829,7 +91848,7 @@ var BABYLON;
             };
             return _this;
         }
-        Object.defineProperty(MotionBlurProcess.prototype, "motionBlurSamples", {
+        Object.defineProperty(MotionBlurPostProcess.prototype, "motionBlurSamples", {
             /**
              * Gets the number of iterations are used for motion blur quality. Default value is equal to 32
              */
@@ -91850,16 +91869,16 @@ var BABYLON;
          * Disposes the post process.
          * @param camera The camera to dispose the post process on.
          */
-        MotionBlurProcess.prototype.dispose = function (camera) {
+        MotionBlurPostProcess.prototype.dispose = function (camera) {
             if (this._geometryBufferRenderer) {
                 // Clear previous transformation matrices dictionary used to compute objects velocities
                 this._geometryBufferRenderer._previousTransformationMatrices = {};
             }
             _super.prototype.dispose.call(this, camera);
         };
-        return MotionBlurProcess;
+        return MotionBlurPostProcess;
     }(BABYLON.PostProcess));
-    BABYLON.MotionBlurProcess = MotionBlurProcess;
+    BABYLON.MotionBlurPostProcess = MotionBlurPostProcess;
 })(BABYLON || (BABYLON = {}));
 
 //# sourceMappingURL=babylon.motionBlurPostProcess.js.map
@@ -108177,6 +108196,63 @@ var BABYLON;
 
 //# sourceMappingURL=babylon.vrExperienceHelper.js.map
 
+
+var BABYLON;
+(function (BABYLON) {
+    /**
+     * WebXR Camera which holds the views for the xrSession
+     * @see https://doc.babylonjs.com/how_to/webxr
+     */
+    var WebXRCamera = /** @class */ (function (_super) {
+        __extends(WebXRCamera, _super);
+        /**
+         * Creates a new webXRCamera, this should only be set at the camera after it has been updated by the xrSessionManager
+         * @param name the name of the camera
+         * @param scene the scene to add the camera to
+         */
+        function WebXRCamera(name, scene) {
+            var _this = _super.call(this, name, BABYLON.Vector3.Zero(), scene) || this;
+            // Initial camera configuration
+            _this.minZ = 0;
+            _this.rotationQuaternion = new BABYLON.Quaternion();
+            _this.cameraRigMode = BABYLON.Camera.RIG_MODE_CUSTOM;
+            _this._updateNumberOfRigCameras(1);
+            return _this;
+        }
+        WebXRCamera.prototype._updateNumberOfRigCameras = function (viewCount) {
+            if (viewCount === void 0) { viewCount = 1; }
+            while (this.rigCameras.length < viewCount) {
+                var newCamera = new BABYLON.TargetCamera("view: " + this.rigCameras.length, BABYLON.Vector3.Zero(), this.getScene());
+                newCamera.minZ = 0;
+                newCamera.parent = this;
+                this.rigCameras.push(newCamera);
+            }
+            while (this.rigCameras.length > viewCount) {
+                var removedCamera = this.rigCameras.pop();
+                if (removedCamera) {
+                    removedCamera.dispose();
+                }
+            }
+        };
+        /** @hidden */
+        WebXRCamera.prototype._updateForDualEyeDebugging = function (pupilDistance) {
+            if (pupilDistance === void 0) { pupilDistance = 0.01; }
+            // Create initial camera rigs
+            this._updateNumberOfRigCameras(2);
+            this.rigCameras[0].viewport = new BABYLON.Viewport(0, 0, 0.5, 1.0);
+            this.rigCameras[0].position.x = -pupilDistance / 2;
+            this.rigCameras[0].customDefaultRenderTarget = null;
+            this.rigCameras[1].viewport = new BABYLON.Viewport(0.5, 0, 0.5, 1.0);
+            this.rigCameras[1].position.x = pupilDistance / 2;
+            this.rigCameras[1].customDefaultRenderTarget = null;
+        };
+        return WebXRCamera;
+    }(BABYLON.FreeCamera));
+    BABYLON.WebXRCamera = WebXRCamera;
+})(BABYLON || (BABYLON = {}));
+
+//# sourceMappingURL=babylon.webXRCamera.js.map
+
 // Mainly based on these 2 articles :
 // Creating an universal virtual touch joystick working for all Touch models thanks to Hand.JS : http://blogs.msdn.com/b/davrous/archive/2013/02/22/creating-an-universal-virtual-touch-joystick-working-for-all-touch-models-thanks-to-hand-js.aspx
 // & on Seb Lee-Delisle original work: http://seb.ly/2011/04/multi-touch-game-controller-in-javascripthtml5-for-ipad/

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/preview release/babylon.worker.js


Разлика између датотеке није приказан због своје велике величине
+ 87 - 11
dist/preview release/es6.js


+ 1 - 1
dist/preview release/glTF2Interface/package.json

@@ -1,7 +1,7 @@
 {
     "name": "babylonjs-gltf2interface",
     "description": "A typescript declaration of babylon's gltf2 inteface.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js.map


+ 2 - 2
dist/preview release/gui/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-gui",
     "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "3.3.0"
+        "babylonjs": "4.0.0-alpha.0"
     },
     "engines": {
         "node": "*"

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.js.map


+ 5 - 5
dist/preview release/inspector/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,10 +28,10 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "3.3.0",
-        "babylonjs-gui": "3.3.0",
-        "babylonjs-loaders": "3.3.0",
-        "babylonjs-serializers": "3.3.0"
+        "babylonjs": "4.0.0-alpha.0",
+        "babylonjs-gui": "4.0.0-alpha.0",
+        "babylonjs-loaders": "4.0.0-alpha.0",
+        "babylonjs-serializers": "4.0.0-alpha.0"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/loaders/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-loaders",
     "description": "The Babylon.js file loaders library is an extension you can use to load different 3D file types into a Babylon scene.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "3.3.0"
+        "babylonjs-gltf2interface": "4.0.0-alpha.0"
     },
     "peerDependencies": {
         "babylonjs": ">=3.3.0-rc.4"

+ 2 - 2
dist/preview release/materialsLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-materials",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "3.3.0"
+        "babylonjs": "4.0.0-alpha.0"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/postProcessesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-post-process",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "3.3.0"
+        "babylonjs": "4.0.0-alpha.0"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/proceduralTexturesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-procedural-textures",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "3.3.0"
+        "babylonjs": "4.0.0-alpha.0"
     },
     "engines": {
         "node": "*"

+ 3 - 3
dist/preview release/serializers/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-serializers",
     "description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,8 +27,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "3.3.0",
-        "babylonjs-gltf2interface": "3.3.0"
+        "babylonjs": "4.0.0-alpha.0",
+        "babylonjs-gltf2interface": "4.0.0-alpha.0"
     },
     "engines": {
         "node": "*"

Разлика између датотеке није приказан због своје велике величине
+ 2 - 2
dist/preview release/viewer/babylon.viewer.js


Разлика између датотеке није приказан због своје велике величине
+ 3 - 3
dist/preview release/viewer/babylon.viewer.max.js


+ 1 - 1
inspector/src/tools/FullscreenTool.ts

@@ -14,7 +14,7 @@ export class FullscreenTool extends AbstractTool {
 
         function requestFullScreen(element: HTMLElement) {
             // Supports most browsers and their versions.
-            var requestMethod = element.requestFullscreen || element.webkitRequestFullScreen;
+            var requestMethod = element.requestFullscreen || (<any>element).webkitRequestFullScreen;
             requestMethod.call(element);
         }
 

+ 1 - 1
package.json

@@ -9,7 +9,7 @@
     ],
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 0 - 4
src/babylon.mixins.ts

@@ -155,10 +155,6 @@ interface HTMLVideoElement {
     mozSrcObject: any;
 }
 
-interface Element {
-    webkitRequestFullScreen: () => void;
-}
-
 interface Screen {
     readonly orientation: string;
     readonly mozOrientation: string;

+ 1 - 1
tests/validation/validation.js

@@ -235,7 +235,7 @@ function runTest(index, done) {
         var snippetUrl = "//babylonjs-api2.azurewebsites.net/snippets";
         var pgRoot = "/Playground"
 
-        var retryTime = 30 * 1000;
+        var retryTime = 500;
         var maxRetry = 2;
         var retry = 0;