소스 검색

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

# Conflicts:
#	dist/preview release/babylon.d.ts
#	dist/preview release/babylon.module.d.ts
David Catuhe 8 년 전
부모
커밋
5a511dd666
28개의 변경된 파일24433개의 추가작업 그리고 24693개의 파일을 삭제
  1. BIN
      Exporters/3ds Max/Max2Babylon-0.9.0.zip
  2. 4 4
      Exporters/3ds Max/Max2Babylon/Tools/WebServer.cs
  3. 4 4
      Playground/zipContent/index.html
  4. 9571 9562
      dist/preview release/babylon.d.ts
  5. 1 1
      dist/preview release/babylon.js
  6. 1 1
      dist/preview release/babylon.max.js
  7. 9571 9562
      dist/preview release/babylon.module.d.ts
  8. 1 1
      dist/preview release/babylon.worker.js
  9. 2589 2610
      dist/preview release/customConfigurations/minimalViewer/babylon.d.ts
  10. 25 25
      dist/preview release/customConfigurations/minimalViewer/babylon.js
  11. 26 95
      dist/preview release/customConfigurations/minimalViewer/babylon.max.js
  12. 2589 2610
      dist/preview release/customConfigurations/minimalViewer/babylon.module.d.ts
  13. 0 4
      dist/preview release/gui/babylon.gui.d.ts
  14. 2 38
      dist/preview release/gui/babylon.gui.js
  15. 2 2
      dist/preview release/gui/babylon.gui.min.js
  16. 2 6
      gui/src/advancedDynamicTexture.ts
  17. 0 7
      gui/src/controls/container.ts
  18. 0 36
      gui/src/controls/control.ts
  19. 21 41
      src/Bones/babylon.bone.ts
  20. 1 1
      src/Collisions/babylon.collider.ts
  21. 1 1
      src/Debug/babylon.debugLayer.ts
  22. 11 35
      src/Materials/Textures/babylon.mirrorTexture.ts
  23. 5 20
      src/Materials/Textures/babylon.texture.ts
  24. 1 19
      src/Math/babylon.math.ts
  25. 3 3
      src/Mesh/babylon.abstractMesh.ts
  26. 1 1
      src/Mesh/babylon.meshBuilder.ts
  27. 1 1
      src/Particles/babylon.solidParticle.ts
  28. 0 3
      src/PostProcess/babylon.postProcess.ts

BIN
Exporters/3ds Max/Max2Babylon-0.9.0.zip


+ 4 - 4
Exporters/3ds Max/Max2Babylon/Tools/WebServer.cs

@@ -18,10 +18,10 @@ namespace Max2Babylon
 
 <head>
     <title>Babylon.js</title>
-    <script type='text/javascript' src='https://preview.babylonjs.com/oimo.js'></script>
-    <script type='text/javascript' src='https://preview.babylonjs.com/cannon.js'></script>
-    <script type='text/javascript' src='https://preview.babylonjs.com/babylon.js'></script>
-    <script type='text/javascript' src='https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js'></script>
+    <script type='text/javascript' src='http://www.babylonjs.com/oimo.js'></script>
+    <script type='text/javascript' src='http://www.babylonjs.com/cannon.js'></script>
+    <script type='text/javascript' src='http://www.babylonjs.com/babylon.js'></script>
+    <script type='text/javascript' src='http://www.babylonjs.com/babylon.inspector.bundle.js'></script>
     <style type='text/css'>
         html, body, div, canvas {
             width: 100%;

+ 4 - 4
Playground/zipContent/index.html

@@ -5,10 +5,10 @@
 
         <title>Babylon.js sample code</title>
         <!-- Babylon.js -->
-        <script src="https://www.babylonjs.com/hand.minified-1.2.js"></script>
-        <script src="https://preview.babylonjs.com/cannon.js"></script>
-        <script src="https://preview.babylonjs.com/oimo.js"></script>
-        <script src="https://preview.babylonjs.com/babylon.js"></script>
+        <script src="http://www.babylonjs.com/hand.minified-1.2.js"></script>
+        <script src="http://www.babylonjs.com/cannon.js"></script>
+        <script src="http://www.babylonjs.com/oimo.js"></script>
+        <script src="http://www.babylonjs.com/babylon.js"></script>
         <style>
             html, body {
                 overflow: hidden;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 9571 - 9562
dist/preview release/babylon.d.ts


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
dist/preview release/babylon.js


+ 1 - 1
dist/preview release/babylon.max.js

@@ -60603,7 +60603,7 @@ var BABYLON;
         return DebugLayer;
     }());
     // Get protocol used - http or https
