浏览代码

4.0.0-alpha.6

David Catuhe 6 年之前
父节点
当前提交
184a484f77

文件差异内容过多而无法显示
+ 1036 - 1019
Playground/babylon.d.txt


文件差异内容过多而无法显示
+ 4645 - 4628
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/babylon.js


+ 56 - 54
dist/preview release/babylon.max.js

@@ -5642,7 +5642,7 @@ var BABYLON;
          * @param result defines the Vector3 where to store the result
          */
         Vector3.TransformCoordinatesToRef = function (vector, transformation, result) {
-            return Vector3.TransformCoordinatesFromFloatsToRef(vector.x, vector.y, vector.z, transformation, result);
+            Vector3.TransformCoordinatesFromFloatsToRef(vector.x, vector.y, vector.z, transformation, result);
         };
         /**
          * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)
@@ -12841,7 +12841,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "4.0.0-alpha.5";
+                return "4.0.0-alpha.6";
             },
             enumerable: true,
             configurable: true
@@ -19131,10 +19131,12 @@ var BABYLON;
         /**
          * Get all direct children of this node
          * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
+         * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)
          * @returns an array of Node
          */
-        Node.prototype.getChildren = function (predicate) {
-            return this.getDescendants(true, predicate);
+        Node.prototype.getChildren = function (predicate, directDescendantsOnly) {
+            if (directDescendantsOnly === void 0) { directDescendantsOnly = true; }
+            return this.getDescendants(directDescendantsOnly, predicate);
         };
         /** @hidden */
         Node.prototype._setReady = function (state) {
@@ -22275,9 +22277,9 @@ var BABYLON;
          */
         AbstractMesh.prototype.intersects = function (ray, fastCheck) {
             var pickingInfo = new BABYLON.PickingInfo();
-            var intersectionTreshold = this.getClassName() === "LinesMesh" ? this.intersectionThreshold : 0;
+            var intersectionThreshold = this.getClassName() === "InstancedLinesMesh" || this.getClassName() === "LinesMesh" ? this.intersectionThreshold : 0;
             var boundingInfo = this._boundingInfo;
-            if (!this.subMeshes || !boundingInfo || !ray.intersectsSphere(boundingInfo.boundingSphere, intersectionTreshold) || !ray.intersectsBox(boundingInfo.boundingBox, intersectionTreshold)) {
+            if (!this.subMeshes || !boundingInfo || !ray.intersectsSphere(boundingInfo.boundingSphere, intersectionThreshold) || !ray.intersectsBox(boundingInfo.boundingBox, intersectionThreshold)) {
                 return pickingInfo;
             }
             if (!this._generatePointsArray()) {
@@ -22306,8 +22308,10 @@ var BABYLON;
             if (intersectInfo) {
                 // Get picked point
                 var world = this.getWorldMatrix();
-                var worldOrigin = BABYLON.Vector3.TransformCoordinates(ray.origin, world);
-                var direction = ray.direction.scaleToRef(intersectInfo.distance, BABYLON.Tmp.Vector3[0]);
+                var worldOrigin = BABYLON.Tmp.Vector3[0];
+                var direction = BABYLON.Tmp.Vector3[1];
+                BABYLON.Vector3.TransformCoordinatesToRef(ray.origin, world, worldOrigin);
+                ray.direction.scaleToRef(intersectInfo.distance, direction);
                 var worldDirection = BABYLON.Vector3.TransformNormal(direction, world);
                 var pickedPoint = worldDirection.addInPlace(worldOrigin);
                 // Return result
@@ -22398,7 +22402,7 @@ var BABYLON;
                 }
             });
             // SubMeshes
-            if (this.getClassName() !== "InstancedMesh") {
+            if (this.getClassName() !== "InstancedMesh" || this.getClassName() !== "InstancedLinesMesh") {
                 this.releaseSubMeshes();
             }
             // Query
@@ -27435,7 +27439,7 @@ var BABYLON;
                 if (!mesh.isReady(true)) {
                     return false;
                 }
-                var hardwareInstancedRendering = mesh.getClassName() === "InstancedMesh" || engine.getCaps().instancedArrays && mesh.instances.length > 0;
+                var hardwareInstancedRendering = mesh.getClassName() === "InstancedMesh" || mesh.getClassName() === "InstancedLinesMesh" || engine.getCaps().instancedArrays && mesh.instances.length > 0;
                 // Is Ready For Mesh
                 for (var _i = 0, _a = this._isReadyForMeshStage; _i < _a.length; _i++) {
                     var step = _a[_i];
@@ -34672,7 +34676,6 @@ var BABYLON;
         // Instances
         /**
          * Creates a new InstancedMesh object from the mesh model.
-         * Warning : this method is not supported for Line mesh and LineSystem
          * @see http://doc.babylonjs.com/how_to/how_to_use_instances
          * @param name defines the name of the new instance
          * @returns a new InstancedMesh
@@ -36296,10 +36299,8 @@ var BABYLON;
             }
             // LineMesh first as it's also a Mesh...
             if (BABYLON.LinesMesh) {
-                var mesh = this._mesh instanceof BABYLON.InstancedMesh ? this._mesh.sourceMesh : this._mesh;
-                if (mesh instanceof BABYLON.LinesMesh) {
-                    var linesMesh = mesh;
-                    return this._intersectLines(ray, positions, indices, linesMesh.intersectionThreshold, fastCheck);
+                if (this._mesh.getClassName() === "InstancedLinesMesh" || this._mesh.getClassName() === "LinesMesh") {
+                    return this._intersectLines(ray, positions, indices, this._mesh.intersectionThreshold, fastCheck);
                 }
             }
             return this._intersectTriangles(ray, positions, indices, fastCheck);
@@ -65692,7 +65693,7 @@ var BABYLON;
                 _this.useVertexColor = source.useVertexColor;
                 _this.useVertexAlpha = source.useVertexAlpha;
             }
-            _this._intersectionThreshold = 0.1;
+            _this.intersectionThreshold = 0.1;
             var defines = [];
             var options = {
                 attributes: [BABYLON.VertexBuffer.PositionKind, "world0", "world1", "world2", "world3"],
@@ -65713,29 +65714,6 @@ var BABYLON;
             _this._colorShader = new BABYLON.ShaderMaterial("colorShader", _this.getScene(), "color", options);
             return _this;
         }
-        Object.defineProperty(LinesMesh.prototype, "intersectionThreshold", {
-            /**
-             * The intersection Threshold is the margin applied when intersection a segment of the LinesMesh with a Ray.
-             * This margin is expressed in world space coordinates, so its value may vary.
-             * Default value is 0.1
-             * @returns the intersection Threshold value.
-             */
-            get: function () {
-                return this._intersectionThreshold;
-            },
-            /**
-             * The intersection Threshold is the margin applied when intersection a segment of the LinesMesh with a Ray.
-             * This margin is expressed in world space coordinates, so its value may vary.
-             */
-            set: function (value) {
-                if (this._intersectionThreshold === value) {
-                    return;
-                }
-                this._intersectionThreshold = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
         /**
          * Returns the string "LineMesh"
          */
@@ -65805,9 +65783,37 @@ var BABYLON;
         LinesMesh.prototype.clone = function (name, newParent, doNotCloneChildren) {
             return new LinesMesh(name, this.getScene(), newParent, this, doNotCloneChildren);
         };
+        /**
+         * Creates a new InstancedLinesMesh object from the mesh model.
+         * @see http://doc.babylonjs.com/how_to/how_to_use_instances
+         * @param name defines the name of the new instance
+         * @returns a new InstancedLinesMesh
+         */
+        LinesMesh.prototype.createInstance = function (name) {
+            return new InstancedLinesMesh(name, this);
+        };
         return LinesMesh;
     }(BABYLON.Mesh));
     BABYLON.LinesMesh = LinesMesh;
+    /**
+     * Creates an instance based on a source LinesMesh
+     */
+    var InstancedLinesMesh = /** @class */ (function (_super) {
+        __extends(InstancedLinesMesh, _super);
+        function InstancedLinesMesh(name, source) {
+            var _this = _super.call(this, name, source) || this;
+            _this.intersectionThreshold = source.intersectionThreshold;
+            return _this;
+        }
+        /**
+         * Returns the string "InstancedLinesMesh".
+         */
+        InstancedLinesMesh.prototype.getClassName = function () {
+            return "InstancedLinesMesh";
+        };
+        return InstancedLinesMesh;
+    }(BABYLON.InstancedMesh));
+    BABYLON.InstancedLinesMesh = InstancedLinesMesh;
 })(BABYLON || (BABYLON = {}));
 
 //# sourceMappingURL=babylon.linesMesh.js.map
@@ -84136,11 +84142,11 @@ var BABYLON;
             return loadedMeshInfo;
             // Look through all children recursively. This will return null if no mesh exists with the given name.
             function getChildByName(node, name) {
-                return node.getChildMeshes(false, function (n) { return n.name === name; })[0];
+                return node.getChildren(function (n) { return n.name === name; }, false)[0];
             }
             // Look through only immediate children. This will return null if no mesh exists with the given name.
             function getImmediateChildByName(node, name) {
-                return node.getChildMeshes(true, function (n) { return n.name == name; })[0];
+                return node.getChildren(function (n) { return n.name == name; }, true)[0];
             }
         };
         /**
@@ -107062,16 +107068,17 @@ var BABYLON;
                 });
             };
             makeNotPick(mesh);
-            var childMeshes = mesh.getChildMeshes();
+            var meshChildren = mesh.getChildren(undefined, false);
+            var laserParent = mesh;
             this.webVRController._pointingPoseNode = null;
-            for (var i = 0; i < childMeshes.length; i++) {
-                if (childMeshes[i].name && childMeshes[i].name.indexOf(BABYLON.PoseEnabledController.POINTING_POSE) >= 0) {
-                    mesh = childMeshes[i];
-                    this.webVRController._pointingPoseNode = mesh;
+            for (var i = 0; i < meshChildren.length; i++) {
+                if (meshChildren[i].name && meshChildren[i].name.indexOf(BABYLON.PoseEnabledController.POINTING_POSE) >= 0) {
+                    laserParent = meshChildren[i];
+                    this.webVRController._pointingPoseNode = laserParent;
                     break;
                 }
             }
-            this._laserPointer.parent = mesh;
+            this._laserPointer.parent = laserParent;
         };
         VRExperienceHelperControllerGazer.prototype._updatePointerDistance = function (distance) {
             if (distance === void 0) { distance = 100; }
@@ -111760,15 +111767,10 @@ var BABYLON;
         this._edgesRenderer = new BABYLON.LineEdgesRenderer(this, epsilon, checkVerticesInsteadOfIndices);
         return this;
     };
-    BABYLON.InstancedMesh.prototype.enableEdgesRendering = function (epsilon, checkVerticesInsteadOfIndices) {
+    BABYLON.InstancedLinesMesh.prototype.enableEdgesRendering = function (epsilon, checkVerticesInsteadOfIndices) {
         if (epsilon === void 0) { epsilon = 0.95; }
         if (checkVerticesInsteadOfIndices === void 0) { checkVerticesInsteadOfIndices = false; }
-        if (this.sourceMesh.getClassName() === 'LinesMesh') {
-            BABYLON.LinesMesh.prototype.enableEdgesRendering.apply(this, arguments);
-        }
-        else {
-            BABYLON.AbstractMesh.prototype.enableEdgesRendering.apply(this, arguments);
-        }
+        BABYLON.LinesMesh.prototype.enableEdgesRendering.apply(this, arguments);
         return this;
     };
     /**

+ 56 - 54
dist/preview release/babylon.no-module.max.js

@@ -5609,7 +5609,7 @@ var BABYLON;
          * @param result defines the Vector3 where to store the result
          */
         Vector3.TransformCoordinatesToRef = function (vector, transformation, result) {
-            return Vector3.TransformCoordinatesFromFloatsToRef(vector.x, vector.y, vector.z, transformation, result);
+            Vector3.TransformCoordinatesFromFloatsToRef(vector.x, vector.y, vector.z, transformation, result);
         };
         /**
          * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)
@@ -12808,7 +12808,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "4.0.0-alpha.5";
+                return "4.0.0-alpha.6";
             },
             enumerable: true,
             configurable: true
@@ -19098,10 +19098,12 @@ var BABYLON;
         /**
          * Get all direct children of this node
          * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
+         * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)
          * @returns an array of Node
          */
-        Node.prototype.getChildren = function (predicate) {
-            return this.getDescendants(true, predicate);
+        Node.prototype.getChildren = function (predicate, directDescendantsOnly) {
+            if (directDescendantsOnly === void 0) { directDescendantsOnly = true; }
+            return this.getDescendants(directDescendantsOnly, predicate);
         };
         /** @hidden */
         Node.prototype._setReady = function (state) {
@@ -22242,9 +22244,9 @@ var BABYLON;
          */
         AbstractMesh.prototype.intersects = function (ray, fastCheck) {
             var pickingInfo = new BABYLON.PickingInfo();
-            var intersectionTreshold = this.getClassName() === "LinesMesh" ? this.intersectionThreshold : 0;
+            var intersectionThreshold = this.getClassName() === "InstancedLinesMesh" || this.getClassName() === "LinesMesh" ? this.intersectionThreshold : 0;
             var boundingInfo = this._boundingInfo;
-            if (!this.subMeshes || !boundingInfo || !ray.intersectsSphere(boundingInfo.boundingSphere, intersectionTreshold) || !ray.intersectsBox(boundingInfo.boundingBox, intersectionTreshold)) {
+            if (!this.subMeshes || !boundingInfo || !ray.intersectsSphere(boundingInfo.boundingSphere, intersectionThreshold) || !ray.intersectsBox(boundingInfo.boundingBox, intersectionThreshold)) {
                 return pickingInfo;
             }
             if (!this._generatePointsArray()) {
@@ -22273,8 +22275,10 @@ var BABYLON;
             if (intersectInfo) {
                 // Get picked point
                 var world = this.getWorldMatrix();
-                var worldOrigin = BABYLON.Vector3.TransformCoordinates(ray.origin, world);
-                var direction = ray.direction.scaleToRef(intersectInfo.distance, BABYLON.Tmp.Vector3[0]);
+                var worldOrigin = BABYLON.Tmp.Vector3[0];
+                var direction = BABYLON.Tmp.Vector3[1];
+                BABYLON.Vector3.TransformCoordinatesToRef(ray.origin, world, worldOrigin);
+                ray.direction.scaleToRef(intersectInfo.distance, direction);
                 var worldDirection = BABYLON.Vector3.TransformNormal(direction, world);
                 var pickedPoint = worldDirection.addInPlace(worldOrigin);
                 // Return result
@@ -22365,7 +22369,7 @@ var BABYLON;
                 }
             });
             // SubMeshes
-            if (this.getClassName() !== "InstancedMesh") {
+            if (this.getClassName() !== "InstancedMesh" || this.getClassName() !== "InstancedLinesMesh") {
                 this.releaseSubMeshes();
             }
             // Query
@@ -27402,7 +27406,7 @@ var BABYLON;
                 if (!mesh.isReady(true)) {
                     return false;
                 }
-                var hardwareInstancedRendering = mesh.getClassName() === "InstancedMesh" || engine.getCaps().instancedArrays && mesh.instances.length > 0;
+                var hardwareInstancedRendering = mesh.getClassName() === "InstancedMesh" || mesh.getClassName() === "InstancedLinesMesh" || engine.getCaps().instancedArrays && mesh.instances.length > 0;
                 // Is Ready For Mesh
                 for (var _i = 0, _a = this._isReadyForMeshStage; _i < _a.length; _i++) {
                     var step = _a[_i];
@@ -34639,7 +34643,6 @@ var BABYLON;
         // Instances
         /**
          * Creates a new InstancedMesh object from the mesh model.
-         * Warning : this method is not supported for Line mesh and LineSystem
          * @see http://doc.babylonjs.com/how_to/how_to_use_instances
          * @param name defines the name of the new instance
          * @returns a new InstancedMesh
@@ -36263,10 +36266,8 @@ var BABYLON;
             }
             // LineMesh first as it's also a Mesh...
             if (BABYLON.LinesMesh) {
-                var mesh = this._mesh instanceof BABYLON.InstancedMesh ? this._mesh.sourceMesh : this._mesh;
-                if (mesh instanceof BABYLON.LinesMesh) {
-                    var linesMesh = mesh;
-                    return this._intersectLines(ray, positions, indices, linesMesh.intersectionThreshold, fastCheck);
+                if (this._mesh.getClassName() === "InstancedLinesMesh" || this._mesh.getClassName() === "LinesMesh") {
+                    return this._intersectLines(ray, positions, indices, this._mesh.intersectionThreshold, fastCheck);
                 }
             }
             return this._intersectTriangles(ray, positions, indices, fastCheck);
@@ -65659,7 +65660,7 @@ var BABYLON;
                 _this.useVertexColor = source.useVertexColor;
                 _this.useVertexAlpha = source.useVertexAlpha;
             }
-            _this._intersectionThreshold = 0.1;
+            _this.intersectionThreshold = 0.1;
             var defines = [];
             var options = {
                 attributes: [BABYLON.VertexBuffer.PositionKind, "world0", "world1", "world2", "world3"],
@@ -65680,29 +65681,6 @@ var BABYLON;
             _this._colorShader = new BABYLON.ShaderMaterial("colorShader", _this.getScene(), "color", options);
             return _this;
         }
-        Object.defineProperty(LinesMesh.prototype, "intersectionThreshold", {
-            /**
-             * The intersection Threshold is the margin applied when intersection a segment of the LinesMesh with a Ray.
-             * This margin is expressed in world space coordinates, so its value may vary.
-             * Default value is 0.1
-             * @returns the intersection Threshold value.
-             */
-            get: function () {
-                return this._intersectionThreshold;
-            },
-            /**
-             * The intersection Threshold is the margin applied when intersection a segment of the LinesMesh with a Ray.
-             * This margin is expressed in world space coordinates, so its value may vary.
-             */
-            set: function (value) {
-                if (this._intersectionThreshold === value) {
-                    return;
-                }
-                this._intersectionThreshold = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
         /**
          * Returns the string "LineMesh"
          */
@@ -65772,9 +65750,37 @@ var BABYLON;
         LinesMesh.prototype.clone = function (name, newParent, doNotCloneChildren) {
             return new LinesMesh(name, this.getScene(), newParent, this, doNotCloneChildren);
         };
+        /**
+         * Creates a new InstancedLinesMesh object from the mesh model.
+         * @see http://doc.babylonjs.com/how_to/how_to_use_instances
+         * @param name defines the name of the new instance
+         * @returns a new InstancedLinesMesh
+         */
+        LinesMesh.prototype.createInstance = function (name) {
+            return new InstancedLinesMesh(name, this);
+        };
         return LinesMesh;
     }(BABYLON.Mesh));
     BABYLON.LinesMesh = LinesMesh;
+    /**
+     * Creates an instance based on a source LinesMesh
+     */
+    var InstancedLinesMesh = /** @class */ (function (_super) {
+        __extends(InstancedLinesMesh, _super);
+        function InstancedLinesMesh(name, source) {
+            var _this = _super.call(this, name, source) || this;
+            _this.intersectionThreshold = source.intersectionThreshold;
+            return _this;
+        }
+        /**
+         * Returns the string "InstancedLinesMesh".
+         */
+        InstancedLinesMesh.prototype.getClassName = function () {
+            return "InstancedLinesMesh";
+        };
+        return InstancedLinesMesh;
+    }(BABYLON.InstancedMesh));
+    BABYLON.InstancedLinesMesh = InstancedLinesMesh;
 })(BABYLON || (BABYLON = {}));
 
 //# sourceMappingURL=babylon.linesMesh.js.map
@@ -84103,11 +84109,11 @@ var BABYLON;
             return loadedMeshInfo;
             // Look through all children recursively. This will return null if no mesh exists with the given name.
             function getChildByName(node, name) {
-                return node.getChildMeshes(false, function (n) { return n.name === name; })[0];
+                return node.getChildren(function (n) { return n.name === name; }, false)[0];
             }
             // Look through only immediate children. This will return null if no mesh exists with the given name.
             function getImmediateChildByName(node, name) {
-                return node.getChildMeshes(true, function (n) { return n.name == name; })[0];
+                return node.getChildren(function (n) { return n.name == name; }, true)[0];
             }
         };
         /**
@@ -107029,16 +107035,17 @@ var BABYLON;
                 });
             };
             makeNotPick(mesh);
-            var childMeshes = mesh.getChildMeshes();
+            var meshChildren = mesh.getChildren(undefined, false);
+            var laserParent = mesh;
             this.webVRController._pointingPoseNode = null;
-            for (var i = 0; i < childMeshes.length; i++) {
-                if (childMeshes[i].name && childMeshes[i].name.indexOf(BABYLON.PoseEnabledController.POINTING_POSE) >= 0) {
-                    mesh = childMeshes[i];
-                    this.webVRController._pointingPoseNode = mesh;
+            for (var i = 0; i < meshChildren.length; i++) {
+                if (meshChildren[i].name && meshChildren[i].name.indexOf(BABYLON.PoseEnabledController.POINTING_POSE) >= 0) {
+                    laserParent = meshChildren[i];
+                    this.webVRController._pointingPoseNode = laserParent;
                     break;
                 }
             }
-            this._laserPointer.parent = mesh;
+            this._laserPointer.parent = laserParent;
         };
         VRExperienceHelperControllerGazer.prototype._updatePointerDistance = function (distance) {
             if (distance === void 0) { distance = 100; }
@@ -111727,15 +111734,10 @@ var BABYLON;
         this._edgesRenderer = new BABYLON.LineEdgesRenderer(this, epsilon, checkVerticesInsteadOfIndices);
         return this;
     };
-    BABYLON.InstancedMesh.prototype.enableEdgesRendering = function (epsilon, checkVerticesInsteadOfIndices) {
+    BABYLON.InstancedLinesMesh.prototype.enableEdgesRendering = function (epsilon, checkVerticesInsteadOfIndices) {
         if (epsilon === void 0) { epsilon = 0.95; }
         if (checkVerticesInsteadOfIndices === void 0) { checkVerticesInsteadOfIndices = false; }
-        if (this.sourceMesh.getClassName() === 'LinesMesh') {
-            BABYLON.LinesMesh.prototype.enableEdgesRendering.apply(this, arguments);
-        }
-        else {
-            BABYLON.AbstractMesh.prototype.enableEdgesRendering.apply(this, arguments);
-        }
+        BABYLON.LinesMesh.prototype.enableEdgesRendering.apply(this, arguments);
         return this;
     };
     /**

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/babylon.worker.js


文件差异内容过多而无法显示
+ 58 - 56
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": "4.0.0-alpha.5",
+    "version": "4.0.0-alpha.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 4 - 0
dist/preview release/gui/babylon.gui.d.ts

@@ -819,6 +819,10 @@ declare module BABYLON.GUI {
     export class Control {
             /** defines the name of the control */
             name?: string | undefined;
+            /**
+                * Gets or sets a boolean indicating if alpha must be an inherited value (false by default)
+                */
+            static AllowAlphaInheritance: boolean;
             /** @hidden */
             _root: BABYLON.Nullable<Container>;
             /** @hidden */

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/gui/babylon.gui.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js.map


+ 8 - 0
dist/preview release/gui/babylon.gui.module.d.ts

@@ -926,6 +926,10 @@ declare module 'babylonjs-gui/2D/controls/control' {
     export class Control {
             /** defines the name of the control */
             name?: string | undefined;
+            /**
+                * Gets or sets a boolean indicating if alpha must be an inherited value (false by default)
+                */
+            static AllowAlphaInheritance: boolean;
             /** @hidden */
             _root: Nullable<Container>;
             /** @hidden */
@@ -3763,6 +3767,10 @@ declare module BABYLON.GUI {
     export class Control {
             /** defines the name of the control */
             name?: string | undefined;
+            /**
+                * Gets or sets a boolean indicating if alpha must be an inherited value (false by default)
+                */
+            static AllowAlphaInheritance: boolean;
             /** @hidden */
             _root: BABYLON.Nullable<Container>;
             /** @hidden */

+ 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": "4.0.0-alpha.5",
+    "version": "4.0.0-alpha.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.5"
+        "babylonjs": "4.0.0-alpha.6"
     },
     "engines": {
         "node": "*"

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

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

+ 3 - 3
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": "4.0.0-alpha.5",
+    "version": "4.0.0-alpha.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,8 +27,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "4.0.0-alpha.5",
-        "babylonjs": "4.0.0-alpha.5"
+        "babylonjs-gltf2interface": "4.0.0-alpha.6",
+        "babylonjs": "4.0.0-alpha.6"
     },
     "engines": {
         "node": "*"

+ 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": "4.0.0-alpha.5",
+    "version": "4.0.0-alpha.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.5"
+        "babylonjs": "4.0.0-alpha.6"
     },
     "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": "4.0.0-alpha.5",
+    "version": "4.0.0-alpha.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.5"
+        "babylonjs": "4.0.0-alpha.6"
     },
     "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": "4.0.0-alpha.5",
+    "version": "4.0.0-alpha.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.5"
+        "babylonjs": "4.0.0-alpha.6"
     },
     "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": "4.0.0-alpha.5",
+    "version": "4.0.0-alpha.6",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,8 +27,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.5",
-        "babylonjs-gltf2interface": "4.0.0-alpha.5"
+        "babylonjs": "4.0.0-alpha.6",
+        "babylonjs-gltf2interface": "4.0.0-alpha.6"
     },
     "engines": {
         "node": "*"

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 1 - 0
dist/preview release/what's new.md

@@ -24,6 +24,7 @@
 - Added `button.image` and `button.textBlock` to simplify access to button internal parts ([Deltakosh](https://github.com/deltakosh))
 - Added `sldier.displayThumb` to show/hide slider's thumb ([Deltakosh](https://github.com/deltakosh))
 - Added `grid.rowCount`, `grid.columnCount` and `grid.getChildrenAt()` ([Deltakosh](https://github.com/deltakosh))
+- Added `Control.AllowAlphaInheritance` to let users control the way alpha is used (inherited or not) ([Deltakosh](https://github.com/deltakosh))
 
 ### Core Engine
 

+ 10 - 1
gui/src/2D/controls/control.ts

@@ -11,6 +11,11 @@ import { Matrix2D, Vector2WithInfo } from "../math2D";
  * @see http://doc.babylonjs.com/how_to/gui#controls
  */
 export class Control {
+    /**
+     * Gets or sets a boolean indicating if alpha must be an inherited value (false by default)
+     */
+    public static AllowAlphaInheritance = false;
+
     private _alpha = 1;
     private _alphaSet = false;
     private _zIndex = 0;
@@ -966,6 +971,8 @@ export class Control {
         }
     }
 
+
+
     /** @hidden */
     protected _applyStates(context: CanvasRenderingContext2D): void {
         if (this._isFontSizeInPercentage) {
@@ -985,7 +992,9 @@ export class Control {
             context.fillStyle = this._color;
         }
 
-        if (this._alphaSet) {
+        if (Control.AllowAlphaInheritance) {
+            context.globalAlpha *= this._alpha;
+        } else if (this._alphaSet) {
             context.globalAlpha = this.parent ? this.parent.alpha * this._alpha : this._alpha;
         }
     }

+ 1 - 1
package.json

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

+ 1 - 1
src/Engine/babylon.engine.ts

@@ -481,7 +481,7 @@ module BABYLON {
          * Returns the current version of the framework
          */
         public static get Version(): string {
-            return "4.0.0-alpha.5";
+            return "4.0.0-alpha.6";
         }
 
         /**