-    DebugLayer.InspectorURL = window.location.href.split('/')[0] + '//www.babylonjs.com/babylon.inspector.bundle.js';
+    DebugLayer.InspectorURL = window.location.href.split('/')[0] + '//preview.babylonjs.com/inspector/babylon.inspector.bundle.js';
     BABYLON.DebugLayer = DebugLayer;
 })(BABYLON || (BABYLON = {}));
 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 9571 - 9562
dist/preview release/babylon.module.d.ts


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
dist/preview release/babylon.worker.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2589 - 2610
dist/preview release/customConfigurations/minimalViewer/babylon.d.ts


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 25 - 25
dist/preview release/customConfigurations/minimalViewer/babylon.js


+ 26 - 95
dist/preview release/customConfigurations/minimalViewer/babylon.max.js

@@ -841,12 +841,6 @@ var __extends = (this && this.__extends) || (function () {
             return new Vector2(0, 0);
         };
         /**
-         * Returns a new Vector2(1, 1)
-         */
-        Vector2.One = function () {
-            return new Vector2(1, 1);
-        };
-        /**
          * Returns a new Vector2 set from the passed index element of the passed array.
          */
         Vector2.FromArray = function (array, offset) {
@@ -1384,12 +1378,6 @@ var __extends = (this && this.__extends) || (function () {
             return new Vector3(0.0, 0.0, 0.0);
         };
         /**
-         * Returns a new Vector3 set to (1.0, 1.0, 1.0).
-         */
-        Vector3.One = function () {
-            return new Vector3(1.0, 1.0, 1.0);
-        };
-        /**
          * Returns a new Vector3 set to (0.0, 1.0, 0.0)
          */
         Vector3.Up = function () {
@@ -2053,12 +2041,6 @@ var __extends = (this && this.__extends) || (function () {
             return new Vector4(0.0, 0.0, 0.0, 0.0);
         };
         /**
-         * Returns a new Vector4 set to (1.0, 1.0, 1.0, 1.0)
-         */
-        Vector4.One = function () {
-            return new Vector4(1.0, 1.0, 1.0, 1.0);
-        };
-        /**
          * Returns a new normalized Vector4 from the passed one.
          */
         Vector4.Normalize = function (vector) {
@@ -8927,13 +8909,7 @@ var BABYLON;
                 }
             }
             // Z offset
-            this.setZOffset(zOffset);
-        };
-        Engine.prototype.setZOffset = function (value) {
-            this._depthCullingState.zOffset = value;
-        };
-        Engine.prototype.getZOffset = function () {
-            return this._depthCullingState.zOffset;
+            this._depthCullingState.zOffset = zOffset;
         };
         Engine.prototype.setDepthBuffer = function (enable) {
             this._depthCullingState.depthTest = enable;
@@ -11205,9 +11181,9 @@ var BABYLON;
             _this.onAfterWorldMatrixUpdateObservable = new BABYLON.Observable();
             // Properties
             _this.definedFacingForward = true; // orientation for POV movement & rotation
-            _this.position = BABYLON.Vector3.Zero();
-            _this._rotation = BABYLON.Vector3.Zero();
-            _this._scaling = BABYLON.Vector3.One();
+            _this.position = new BABYLON.Vector3(0.0, 0.0, 0.0);
+            _this._rotation = new BABYLON.Vector3(0.0, 0.0, 0.0);
+            _this._scaling = new BABYLON.Vector3(1.0, 1.0, 1.0);
             _this.billboardMode = AbstractMesh.BILLBOARDMODE_NONE;
             _this.visibility = 1.0;
             _this.alphaIndex = Number.MAX_VALUE;
@@ -19106,6 +19082,10 @@ var BABYLON;
             _this._deleteBuffer = deleteBuffer;
             _this._format = format;
             scene = _this.getScene();
+            if (!url) {
+                return _this;
+            }
+            _this._texture = _this._getFromCache(url, noMipmap, samplingMode);
             var load = function () {
                 if (_this._onLoadObservarble && _this._onLoadObservarble.hasObservers()) {
                     _this.onLoadObservable.notifyObservers(true);
@@ -19117,12 +19097,6 @@ var BABYLON;
                     scene.resetCachedMaterial();
                 }
             };
-            if (!url) {
-                _this._delayedOnLoad = load;
-                _this._delayedOnError = onError;
-                return _this;
-            }
-            _this._texture = _this._getFromCache(url, noMipmap, samplingMode);
             if (!_this._texture) {
                 if (!scene.useDelayedTextureLoading) {
                     _this._texture = scene.getEngine().createTexture(url, noMipmap, invertY, scene, _this._samplingMode, load, onError, _this._buffer, null, _this._format);
@@ -19163,13 +19137,7 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Texture.prototype.updateURL = function (url) {
-            this.url = url;
-            this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED;
-            this.delayLoad();
-        };
         Texture.prototype.delayLoad = function () {
-            var _this = this;
             if (this.delayLoadState !== BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) {
                 return;
             }
@@ -19181,14 +19149,6 @@ var BABYLON;
                     delete this._buffer;
                 }
             }
-            else {
-                if (this._texture.isReady) {
-                    BABYLON.Tools.SetImmediate(function () { return _this._delayedOnLoad(); });
-                }
-                else {
-                    this._texture.onLoadedCallbacks.push(this._delayedOnLoad);
-                }
-            }
         };
         Texture.prototype.updateSamplingMode = function (samplingMode) {
             if (!this._texture) {
@@ -20199,7 +20159,7 @@ var BABYLON;
          * Please note that the mesh must have normals vertex data already.
          * Returns the Mesh.
          */
-        Mesh.prototype.recomputeNormals = function (markDataAsUpdatable) {
+        Mesh.prototype.recomputeNormals = function () {
             var positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind);
             var indices = this.getIndices();
             var normals;
@@ -20210,7 +20170,7 @@ var BABYLON;
                 normals = [];
             }
             BABYLON.VertexData.ComputeNormals(positions, indices, normals);
-            this.setVerticesData(BABYLON.VertexBuffer.NormalKind, normals, markDataAsUpdatable);
+            this.updateVerticesData(BABYLON.VertexBuffer.NormalKind, normals, false, false);
             return this;
         };
         /**
@@ -24755,7 +24715,6 @@ var BABYLON;
             if (flag & BABYLON.Material.MiscDirtyFlag) {
                 this._markAllSubMeshesAsMiscDirty();
             }
-            this.getScene().resetCachedMaterial();
         };
         PushMaterial.prototype._markAllSubMeshesAsDirty = function (func) {
             for (var _i = 0, _a = this.getScene().meshes; _i < _a.length; _i++) {
@@ -29670,7 +29629,7 @@ var BABYLON;
             var normals = sourceMesh.getVerticesData(BABYLON.VertexBuffer.NormalKind);
             var position = options.position || BABYLON.Vector3.Zero();
             var normal = options.normal || BABYLON.Vector3.Up();
-            var size = options.size || BABYLON.Vector3.One();
+            var size = options.size || new BABYLON.Vector3(1, 1, 1);
             var angle = options.angle || 0;
             // Getting correct rotation
             if (!normal) {
@@ -33266,9 +33225,8 @@ var BABYLON;
             _this.mirrorPlane = new BABYLON.Plane(0, 1, 0, 1);
             _this._transformMatrix = BABYLON.Matrix.Zero();
             _this._mirrorMatrix = BABYLON.Matrix.Zero();
-            _this._blurKernelX = 0;
-            _this._blurKernelY = 0;
-            _this._blurRatio = 1.0;
+            _this._blurKernel = 0;
+            _this._blurRatio = 0.6;
             _this.onBeforeRenderObservable.add(function () {
                 BABYLON.Matrix.ReflectionToRef(_this.mirrorPlane, _this._mirrorMatrix);
                 _this._savedViewMatrix = scene.getViewMatrix();
@@ -33301,36 +33259,14 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(MirrorTexture.prototype, "blurKernel", {
-            set: function (value) {
-                this.blurKernelX = value;
-                this.blurKernelY = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(MirrorTexture.prototype, "blurKernelX", {
-            get: function () {
-                return this._blurKernelX;
-            },
-            set: function (value) {
-                if (this._blurKernelX === value) {
-                    return;
-                }
-                this._blurKernelX = value;
-                this._preparePostProcesses();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(MirrorTexture.prototype, "blurKernelY", {
             get: function () {
-                return this._blurKernelY;
+                return this._blurKernel;
             },
             set: function (value) {
-                if (this._blurKernelY === value) {
+                if (this._blurKernel === value) {
                     return;
                 }
-                this._blurKernelY = value;
+                this._blurKernel = value;
                 this._preparePostProcesses();
             },
             enumerable: true,
@@ -33338,20 +33274,15 @@ var BABYLON;
         });
         MirrorTexture.prototype._preparePostProcesses = function () {
             this.clearPostProcesses(true);
-            if (this._blurKernelX && this._blurKernelY) {
+            if (this._blurKernel) {
                 var engine = this.getScene().getEngine();
                 var textureType = engine.getCaps().textureFloatRender ? BABYLON.Engine.TEXTURETYPE_FLOAT : BABYLON.Engine.TEXTURETYPE_HALF_FLOAT;
-                this._blurX = new BABYLON.BlurPostProcess("horizontal blur", new BABYLON.Vector2(1.0, 0), this._blurKernelX, this._blurRatio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false, textureType);
+                this._blurX = new BABYLON.BlurPostProcess("horizontal blur", new BABYLON.Vector2(1.0, 0), this._blurKernel, this._blurRatio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false, textureType);
                 this._blurX.autoClear = false;
-                if (this._blurRatio === 1) {
-                    this._blurX.outputTexture = this._texture;
-                }
-                else {
-                    this._blurX.alwaysForcePOT = true;
-                }
-                this._blurY = new BABYLON.BlurPostProcess("vertical blur", new BABYLON.Vector2(0, 1.0), this._blurKernelY, this._blurRatio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false, textureType);
+                this._blurX.alwaysForcePOT = false;
+                this._blurY = new BABYLON.BlurPostProcess("vertical blur", new BABYLON.Vector2(0, 1.0), this._blurKernel, this._blurRatio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false, textureType);
                 this._blurY.autoClear = false;
-                this._blurY.alwaysForcePOT = this._blurRatio !== 1;
+                this._blurY.alwaysForcePOT = true;
                 this.addPostProcess(this._blurX);
                 this.addPostProcess(this._blurY);
             }
@@ -35330,9 +35261,11 @@ var BABYLON;
             if (defines._areFresnelDirty) {
                 if (StandardMaterial.FresnelEnabled) {
                     // Fresnel
-                    if (this._diffuseFresnelParameters || this._opacityFresnelParameters ||
-                        this._emissiveFresnelParameters || this._refractionFresnelParameters ||
-                        this._reflectionFresnelParameters) {
+                    if (this._diffuseFresnelParameters && this._diffuseFresnelParameters.isEnabled ||
+                        this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled ||
+                        this._emissiveFresnelParameters && this._emissiveFresnelParameters.isEnabled ||
+                        this._refractionFresnelParameters && this._refractionFresnelParameters.isEnabled ||
+                        this._reflectionFresnelParameters && this._reflectionFresnelParameters.isEnabled) {
                         defines.DIFFUSEFRESNEL = (this._diffuseFresnelParameters && this._diffuseFresnelParameters.isEnabled);
                         defines.OPACITYFRESNEL = (this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled);
                         defines.REFLECTIONFRESNEL = (this._reflectionFresnelParameters && this._reflectionFresnelParameters.isEnabled);
@@ -41347,8 +41280,6 @@ var BABYLON;
             }
             else if (this._forcedOutputTexture) {
                 target = this._forcedOutputTexture;
-                this.width = this._forcedOutputTexture._width;
-                this.height = this._forcedOutputTexture._height;
             }
             else {
                 target = this.outputTexture;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2589 - 2610
dist/preview release/customConfigurations/minimalViewer/babylon.module.d.ts


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

@@ -30,7 +30,6 @@ declare module BABYLON.GUI {
         removeControl(control: Control): AdvancedDynamicTexture;
         dispose(): void;
         private _onResize();
-        _getGlobalViewport(scene: Scene): Viewport;
         private _checkUpdate(camera);
         private _render();
         private _doPicking(x, y, type);
@@ -215,9 +214,6 @@ declare module BABYLON.GUI {
         readonly centerY: number;
         constructor(name?: string);
         protected _getTypeName(): string;
-        getLocalCoordinates(globalCoordinates: Vector2): Vector2;
-        getLocalCoordinatesToRef(globalCoordinates: Vector2, result: Vector2): Control;
-        moveToVector3(position: Vector3, scene: Scene): void;
         linkWithMesh(mesh: AbstractMesh): void;
         _moveToProjectedPosition(projectedPosition: Vector3): void;
         _markMatrixAsDirty(): void;

+ 2 - 38
dist/preview release/gui/babylon.gui.js

@@ -148,10 +148,6 @@ var BABYLON;
                     }
                 }
             };
-            AdvancedDynamicTexture.prototype._getGlobalViewport = function (scene) {
-                var engine = scene.getEngine();
-                return this._fullscreenViewport.toGlobal(engine.getRenderWidth(), engine.getRenderHeight());
-            };
             AdvancedDynamicTexture.prototype._checkUpdate = function (camera) {
                 if (this._layerToDispose) {
                     if ((camera.layerMask & this._layerToDispose.layerMask) === 0) {
@@ -160,7 +156,8 @@ var BABYLON;
                 }
                 if (this._isFullscreen && this._linkedControls.length) {
                     var scene = this.getScene();
-                    var globalViewport = this._getGlobalViewport(scene);
+                    var engine = scene.getEngine();
+                    var globalViewport = this._fullscreenViewport.toGlobal(engine.getRenderWidth(), engine.getRenderHeight());
                     for (var _i = 0, _a = this._linkedControls; _i < _a.length; _i++) {
                         var control = _a[_i];
                         var mesh = control._linkedMesh;
@@ -1002,33 +999,6 @@ var BABYLON;
             Control.prototype._getTypeName = function () {
                 return "Control";
             };
-            Control.prototype.getLocalCoordinates = function (globalCoordinates) {
-                var result = BABYLON.Vector2.Zero();
-                this.getLocalCoordinatesToRef(globalCoordinates, result);
-                return result;
-            };
-            Control.prototype.getLocalCoordinatesToRef = function (globalCoordinates, result) {
-                result.x = globalCoordinates.x - this._currentMeasure.left;
-                result.y = globalCoordinates.y - this._currentMeasure.top;
-                return this;
-            };
-            Control.prototype.moveToVector3 = function (position, scene) {
-                if (!this._host || this._root !== this._host._rootContainer) {
-                    BABYLON.Tools.Error("Cannot move a control to a vector3 if the control is not at root level");
-                    return;
-                }
-                this.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;
-                this.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
-                var engine = scene.getEngine();
-                var globalViewport = this._host._getGlobalViewport(scene);
-                var projectedPosition = BABYLON.Vector3.Project(position, BABYLON.Matrix.Identity(), scene.getTransformMatrix(), globalViewport);
-                this._moveToProjectedPosition(projectedPosition);
-                if (projectedPosition.z < 0 || projectedPosition.z > 1) {
-                    this.isVisible = false;
-                    return;
-                }
-                this.isVisible = true;
-            };
             Control.prototype.linkWithMesh = function (mesh) {
                 if (!this._host || this._root !== this._host._rootContainer) {
                     BABYLON.Tools.Error("Cannot link a control to a mesh if the control is not at root level");
@@ -1603,9 +1573,6 @@ var BABYLON;
                 }
             };
             Container.prototype._draw = function (parentMeasure, context) {
-                if (!this.isVisible) {
-                    return;
-                }
                 context.save();
                 this._applyStates(context);
                 if (this._processMeasures(parentMeasure, context)) {
@@ -1621,9 +1588,6 @@ var BABYLON;
                 context.restore();
             };
             Container.prototype._processPicking = function (x, y, type) {
-                if (!this.isHitTestVisible || !this.isVisible) {
-                    return false;
-                }
                 if (!_super.prototype.contains.call(this, x, y)) {
                     return false;
                 }

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 2
dist/preview release/gui/babylon.gui.min.js


+ 2 - 6
gui/src/advancedDynamicTexture.ts

@@ -158,11 +158,6 @@ module BABYLON.GUI {
             }
         }
 
-        public _getGlobalViewport(scene: Scene): Viewport {
-            var engine = scene.getEngine();
-            return this._fullscreenViewport.toGlobal(engine.getRenderWidth(), engine.getRenderHeight());
-        }
-
         private _checkUpdate(camera: Camera): void {
             if (this._layerToDispose) {
                 if ((camera.layerMask & this._layerToDispose.layerMask) === 0) {
@@ -172,7 +167,8 @@ module BABYLON.GUI {
 
             if (this._isFullscreen && this._linkedControls.length) {
                 var scene = this.getScene();
-                var globalViewport = this._getGlobalViewport(scene);
+                var engine = scene.getEngine();
+                var globalViewport = this._fullscreenViewport.toGlobal(engine.getRenderWidth(), engine.getRenderHeight());
 
                 for (var control of this._linkedControls) {
                     var mesh = control._linkedMesh;

+ 0 - 7
gui/src/controls/container.ts

@@ -127,9 +127,6 @@ module BABYLON.GUI {
         }
 
         public _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void {      
-            if (!this.isVisible) {
-                return;
-            }
             context.save();
            
             this._applyStates(context);
@@ -148,10 +145,6 @@ module BABYLON.GUI {
         }
 
         public _processPicking(x: number, y: number, type: number): boolean {
-            if (!this.isHitTestVisible || !this.isVisible) {
-                return false;
-            }
-
             if (!super.contains(x, y)) {
                 return false;
             }

+ 0 - 36
gui/src/controls/control.ts

@@ -399,42 +399,6 @@ module BABYLON.GUI {
             return "Control";
         }
 
-        public getLocalCoordinates(globalCoordinates: Vector2): Vector2 {
-            var result = Vector2.Zero();
-
-            this.getLocalCoordinatesToRef(globalCoordinates, result);
-
-            return result;
-        }
-
-        public getLocalCoordinatesToRef(globalCoordinates: Vector2, result: Vector2): Control {
-            result.x = globalCoordinates.x - this._currentMeasure.left;
-            result.y = globalCoordinates.y - this._currentMeasure.top;
-            return this;
-        }
-
-        public moveToVector3(position: Vector3, scene: Scene): void {
-            if (!this._host || this._root !== this._host._rootContainer) {
-                Tools.Error("Cannot move a control to a vector3 if the control is not at root level");
-                return;
-            }
-            
-            this.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;
-            this.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
-
-            var engine = scene.getEngine();
-            var globalViewport = this._host._getGlobalViewport(scene);
-            var projectedPosition = Vector3.Project(position, Matrix.Identity(), scene.getTransformMatrix(), globalViewport);
-
-            this._moveToProjectedPosition(projectedPosition);
-
-            if (projectedPosition.z < 0 || projectedPosition.z > 1) {
-                this.isVisible = false;
-                return;
-            }
-            this.isVisible = true;
-        }
-
         public linkWithMesh(mesh: AbstractMesh): void {
             if (!this._host || this._root !== this._host._rootContainer) {
                 Tools.Error("Cannot link a control to a mesh if the control is not at root level");

+ 21 - 41
src/Bones/babylon.bone.ts

@@ -21,68 +21,50 @@ module BABYLON {
         private _parent: Bone;
 
         private _scaleMatrix = Matrix.Identity();
-        private _scaleVector = Vector3.One();
-        private _negateScaleChildren = Vector3.One();
+        private _scaleVector = new Vector3(1, 1, 1);
+        private _negateScaleChildren = new Vector3(1, 1, 1);
         private _scalingDeterminant = 1;
 
-        get _matrix(): Matrix {
+        get _matrix():Matrix{
             return this._localMatrix;
         }
 
-        set _matrix(val: Matrix) {
-            if (this._localMatrix) {
+        set _matrix(val:Matrix){
+            if(this._localMatrix){
                 this._localMatrix.copyFrom(val);
-            } else {
+            }else{
                 this._localMatrix = val;
             }
         }
-
-        constructor(public name: string, skeleton: Skeleton, parentBone: Bone = null, matrix?: Matrix, restPose?: Matrix) {
+        
+        constructor(public name: string, skeleton: Skeleton, parentBone: Bone, matrix: Matrix, restPose?: Matrix) {
             super(name, skeleton.getScene());
             this._skeleton = skeleton;
-            this._localMatrix = matrix ? matrix : Matrix.Identity();
-            this._baseMatrix = this._localMatrix.clone();
-            this._restPose = restPose ? restPose : this._localMatrix.clone();
+            this._localMatrix = matrix;
+            this._baseMatrix = matrix.clone();
+            this._restPose = restPose ? restPose : matrix.clone();
 
             skeleton.bones.push(this);
 
-            this.setParent(parentBone, false);
+            if (parentBone) {
+                this._parent = parentBone;
+                parentBone.children.push(this);
+            } else {
+                this._parent = null;
+            }
 
             this._updateDifferenceMatrix();
-        }
 
-        // Members
-        public getSkeleton(): Skeleton {
-            return this._skeleton;
+            if (this.getAbsoluteTransform().determinant() < 0) {
+                this._scalingDeterminant *= -1;
+            }
         }
 
+        // Members
         public getParent(): Bone {
             return this._parent;
         }
 
-        public setParent(parent: Bone, updateDifferenceMatrix: boolean = true): void {
-            if (this._parent === parent) {
-                return;
-            }
-
-            if (this._parent) {
-                var index = this._parent.children.indexOf(this);
-                if (index !== -1) {
-                    this._parent.children.splice(index);
-                }
-            }
-
-            this._parent = parent;
-
-            if (this._parent) {
-                this._parent.children.push(this);
-            }
-
-            if (updateDifferenceMatrix) {
-                this._updateDifferenceMatrix();
-            }
-        }
-
         public getLocalMatrix(): Matrix {
             return this._localMatrix;
         }
@@ -172,8 +154,6 @@ module BABYLON {
             for (var index = 0; index < this.children.length; index++) {
                 this.children[index]._updateDifferenceMatrix();
             }
-
-            this._scalingDeterminant = (this._absoluteTransform.determinant() < 0 ? -1 : 1);
         }
 
         public markAsDirty(): void {

+ 1 - 1
src/Collisions/babylon.collider.ts

@@ -58,7 +58,7 @@
     )();
 
     export class Collider {
-        public radius = Vector3.One();
+        public radius = new Vector3(1, 1, 1);
         public retry = 0;
         public velocity: Vector3;
         public basePoint: Vector3;

+ 1 - 1
src/Debug/babylon.debugLayer.ts

@@ -6,7 +6,7 @@ module BABYLON {
     export class DebugLayer {
         private _scene: Scene;
         // Get protocol used - http or https
-        public static InspectorURL = window.location.href.split('/')[0] + '//www.babylonjs.com/babylon.inspector.bundle.js';
+        public static InspectorURL = window.location.href.split('/')[0] + '//preview.babylonjs.com/inspector/babylon.inspector.bundle.js';
         // The inspector instance
         private _inspector: any;
 

+ 11 - 35
src/Materials/Textures/babylon.mirrorTexture.ts

@@ -10,9 +10,8 @@ module BABYLON {
 
         private _blurX: BlurPostProcess;
         private _blurY: BlurPostProcess;
-        private _blurKernelX = 0;
-        private _blurKernelY = 0;
-        private _blurRatio = 1.0;
+        private _blurKernel = 0;
+        private _blurRatio = 0.6;
 
         public set blurRatio(value: number) {
             if (this._blurRatio === value) {
@@ -28,36 +27,18 @@ module BABYLON {
         }
 
         public set blurKernel(value: number) {
-            this.blurKernelX = value;
-            this.blurKernelY = value;
-        }        
-
-        public set blurKernelX(value: number) {
-            if (this._blurKernelX === value) {
+            if (this._blurKernel === value) {
                 return;
             }
 
-            this._blurKernelX = value;
+            this._blurKernel = value;
             this._preparePostProcesses();
         }
 
-        public get blurKernelX(): number {
-            return this._blurKernelX;
+        public get blurKernel(): number {
+            return this._blurKernel;
         }        
 
-        public set blurKernelY(value: number) {
-            if (this._blurKernelY === value) {
-                return;
-            }
-
-            this._blurKernelY = value;
-            this._preparePostProcesses();
-        }
-
-        public get blurKernelY(): number {
-            return this._blurKernelY;
-        }             
-
         constructor(name: string, size: any, scene: Scene, generateMipMaps?: boolean, type: number = Engine.TEXTURETYPE_UNSIGNED_INT, samplingMode = Texture.BILINEAR_SAMPLINGMODE, generateDepthBuffer = true) {
             super(name, size, scene, generateMipMaps, true, type, false, samplingMode, generateDepthBuffer);
 
@@ -88,23 +69,18 @@ module BABYLON {
         private _preparePostProcesses(): void {
             this.clearPostProcesses(true);
 
-            if (this._blurKernelX && this._blurKernelY) {
+            if (this._blurKernel) {
                 var engine = this.getScene().getEngine();
 
                 var textureType = engine.getCaps().textureFloatRender ? Engine.TEXTURETYPE_FLOAT : Engine.TEXTURETYPE_HALF_FLOAT;
 
-                this._blurX = new BABYLON.BlurPostProcess("horizontal blur", new BABYLON.Vector2(1.0, 0), this._blurKernelX, this._blurRatio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false, textureType);
+                this._blurX = new BABYLON.BlurPostProcess("horizontal blur", new BABYLON.Vector2(1.0, 0), this._blurKernel, this._blurRatio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false, textureType);
                 this._blurX.autoClear = false;
+                this._blurX.alwaysForcePOT = false;
 
-                if (this._blurRatio === 1) {
-                    this._blurX.outputTexture = this._texture;
-                } else {
-                    this._blurX.alwaysForcePOT = true;
-                }
-
-                this._blurY = new BABYLON.BlurPostProcess("vertical blur", new BABYLON.Vector2(0, 1.0), this._blurKernelY, this._blurRatio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false, textureType);
+                this._blurY = new BABYLON.BlurPostProcess("vertical blur", new BABYLON.Vector2(0, 1.0), this._blurKernel, this._blurRatio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false, textureType);
                 this._blurY.autoClear = false;
-                this._blurY.alwaysForcePOT = this._blurRatio !== 1;
+                this._blurY.alwaysForcePOT = true;
 
                 this.addPostProcess(this._blurX);
                 this.addPostProcess(this._blurY);   

+ 5 - 20
src/Materials/Textures/babylon.texture.ts

@@ -96,6 +96,11 @@
             this._format = format;
 
             scene = this.getScene();
+            if (!url) {
+                return;
+            }
+
+            this._texture = this._getFromCache(url, noMipmap, samplingMode);
 
             let load = () => {
                 if (this._onLoadObservarble && this._onLoadObservarble.hasObservers()) {
@@ -110,14 +115,6 @@
                 }
             }
 
-            if (!url) {
-                this._delayedOnLoad = load;
-                this._delayedOnError = onError;
-                return;
-            }
-
-            this._texture = this._getFromCache(url, noMipmap, samplingMode);
-
             if (!this._texture) {
                 if (!scene.useDelayedTextureLoading) {
                     this._texture = scene.getEngine().createTexture(url, noMipmap, invertY, scene, this._samplingMode, load, onError, this._buffer, null, this._format);
@@ -139,12 +136,6 @@
             }
         }
 
-        public updateURL(url: string): void {
-            this.url = url;
-            this.delayLoadState = Engine.DELAYLOADSTATE_NOTLOADED;
-            this.delayLoad();
-        }
-
         public delayLoad(): void {
             if (this.delayLoadState !== Engine.DELAYLOADSTATE_NOTLOADED) {
                 return;
@@ -158,12 +149,6 @@
                 if (this._deleteBuffer) {
                     delete this._buffer;
                 }
-            } else {
-                if (this._texture.isReady) {
-                    Tools.SetImmediate(() => this._delayedOnLoad());
-                } else {
-                    this._texture.onLoadedCallbacks.push(this._delayedOnLoad);
-                }
             }
         }
 

+ 1 - 19
src/Math/babylon.math.ts

@@ -874,12 +874,6 @@
             return new Vector2(0, 0);
         }
         /**
-         * Returns a new Vector2(1, 1)
-         */
-        public static One(): Vector2 {
-            return new Vector2(1, 1);
-        }
-        /**
          * Returns a new Vector2 set from the passed index element of the passed array.
          */
         public static FromArray(array: ArrayLike<number>, offset: number = 0): Vector2 {
@@ -1469,18 +1463,12 @@
         }
 
         /**
-         * Returns a new Vector3 set to (0.0, 0.0, 0.0).
+         * Returns a new Vector3 set to (0.0, 0.0, 0.0).  
          */
         public static Zero(): Vector3 {
             return new Vector3(0.0, 0.0, 0.0);
         }
         /**
-         * Returns a new Vector3 set to (1.0, 1.0, 1.0).
-         */
-        public static One(): Vector3 {
-            return new Vector3(1.0, 1.0, 1.0);
-        }
-        /**
          * Returns a new Vector3 set to (0.0, 1.0, 0.0)
          */
         public static Up(): Vector3 {
@@ -2212,12 +2200,6 @@
             return new Vector4(0.0, 0.0, 0.0, 0.0);
         }
         /**
-         * Returns a new Vector4 set to (1.0, 1.0, 1.0, 1.0)
-         */
-        public static One(): Vector4 {
-            return new Vector4(1.0, 1.0, 1.0, 1.0);
-        }
-        /**
          * Returns a new normalized Vector4 from the passed one.  
          */
         public static Normalize(vector: Vector4): Vector4 {

+ 3 - 3
src/Mesh/babylon.abstractMesh.ts

@@ -114,10 +114,10 @@
 
         // Properties
         public definedFacingForward = true; // orientation for POV movement & rotation
-        public position = Vector3.Zero();
-        private _rotation = Vector3.Zero();
+        public position = new Vector3(0.0, 0.0, 0.0);
+        private _rotation = new Vector3(0.0, 0.0, 0.0);
         private _rotationQuaternion: Quaternion;
-        private _scaling = Vector3.One();
+        private _scaling = new Vector3(1.0, 1.0, 1.0);
         public billboardMode = AbstractMesh.BILLBOARDMODE_NONE;
         public visibility = 1.0;
         public alphaIndex = Number.MAX_VALUE;

+ 1 - 1
src/Mesh/babylon.meshBuilder.ts

@@ -1005,7 +1005,7 @@
             var normals = sourceMesh.getVerticesData(VertexBuffer.NormalKind);
             var position = options.position || Vector3.Zero();
             var normal = options.normal || Vector3.Up();
-            var size = options.size || Vector3.One();
+            var size = options.size || new Vector3(1, 1, 1);
             var angle = options.angle || 0;
 
             // Getting correct rotation

+ 1 - 1
src/Particles/babylon.solidParticle.ts

@@ -6,7 +6,7 @@ module BABYLON {
         public position = Vector3.Zero();               // position
         public rotation = Vector3.Zero();               // rotation
         public rotationQuaternion: Quaternion;          // quaternion, will overwrite rotation
-        public scaling = Vector3.One();                 // scaling
+        public scaling = new Vector3(1.0, 1.0, 1.0);    // scaling
         public uvs = new Vector4(0.0, 0.0, 1.0, 1.0);   // uvs
         public velocity = Vector3.Zero();               // velocity
         public alive = true;                            // alive

+ 0 - 3
src/PostProcess/babylon.postProcess.ts

@@ -268,9 +268,6 @@
                 target = this._shareOutputWithPostProcess.outputTexture;
             } else if (this._forcedOutputTexture) {
                 target = this._forcedOutputTexture;
-
-                this.width = this._forcedOutputTexture._width;
-                this.height = this._forcedOutputTexture._height;
             } else {
                 target = this.outputTexture;
             }