Browse Source

Folder reorg

David Catuhe 10 years ago
parent
commit
699045fb3f
100 changed files with 230 additions and 1556 deletions
  1. 0 605
      Babylon/Debug/babylon.debugLayer.js
  2. 0 751
      Babylon/Debug/babylon.debugLayer.ts
  3. 21 21
      Preview release - Alpha/babylon.2.2.js
  4. 45 16
      Preview release - Alpha/babylon.2.2.max.js
  5. 24 24
      Preview release - Alpha/babylon.2.2.noworker.js
  6. 1 0
      Preview release - Alpha/what's new.md
  7. 0 0
      dist/Oimo.js
  8. 0 0
      dist/babylon.2.1.d.ts
  9. 0 0
      dist/babylon.2.1.debug.js
  10. 0 0
      dist/babylon.2.1.js
  11. 0 0
      dist/babylon.2.1.noworker.js
  12. 0 0
      dist/cannon.js
  13. 0 0
      dist/poly2tri.js
  14. 0 0
      dist/previous releases/babylon.1.11.js
  15. 0 0
      dist/previous releases/babylon.1.12.js
  16. 0 0
      dist/previous releases/babylon.1.13.js
  17. 0 0
      dist/previous releases/babylon.1.14-debug.js
  18. 0 0
      dist/previous releases/babylon.1.14.d.ts
  19. 0 0
      dist/previous releases/babylon.1.14.js
  20. 0 0
      dist/previous releases/babylon.2.0.d.ts
  21. 0 0
      dist/previous releases/babylon.2.0.debug.js
  22. 0 0
      dist/previous releases/babylon.2.0.js
  23. 0 0
      external references/poly2tri.d.ts
  24. 0 0
      external references/waa.d.ts
  25. 0 0
      src/.gitignore
  26. 0 0
      src/Actions/babylon.action.js
  27. 0 0
      src/Actions/babylon.action.ts
  28. 0 0
      src/Actions/babylon.actionManager.js
  29. 0 0
      src/Actions/babylon.actionManager.ts
  30. 0 0
      src/Actions/babylon.condition.js
  31. 0 0
      src/Actions/babylon.condition.ts
  32. 0 0
      src/Actions/babylon.directActions.js
  33. 0 0
      src/Actions/babylon.directActions.ts
  34. 0 0
      src/Actions/babylon.interpolateValueAction.js
  35. 0 0
      src/Actions/babylon.interpolateValueAction.ts
  36. 0 0
      src/Animations/babylon.animatable.js
  37. 0 0
      src/Animations/babylon.animatable.ts
  38. 0 0
      src/Animations/babylon.animation.js
  39. 0 0
      src/Animations/babylon.animation.ts
  40. 0 0
      src/Animations/babylon.easing.js
  41. 0 0
      src/Animations/babylon.easing.ts
  42. 0 0
      src/Audio/babylon.analyser.js
  43. 0 0
      src/Audio/babylon.analyser.ts
  44. 0 0
      src/Audio/babylon.audioEngine.js
  45. 0 0
      src/Audio/babylon.audioEngine.ts
  46. 0 0
      src/Audio/babylon.sound.js
  47. 0 0
      src/Audio/babylon.sound.ts
  48. 0 0
      src/Audio/babylon.soundtrack.js
  49. 0 0
      src/Audio/babylon.soundtrack.ts
  50. 0 0
      src/Bones/babylon.bone.js
  51. 0 0
      src/Bones/babylon.bone.ts
  52. 0 0
      src/Bones/babylon.skeleton.js
  53. 0 0
      src/Bones/babylon.skeleton.ts
  54. 0 0
      src/Cameras/VR/babylon.vrDeviceOrientationCamera.js
  55. 0 0
      src/Cameras/VR/babylon.vrDeviceOrientationCamera.ts
  56. 0 0
      src/Cameras/VR/babylon.webVRCamera.js
  57. 0 0
      src/Cameras/VR/babylon.webVRCamera.ts
  58. 0 0
      src/Cameras/babylon.arcRotateCamera.js
  59. 0 0
      src/Cameras/babylon.arcRotateCamera.ts
  60. 0 0
      src/Cameras/babylon.camera.js
  61. 0 0
      src/Cameras/babylon.camera.ts
  62. 0 0
      src/Cameras/babylon.deviceOrientationCamera.js
  63. 0 0
      src/Cameras/babylon.deviceOrientationCamera.ts
  64. 0 0
      src/Cameras/babylon.followCamera.js
  65. 0 0
      src/Cameras/babylon.followCamera.ts
  66. 0 0
      src/Cameras/babylon.freeCamera.js
  67. 0 0
      src/Cameras/babylon.freeCamera.ts
  68. 0 0
      src/Cameras/babylon.gamepadCamera.js
  69. 0 0
      src/Cameras/babylon.gamepadCamera.ts
  70. 0 0
      src/Cameras/babylon.stereoscopicCameras.js
  71. 0 0
      src/Cameras/babylon.stereoscopicCameras.ts
  72. 0 0
      src/Cameras/babylon.targetCamera.js
  73. 0 0
      src/Cameras/babylon.targetCamera.ts
  74. 0 0
      src/Cameras/babylon.touchCamera.js
  75. 0 0
      src/Cameras/babylon.touchCamera.ts
  76. 0 0
      src/Cameras/babylon.virtualJoysticksCamera.js
  77. 0 0
      src/Cameras/babylon.virtualJoysticksCamera.ts
  78. 0 0
      src/Collisions/babylon.collider.js
  79. 0 0
      src/Collisions/babylon.collider.ts
  80. 0 0
      src/Collisions/babylon.collisionCoordinator.js
  81. 0 0
      src/Collisions/babylon.collisionCoordinator.ts
  82. 0 0
      src/Collisions/babylon.collisionWorker.js
  83. 0 0
      src/Collisions/babylon.collisionWorker.ts
  84. 0 0
      src/Collisions/babylon.pickingInfo.js
  85. 0 0
      src/Collisions/babylon.pickingInfo.ts
  86. 0 0
      src/Culling/Octrees/babylon.octree.js
  87. 0 0
      src/Culling/Octrees/babylon.octree.ts
  88. 0 0
      src/Culling/Octrees/babylon.octreeBlock.js
  89. 0 0
      src/Culling/Octrees/babylon.octreeBlock.ts
  90. 139 139
      Babylon/Culling/babylon.boundingBox.js
  91. 0 0
      src/Culling/babylon.boundingBox.ts
  92. 0 0
      src/Culling/babylon.boundingInfo.js
  93. 0 0
      src/Culling/babylon.boundingInfo.ts
  94. 0 0
      src/Culling/babylon.boundingSphere.js
  95. 0 0
      src/Culling/babylon.boundingSphere.ts
  96. 0 0
      src/Layer/babylon.layer.js
  97. 0 0
      src/Layer/babylon.layer.ts
  98. 0 0
      src/LensFlare/babylon.lensFlare.js
  99. 0 0
      src/LensFlare/babylon.lensFlare.ts
  100. 0 0
      Babylon/LensFlare/babylon.lensFlareSystem.js

+ 0 - 605
Babylon/Debug/babylon.debugLayer.js

@@ -1,605 +0,0 @@
-var BABYLON;
-(function (BABYLON) {
-    var DebugLayer = (function () {
-        function DebugLayer(scene) {
-            var _this = this;
-            this._transformationMatrix = BABYLON.Matrix.Identity();
-            this._enabled = false;
-            this._labelsEnabled = false;
-            this._displayStatistics = true;
-            this._displayTree = false;
-            this._displayLogs = false;
-            this._identityMatrix = BABYLON.Matrix.Identity();
-            this.axisRatio = 0.02;
-            this.accentColor = "orange";
-            this._scene = scene;
-            this._syncPositions = function () {
-                var engine = _this._scene.getEngine();
-                var canvasRect = engine.getRenderingCanvasClientRect();
-                if (_this._showUI) {
-                    _this._statsDiv.style.left = (canvasRect.width - 410) + "px";
-                    _this._statsDiv.style.top = (canvasRect.height - 290) + "px";
-                    _this._statsDiv.style.width = "400px";
-                    _this._statsDiv.style.height = "auto";
-                    _this._statsSubsetDiv.style.maxHeight = "240px";
-                    _this._optionsDiv.style.left = "0px";
-                    _this._optionsDiv.style.top = "10px";
-                    _this._optionsDiv.style.width = "200px";
-                    _this._optionsDiv.style.height = "auto";
-                    _this._optionsSubsetDiv.style.maxHeight = (canvasRect.height - 225) + "px";
-                    _this._logDiv.style.left = "0px";
-                    _this._logDiv.style.top = (canvasRect.height - 170) + "px";
-                    _this._logDiv.style.width = "600px";
-                    _this._logDiv.style.height = "160px";
-                    _this._treeDiv.style.left = (canvasRect.width - 310) + "px";
-                    _this._treeDiv.style.top = "10px";
-                    _this._treeDiv.style.width = "300px";
-                    _this._treeDiv.style.height = "auto";
-                    _this._treeSubsetDiv.style.maxHeight = (canvasRect.height - 340) + "px";
-                }
-                _this._globalDiv.style.left = canvasRect.left + "px";
-                _this._globalDiv.style.top = canvasRect.top + "px";
-                _this._drawingCanvas.style.left = "0px";
-                _this._drawingCanvas.style.top = "0px";
-                _this._drawingCanvas.style.width = engine.getRenderWidth() + "px";
-                _this._drawingCanvas.style.height = engine.getRenderHeight() + "px";
-                var devicePixelRatio = window.devicePixelRatio || 1;
-                var context = _this._drawingContext;
-                var backingStoreRatio = context.webkitBackingStorePixelRatio ||
-                    context.mozBackingStorePixelRatio ||
-                    context.msBackingStorePixelRatio ||
-                    context.oBackingStorePixelRatio ||
-                    context.backingStorePixelRatio || 1;
-                _this._ratio = devicePixelRatio / backingStoreRatio;
-                _this._drawingCanvas.width = engine.getRenderWidth() * _this._ratio;
-                _this._drawingCanvas.height = engine.getRenderHeight() * _this._ratio;
-            };
-            this._onCanvasClick = function (evt) {
-                _this._clickPosition = {
-                    x: evt.clientX * _this._ratio,
-                    y: evt.clientY * _this._ratio
-                };
-            };
-            this._syncUI = function () {
-                if (_this._showUI) {
-                    if (_this._displayStatistics) {
-                        _this._displayStats();
-                        _this._statsDiv.style.display = "";
-                    }
-                    else {
-                        _this._statsDiv.style.display = "none";
-                    }
-                    if (_this._displayLogs) {
-                        _this._logDiv.style.display = "";
-                    }
-                    else {
-                        _this._logDiv.style.display = "none";
-                    }
-                    if (_this._displayTree) {
-                        _this._treeDiv.style.display = "";
-                        if (_this._needToRefreshMeshesTree) {
-                            _this._needToRefreshMeshesTree = false;
-                            _this._refreshMeshesTreeContent();
-                        }
-                    }
-                    else {
-                        _this._treeDiv.style.display = "none";
-                    }
-                }
-            };
-            this._syncData = function () {
-                if (_this._labelsEnabled || !_this._showUI) {
-                    _this._camera.getViewMatrix().multiplyToRef(_this._camera.getProjectionMatrix(), _this._transformationMatrix);
-                    _this._drawingContext.clearRect(0, 0, _this._drawingCanvas.width, _this._drawingCanvas.height);
-                    var engine = _this._scene.getEngine();
-                    var viewport = _this._camera.viewport;
-                    var globalViewport = viewport.toGlobal(engine);
-                    // Meshes
-                    var meshes = _this._camera.getActiveMeshes();
-                    for (var index = 0; index < meshes.length; index++) {
-                        var mesh = meshes.data[index];
-                        var position = mesh.getBoundingInfo().boundingSphere.center;
-                        var projectedPosition = BABYLON.Vector3.Project(position, mesh.getWorldMatrix(), _this._transformationMatrix, globalViewport);
-                        if (mesh.renderOverlay || _this.shouldDisplayAxis && _this.shouldDisplayAxis(mesh)) {
-                            _this._renderAxis(projectedPosition, mesh, globalViewport);
-                        }
-                        if (!_this.shouldDisplayLabel || _this.shouldDisplayLabel(mesh)) {
-                            _this._renderLabel(mesh.name, projectedPosition, 12, function () { mesh.renderOverlay = !mesh.renderOverlay; }, function () { return mesh.renderOverlay ? 'red' : 'black'; });
-                        }
-                    }
-                    // Cameras
-                    var cameras = _this._scene.cameras;
-                    for (index = 0; index < cameras.length; index++) {
-                        var camera = cameras[index];
-                        if (camera === _this._camera) {
-                            continue;
-                        }
-                        projectedPosition = BABYLON.Vector3.Project(BABYLON.Vector3.Zero(), camera.getWorldMatrix(), _this._transformationMatrix, globalViewport);
-                        if (!_this.shouldDisplayLabel || _this.shouldDisplayLabel(camera)) {
-                            _this._renderLabel(camera.name, projectedPosition, 12, function () {
-                                _this._camera.detachControl(engine.getRenderingCanvas());
-                                _this._camera = camera;
-                                _this._camera.attachControl(engine.getRenderingCanvas());
-                            }, function () { return "purple"; });
-                        }
-                    }
-                    // Lights
-                    var lights = _this._scene.lights;
-                    for (index = 0; index < lights.length; index++) {
-                        var light = lights[index];
-                        if (light.position) {
-                            projectedPosition = BABYLON.Vector3.Project(light.getAbsolutePosition(), _this._identityMatrix, _this._transformationMatrix, globalViewport);
-                            if (!_this.shouldDisplayLabel || _this.shouldDisplayLabel(light)) {
-                                _this._renderLabel(light.name, projectedPosition, -20, function () {
-                                    light.setEnabled(!light.isEnabled());
-                                }, function () { return light.isEnabled() ? "orange" : "gray"; });
-                            }
-                        }
-                    }
-                }
-                _this._clickPosition = undefined;
-            };
-        }
-        DebugLayer.prototype._refreshMeshesTreeContent = function () {
-            while (this._treeSubsetDiv.hasChildNodes()) {
-                this._treeSubsetDiv.removeChild(this._treeSubsetDiv.lastChild);
-            }
-            // Add meshes
-            var sortedArray = this._scene.meshes.slice(0, this._scene.meshes.length);
-            sortedArray.sort(function (a, b) {
-                if (a.name === b.name) {
-                    return 0;
-                }
-                return (a.name > b.name) ? 1 : -1;
-            });
-            for (var index = 0; index < sortedArray.length; index++) {
-                var mesh = sortedArray[index];
-                if (!mesh.isEnabled()) {
-                    continue;
-                }
-                this._generateAdvancedCheckBox(this._treeSubsetDiv, mesh.name, mesh.getTotalVertices() + " verts", mesh.isVisible, function (element, m) {
-                    m.isVisible = element.checked;
-                }, mesh);
-            }
-        };
-        DebugLayer.prototype._renderSingleAxis = function (zero, unit, unitText, label, color) {
-            this._drawingContext.beginPath();
-            this._drawingContext.moveTo(zero.x, zero.y);
-            this._drawingContext.lineTo(unit.x, unit.y);
-            this._drawingContext.strokeStyle = color;
-            this._drawingContext.lineWidth = 4;
-            this._drawingContext.stroke();
-            this._drawingContext.font = "normal 14px Segoe UI";
-            this._drawingContext.fillStyle = color;
-            this._drawingContext.fillText(label, unitText.x, unitText.y);
-        };
-        DebugLayer.prototype._renderAxis = function (projectedPosition, mesh, globalViewport) {
-            var position = mesh.getBoundingInfo().boundingSphere.center;
-            var worldMatrix = mesh.getWorldMatrix();
-            var unprojectedVector = BABYLON.Vector3.UnprojectFromTransform(projectedPosition.add(new BABYLON.Vector3(this._drawingCanvas.width * this.axisRatio, 0, 0)), globalViewport.width, globalViewport.height, worldMatrix, this._transformationMatrix);
-            var unit = (unprojectedVector.subtract(position)).length();
-            var xAxis = BABYLON.Vector3.Project(position.add(new BABYLON.Vector3(unit, 0, 0)), worldMatrix, this._transformationMatrix, globalViewport);
-            var xAxisText = BABYLON.Vector3.Project(position.add(new BABYLON.Vector3(unit * 1.5, 0, 0)), worldMatrix, this._transformationMatrix, globalViewport);
-            this._renderSingleAxis(projectedPosition, xAxis, xAxisText, "x", "#FF0000");
-            var yAxis = BABYLON.Vector3.Project(position.add(new BABYLON.Vector3(0, unit, 0)), worldMatrix, this._transformationMatrix, globalViewport);
-            var yAxisText = BABYLON.Vector3.Project(position.add(new BABYLON.Vector3(0, unit * 1.5, 0)), worldMatrix, this._transformationMatrix, globalViewport);
-            this._renderSingleAxis(projectedPosition, yAxis, yAxisText, "y", "#00FF00");
-            var zAxis = BABYLON.Vector3.Project(position.add(new BABYLON.Vector3(0, 0, unit)), worldMatrix, this._transformationMatrix, globalViewport);
-            var zAxisText = BABYLON.Vector3.Project(position.add(new BABYLON.Vector3(0, 0, unit * 1.5)), worldMatrix, this._transformationMatrix, globalViewport);
-            this._renderSingleAxis(projectedPosition, zAxis, zAxisText, "z", "#0000FF");
-        };
-        DebugLayer.prototype._renderLabel = function (text, projectedPosition, labelOffset, onClick, getFillStyle) {
-            if (projectedPosition.z > 0 && projectedPosition.z < 1.0) {
-                this._drawingContext.font = "normal 12px Segoe UI";
-                var textMetrics = this._drawingContext.measureText(text);
-                var centerX = projectedPosition.x - textMetrics.width / 2;
-                var centerY = projectedPosition.y;
-                var clientRect = this._drawingCanvas.getBoundingClientRect();
-                if (this._showUI && this._isClickInsideRect(clientRect.left * this._ratio + centerX - 5, clientRect.top * this._ratio + centerY - labelOffset - 12, textMetrics.width + 10, 17)) {
-                    onClick();
-                }
-                this._drawingContext.beginPath();
-                this._drawingContext.rect(centerX - 5, centerY - labelOffset - 12, textMetrics.width + 10, 17);
-                this._drawingContext.fillStyle = getFillStyle();
-                this._drawingContext.globalAlpha = 0.5;
-                this._drawingContext.fill();
-                this._drawingContext.globalAlpha = 1.0;
-                this._drawingContext.strokeStyle = '#FFFFFF';
-                this._drawingContext.lineWidth = 1;
-                this._drawingContext.stroke();
-                this._drawingContext.fillStyle = "#FFFFFF";
-                this._drawingContext.fillText(text, centerX, centerY - labelOffset);
-                this._drawingContext.beginPath();
-                this._drawingContext.arc(projectedPosition.x, centerY, 5, 0, 2 * Math.PI, false);
-                this._drawingContext.fill();
-            }
-        };
-        DebugLayer.prototype._isClickInsideRect = function (x, y, width, height) {
-            if (!this._clickPosition) {
-                return false;
-            }
-            if (this._clickPosition.x < x || this._clickPosition.x > x + width) {
-                return false;
-            }
-            if (this._clickPosition.y < y || this._clickPosition.y > y + height) {
-                return false;
-            }
-            return true;
-        };
-        DebugLayer.prototype.isVisible = function () {
-            return this._enabled;
-        };
-        DebugLayer.prototype.hide = function () {
-            if (!this._enabled) {
-                return;
-            }
-            this._enabled = false;
-            var engine = this._scene.getEngine();
-            this._scene.unregisterBeforeRender(this._syncData);
-            this._scene.unregisterAfterRender(this._syncUI);
-            document.body.removeChild(this._globalDiv);
-            window.removeEventListener("resize", this._syncPositions);
-            this._scene.forceShowBoundingBoxes = false;
-            this._scene.forceWireframe = false;
-            BABYLON.StandardMaterial.DiffuseTextureEnabled = true;
-            BABYLON.StandardMaterial.AmbientTextureEnabled = true;
-            BABYLON.StandardMaterial.SpecularTextureEnabled = true;
-            BABYLON.StandardMaterial.EmissiveTextureEnabled = true;
-            BABYLON.StandardMaterial.BumpTextureEnabled = true;
-            BABYLON.StandardMaterial.OpacityTextureEnabled = true;
-            BABYLON.StandardMaterial.ReflectionTextureEnabled = true;
-            this._scene.shadowsEnabled = true;
-            this._scene.particlesEnabled = true;
-            this._scene.postProcessesEnabled = true;
-            this._scene.collisionsEnabled = true;
-            this._scene.lightsEnabled = true;
-            this._scene.texturesEnabled = true;
-            this._scene.lensFlaresEnabled = true;
-            this._scene.proceduralTexturesEnabled = true;
-            this._scene.renderTargetsEnabled = true;
-            engine.getRenderingCanvas().removeEventListener("click", this._onCanvasClick);
-        };
-        DebugLayer.prototype.show = function (showUI, camera) {
-            if (showUI === void 0) { showUI = true; }
-            if (camera === void 0) { camera = null; }
-            if (this._enabled) {
-                return;
-            }
-            this._enabled = true;
-            if (camera) {
-                this._camera = camera;
-            }
-            else {
-                this._camera = this._scene.activeCamera;
-            }
-            this._showUI = showUI;
-            var engine = this._scene.getEngine();
-            this._globalDiv = document.createElement("div");
-            document.body.appendChild(this._globalDiv);
-            this._generateDOMelements();
-            window.addEventListener("resize", this._syncPositions);
-            engine.getRenderingCanvas().addEventListener("click", this._onCanvasClick);
-            this._syncPositions();
-            this._scene.registerBeforeRender(this._syncData);
-            this._scene.registerAfterRender(this._syncUI);
-        };
-        DebugLayer.prototype._clearLabels = function () {
-            this._drawingContext.clearRect(0, 0, this._drawingCanvas.width, this._drawingCanvas.height);
-            for (var index = 0; index < this._scene.meshes.length; index++) {
-                var mesh = this._scene.meshes[index];
-                mesh.renderOverlay = false;
-            }
-        };
-        DebugLayer.prototype._generateheader = function (root, text) {
-            var header = document.createElement("div");
-            header.innerHTML = text + "&nbsp;";
-            header.style.textAlign = "right";
-            header.style.width = "100%";
-            header.style.color = "white";
-            header.style.backgroundColor = "Black";
-            header.style.padding = "5px 5px 4px 0px";
-            header.style.marginLeft = "-5px";
-            header.style.fontWeight = "bold";
-            root.appendChild(header);
-        };
-        DebugLayer.prototype._generateTexBox = function (root, title, color) {
-            var label = document.createElement("label");
-            label.innerHTML = title;
-            label.style.color = color;
-            root.appendChild(label);
-            root.appendChild(document.createElement("br"));
-        };
-        DebugLayer.prototype._generateAdvancedCheckBox = function (root, leftTitle, rightTitle, initialState, task, tag) {
-            if (tag === void 0) { tag = null; }
-            var label = document.createElement("label");
-            var boundingBoxesCheckbox = document.createElement("input");
-            boundingBoxesCheckbox.type = "checkbox";
-            boundingBoxesCheckbox.checked = initialState;
-            boundingBoxesCheckbox.addEventListener("change", function (evt) {
-                task(evt.target, tag);
-            });
-            label.appendChild(boundingBoxesCheckbox);
-            var container = document.createElement("span");
-            var leftPart = document.createElement("span");
-            var rightPart = document.createElement("span");
-            rightPart.style.cssFloat = "right";
-            leftPart.innerHTML = leftTitle;
-            rightPart.innerHTML = rightTitle;
-            rightPart.style.fontSize = "12px";
-            rightPart.style.maxWidth = "200px";
-            container.appendChild(leftPart);
-            container.appendChild(rightPart);
-            label.appendChild(container);
-            root.appendChild(label);
-            root.appendChild(document.createElement("br"));
-        };
-        DebugLayer.prototype._generateCheckBox = function (root, title, initialState, task, tag) {
-            if (tag === void 0) { tag = null; }
-            var label = document.createElement("label");
-            var checkBox = document.createElement("input");
-            checkBox.type = "checkbox";
-            checkBox.checked = initialState;
-            checkBox.addEventListener("change", function (evt) {
-                task(evt.target, tag);
-            });
-            label.appendChild(checkBox);
-            label.appendChild(document.createTextNode(title));
-            root.appendChild(label);
-            root.appendChild(document.createElement("br"));
-        };
-        DebugLayer.prototype._generateButton = function (root, title, task, tag) {
-            if (tag === void 0) { tag = null; }
-            var button = document.createElement("button");
-            button.innerHTML = title;
-            button.style.height = "24px";
-            button.style.color = "#444444";
-            button.style.border = "1px solid white";
-            button.className = "debugLayerButton";
-            button.addEventListener("click", function (evt) {
-                task(evt.target, tag);
-            });
-            root.appendChild(button);
-            root.appendChild(document.createElement("br"));
-        };
-        DebugLayer.prototype._generateRadio = function (root, title, name, initialState, task, tag) {
-            if (tag === void 0) { tag = null; }
-            var label = document.createElement("label");
-            var boundingBoxesRadio = document.createElement("input");
-            boundingBoxesRadio.type = "radio";
-            boundingBoxesRadio.name = name;
-            boundingBoxesRadio.checked = initialState;
-            boundingBoxesRadio.addEventListener("change", function (evt) {
-                task(evt.target, tag);
-            });
-            label.appendChild(boundingBoxesRadio);
-            label.appendChild(document.createTextNode(title));
-            root.appendChild(label);
-            root.appendChild(document.createElement("br"));
-        };
-        DebugLayer.prototype._generateDOMelements = function () {
-            var _this = this;
-            this._globalDiv.id = "DebugLayer";
-            this._globalDiv.style.position = "absolute";
-            this._globalDiv.style.fontFamily = "Segoe UI, Arial";
-            this._globalDiv.style.fontSize = "14px";
-            this._globalDiv.style.color = "white";
-            // Drawing canvas
-            this._drawingCanvas = document.createElement("canvas");
-            this._drawingCanvas.id = "DebugLayerDrawingCanvas";
-            this._drawingCanvas.style.position = "absolute";
-            this._drawingCanvas.style.pointerEvents = "none";
-            this._drawingContext = this._drawingCanvas.getContext("2d");
-            this._globalDiv.appendChild(this._drawingCanvas);
-            if (this._showUI) {
-                var background = "rgba(128, 128, 128, 0.4)";
-                var border = "rgb(180, 180, 180) solid 1px";
-                // Stats
-                this._statsDiv = document.createElement("div");
-                this._statsDiv.id = "DebugLayerStats";
-                this._statsDiv.style.border = border;
-                this._statsDiv.style.position = "absolute";
-                this._statsDiv.style.background = background;
-                this._statsDiv.style.padding = "0px 0px 0px 5px";
-                this._generateheader(this._statsDiv, "STATISTICS");
-                this._statsSubsetDiv = document.createElement("div");
-                this._statsSubsetDiv.style.paddingTop = "5px";
-                this._statsSubsetDiv.style.paddingBottom = "5px";
-                this._statsSubsetDiv.style.overflowY = "auto";
-                this._statsDiv.appendChild(this._statsSubsetDiv);
-                // Tree
-                this._treeDiv = document.createElement("div");
-                this._treeDiv.id = "DebugLayerTree";
-                this._treeDiv.style.border = border;
-                this._treeDiv.style.position = "absolute";
-                this._treeDiv.style.background = background;
-                this._treeDiv.style.padding = "0px 0px 0px 5px";
-                this._treeDiv.style.display = "none";
-                this._generateheader(this._treeDiv, "MESHES TREE");
-                this._treeSubsetDiv = document.createElement("div");
-                this._treeSubsetDiv.style.paddingTop = "5px";
-                this._treeSubsetDiv.style.paddingRight = "5px";
-                this._treeSubsetDiv.style.overflowY = "auto";
-                this._treeSubsetDiv.style.maxHeight = "300px";
-                this._treeDiv.appendChild(this._treeSubsetDiv);
-                this._needToRefreshMeshesTree = true;
-                // Logs
-                this._logDiv = document.createElement("div");
-                this._logDiv.style.border = border;
-                this._logDiv.id = "DebugLayerLogs";
-                this._logDiv.style.position = "absolute";
-                this._logDiv.style.background = background;
-                this._logDiv.style.padding = "0px 0px 0px 5px";
-                this._logDiv.style.display = "none";
-                this._generateheader(this._logDiv, "LOGS");
-                this._logSubsetDiv = document.createElement("div");
-                this._logSubsetDiv.style.height = "127px";
-                this._logSubsetDiv.style.paddingTop = "5px";
-                this._logSubsetDiv.style.overflowY = "auto";
-                this._logSubsetDiv.style.fontSize = "12px";
-                this._logSubsetDiv.style.fontFamily = "consolas";
-                this._logSubsetDiv.innerHTML = BABYLON.Tools.LogCache;
-                this._logDiv.appendChild(this._logSubsetDiv);
-                BABYLON.Tools.OnNewCacheEntry = function (entry) {
-                    _this._logSubsetDiv.innerHTML = entry + _this._logSubsetDiv.innerHTML;
-                };
-                // Options
-                this._optionsDiv = document.createElement("div");
-                this._optionsDiv.id = "DebugLayerOptions";
-                this._optionsDiv.style.border = border;
-                this._optionsDiv.style.position = "absolute";
-                this._optionsDiv.style.background = background;
-                this._optionsDiv.style.padding = "0px 0px 0px 5px";
-                this._optionsDiv.style.overflowY = "auto";
-                this._generateheader(this._optionsDiv, "OPTIONS");
-                this._optionsSubsetDiv = document.createElement("div");
-                this._optionsSubsetDiv.style.paddingTop = "5px";
-                this._optionsSubsetDiv.style.paddingBottom = "5px";
-                this._optionsSubsetDiv.style.overflowY = "auto";
-                this._optionsSubsetDiv.style.maxHeight = "200px";
-                this._optionsDiv.appendChild(this._optionsSubsetDiv);
-                this._generateTexBox(this._optionsSubsetDiv, "<b>Windows:</b>", this.accentColor);
-                this._generateCheckBox(this._optionsSubsetDiv, "Statistics", this._displayStatistics, function (element) { _this._displayStatistics = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Logs", this._displayLogs, function (element) { _this._displayLogs = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Meshes tree", this._displayTree, function (element) {
-                    _this._displayTree = element.checked;
-                    _this._needToRefreshMeshesTree = true;
-                });
-                this._optionsSubsetDiv.appendChild(document.createElement("br"));
-                this._generateTexBox(this._optionsSubsetDiv, "<b>General:</b>", this.accentColor);
-                this._generateCheckBox(this._optionsSubsetDiv, "Bounding boxes", this._scene.forceShowBoundingBoxes, function (element) { _this._scene.forceShowBoundingBoxes = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Clickable labels", this._labelsEnabled, function (element) {
-                    _this._labelsEnabled = element.checked;
-                    if (!_this._labelsEnabled) {
-                        _this._clearLabels();
-                    }
-                });
-                this._generateCheckBox(this._optionsSubsetDiv, "Generate user marks (F12)", BABYLON.Tools.PerformanceLogLevel === BABYLON.Tools.PerformanceUserMarkLogLevel, function (element) {
-                    if (element.checked) {
-                        BABYLON.Tools.PerformanceLogLevel = BABYLON.Tools.PerformanceUserMarkLogLevel;
-                    }
-                    else {
-                        BABYLON.Tools.PerformanceLogLevel = BABYLON.Tools.PerformanceNoneLogLevel;
-                    }
-                });
-                ;
-                this._optionsSubsetDiv.appendChild(document.createElement("br"));
-                this._generateTexBox(this._optionsSubsetDiv, "<b>Rendering mode:</b>", this.accentColor);
-                this._generateRadio(this._optionsSubsetDiv, "Solid", "renderMode", !this._scene.forceWireframe && !this._scene.forcePointsCloud, function (element) {
-                    if (element.checked) {
-                        _this._scene.forceWireframe = false;
-                        _this._scene.forcePointsCloud = false;
-                    }
-                });
-                this._generateRadio(this._optionsSubsetDiv, "Wireframe", "renderMode", this._scene.forceWireframe, function (element) {
-                    if (element.checked) {
-                        _this._scene.forceWireframe = true;
-                        _this._scene.forcePointsCloud = false;
-                    }
-                });
-                this._generateRadio(this._optionsSubsetDiv, "Point", "renderMode", this._scene.forcePointsCloud, function (element) {
-                    if (element.checked) {
-                        _this._scene.forceWireframe = false;
-                        _this._scene.forcePointsCloud = true;
-                    }
-                });
-                this._optionsSubsetDiv.appendChild(document.createElement("br"));
-                this._generateTexBox(this._optionsSubsetDiv, "<b>Texture channels:</b>", this.accentColor);
-                this._generateCheckBox(this._optionsSubsetDiv, "Diffuse", BABYLON.StandardMaterial.DiffuseTextureEnabled, function (element) { BABYLON.StandardMaterial.DiffuseTextureEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Ambient", BABYLON.StandardMaterial.AmbientTextureEnabled, function (element) { BABYLON.StandardMaterial.AmbientTextureEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Specular", BABYLON.StandardMaterial.SpecularTextureEnabled, function (element) { BABYLON.StandardMaterial.SpecularTextureEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Emissive", BABYLON.StandardMaterial.EmissiveTextureEnabled, function (element) { BABYLON.StandardMaterial.EmissiveTextureEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Bump", BABYLON.StandardMaterial.BumpTextureEnabled, function (element) { BABYLON.StandardMaterial.BumpTextureEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Opacity", BABYLON.StandardMaterial.OpacityTextureEnabled, function (element) { BABYLON.StandardMaterial.OpacityTextureEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Reflection", BABYLON.StandardMaterial.ReflectionTextureEnabled, function (element) { BABYLON.StandardMaterial.ReflectionTextureEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Fresnel", BABYLON.StandardMaterial.FresnelEnabled, function (element) { BABYLON.StandardMaterial.FresnelEnabled = element.checked; });
-                this._optionsSubsetDiv.appendChild(document.createElement("br"));
-                this._generateTexBox(this._optionsSubsetDiv, "<b>Options:</b>", this.accentColor);
-                this._generateCheckBox(this._optionsSubsetDiv, "Animations", this._scene.animationsEnabled, function (element) { _this._scene.animationsEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Collisions", this._scene.collisionsEnabled, function (element) { _this._scene.collisionsEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Fog", this._scene.fogEnabled, function (element) { _this._scene.fogEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Lens flares", this._scene.lensFlaresEnabled, function (element) { _this._scene.lensFlaresEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Lights", this._scene.lightsEnabled, function (element) { _this._scene.lightsEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Particles", this._scene.particlesEnabled, function (element) { _this._scene.particlesEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Post-processes", this._scene.postProcessesEnabled, function (element) { _this._scene.postProcessesEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Procedural textures", this._scene.proceduralTexturesEnabled, function (element) { _this._scene.proceduralTexturesEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Render targets", this._scene.renderTargetsEnabled, function (element) { _this._scene.renderTargetsEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Shadows", this._scene.shadowsEnabled, function (element) { _this._scene.shadowsEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Skeletons", this._scene.skeletonsEnabled, function (element) { _this._scene.skeletonsEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Sprites", this._scene.spritesEnabled, function (element) { _this._scene.spritesEnabled = element.checked; });
-                this._generateCheckBox(this._optionsSubsetDiv, "Textures", this._scene.texturesEnabled, function (element) { _this._scene.texturesEnabled = element.checked; });
-                if (BABYLON.Engine.audioEngine.canUseWebAudio) {
-                    this._optionsSubsetDiv.appendChild(document.createElement("br"));
-                    this._generateTexBox(this._optionsSubsetDiv, "<b>Audio:</b>", this.accentColor);
-                    this._generateRadio(this._optionsSubsetDiv, "Headphones", "panningModel", this._scene.headphone, function (element) {
-                        if (element.checked) {
-                            _this._scene.headphone = true;
-                        }
-                    });
-                    this._generateRadio(this._optionsSubsetDiv, "Normal Speakers", "panningModel", !this._scene.headphone, function (element) {
-                        if (element.checked) {
-                            _this._scene.headphone = false;
-                        }
-                    });
-                    this._generateCheckBox(this._optionsSubsetDiv, "Disable audio", !this._scene.audioEnabled, function (element) {
-                        _this._scene.audioEnabled = !element.checked;
-                    });
-                }
-                this._optionsSubsetDiv.appendChild(document.createElement("br"));
-                this._generateTexBox(this._optionsSubsetDiv, "<b>Tools:</b>", this.accentColor);
-                this._generateButton(this._optionsSubsetDiv, "Dump rendertargets", function (element) { _this._scene.dumpNextRenderTargets = true; });
-                this._optionsSubsetDiv.appendChild(document.createElement("br"));
-                this._globalDiv.appendChild(this._statsDiv);
-                this._globalDiv.appendChild(this._logDiv);
-                this._globalDiv.appendChild(this._optionsDiv);
-                this._globalDiv.appendChild(this._treeDiv);
-            }
-        };
-        DebugLayer.prototype._displayStats = function () {
-            var scene = this._scene;
-            var engine = scene.getEngine();
-            var glInfo = engine.getGlInfo();
-            this._statsSubsetDiv.innerHTML = "Babylon.js v" + BABYLON.Engine.Version + " - <b>" + BABYLON.Tools.Format(engine.getFps(), 0) + " fps</b><br><br>"
-                + "<div style='column-count: 2;-moz-column-count:2;-webkit-column-count:2'>"
-                + "<b>Count</b><br>"
-                + "Total meshes: " + scene.meshes.length + "<br>"
-                + "Total vertices: " + scene.getTotalVertices() + "<br>"
-                + "Total materials: " + scene.materials.length + "<br>"
-                + "Total textures: " + scene.textures.length + "<br>"
-                + "Active meshes: " + scene.getActiveMeshes().length + "<br>"
-                + "Active indices: " + scene.getActiveIndices() + "<br>"
-                + "Active bones: " + scene.getActiveBones() + "<br>"
-                + "Active particles: " + scene.getActiveParticles() + "<br>"
-                + "<b>Draw calls: " + engine.drawCalls + "</b><br><br>"
-                + "<b>Duration</b><br>"
-                + "Meshes selection:</i> " + BABYLON.Tools.Format(scene.getEvaluateActiveMeshesDuration()) + " ms<br>"
-                + "Render Targets: " + BABYLON.Tools.Format(scene.getRenderTargetsDuration()) + " ms<br>"
-                + "Particles: " + BABYLON.Tools.Format(scene.getParticlesDuration()) + " ms<br>"
-                + "Sprites: " + BABYLON.Tools.Format(scene.getSpritesDuration()) + " ms<br><br>"
-                + "Render: <b>" + BABYLON.Tools.Format(scene.getRenderDuration()) + " ms</b><br>"
-                + "Frame: " + BABYLON.Tools.Format(scene.getLastFrameDuration()) + " ms<br>"
-                + "Potential FPS: " + BABYLON.Tools.Format(1000.0 / scene.getLastFrameDuration(), 0) + "<br><br>"
-                + "</div>"
-                + "<div style='column-count: 2;-moz-column-count:2;-webkit-column-count:2'>"
-                + "<b>Extensions</b><br>"
-                + "Std derivatives: " + (engine.getCaps().standardDerivatives ? "Yes" : "No") + "<br>"
-                + "Compressed textures: " + (engine.getCaps().s3tc ? "Yes" : "No") + "<br>"
-                + "Hardware instances: " + (engine.getCaps().instancedArrays ? "Yes" : "No") + "<br>"
-                + "Texture float: " + (engine.getCaps().textureFloat ? "Yes" : "No") + "<br>"
-                + "32bits indices: " + (engine.getCaps().uintIndices ? "Yes" : "No") + "<br>"
-                + "<b>Caps.</b><br>"
-                + "Max textures units: " + engine.getCaps().maxTexturesImageUnits + "<br>"
-                + "Max textures size: " + engine.getCaps().maxTextureSize + "<br>"
-                + "Max anisotropy: " + engine.getCaps().maxAnisotropy + "<br><br><br>"
-                + "</div><br>"
-                + "<b>Info</b><br>"
-                + glInfo.version + "<br>"
-                + glInfo.renderer + "<br>";
-            if (this.customStatsFunction) {
-                this._statsSubsetDiv.innerHTML += this._statsSubsetDiv.innerHTML;
-            }
-        };
-        return DebugLayer;
-    })();
-    BABYLON.DebugLayer = DebugLayer;
-})(BABYLON || (BABYLON = {}));
-//# sourceMappingURL=babylon.debugLayer.js.map

+ 0 - 751
Babylon/Debug/babylon.debugLayer.ts

@@ -1,751 +0,0 @@
-module BABYLON {
-    export class DebugLayer {
-        private _scene: Scene;
-        private _camera: Camera;
-        private _transformationMatrix = Matrix.Identity();
-        private _enabled: boolean = false;
-        private _labelsEnabled: boolean = false;
-        private _displayStatistics = true;
-        private _displayTree = false;
-        private _displayLogs = false;
-        private _globalDiv: HTMLDivElement;
-        private _statsDiv: HTMLDivElement;
-        private _statsSubsetDiv: HTMLDivElement;
-        private _optionsDiv: HTMLDivElement;
-        private _optionsSubsetDiv: HTMLDivElement;
-        private _logDiv: HTMLDivElement;
-        private _logSubsetDiv: HTMLDivElement;
-        private _treeDiv: HTMLDivElement;
-        private _treeSubsetDiv: HTMLDivElement;
-        private _drawingCanvas: HTMLCanvasElement;
-        private _drawingContext: CanvasRenderingContext2D;
-
-        private _syncPositions: () => void;
-        private _syncData: () => void;
-        private _syncUI: () => void;
-        private _onCanvasClick: (evt: MouseEvent) => void;
-
-        private _clickPosition: any;
-        private _ratio: number;
-
-        private _identityMatrix = Matrix.Identity();
-
-        private _showUI: boolean;
-        private _needToRefreshMeshesTree: boolean;
-
-        public shouldDisplayLabel: (node: Node) => boolean;
-        public shouldDisplayAxis: (mesh: Mesh) => boolean;
-
-        public axisRatio = 0.02;
-
-        public accentColor = "orange";
-
-        public customStatsFunction: () => string;
-
-        constructor(scene: Scene) {
-            this._scene = scene;
-
-            this._syncPositions = (): void => {
-                var engine = this._scene.getEngine();
-                var canvasRect = engine.getRenderingCanvasClientRect();
-
-                if (this._showUI) {
-                    this._statsDiv.style.left = (canvasRect.width - 410) + "px";
-                    this._statsDiv.style.top = (canvasRect.height - 290) + "px";
-                    this._statsDiv.style.width = "400px";
-                    this._statsDiv.style.height = "auto";
-                    this._statsSubsetDiv.style.maxHeight = "240px";
-
-                    this._optionsDiv.style.left = "0px";
-                    this._optionsDiv.style.top = "10px";
-                    this._optionsDiv.style.width = "200px";
-                    this._optionsDiv.style.height = "auto";
-                    this._optionsSubsetDiv.style.maxHeight = (canvasRect.height - 225) + "px";
-
-                    this._logDiv.style.left = "0px";
-                    this._logDiv.style.top = (canvasRect.height - 170) + "px";
-                    this._logDiv.style.width = "600px";
-                    this._logDiv.style.height = "160px";
-
-                    this._treeDiv.style.left = (canvasRect.width - 310) + "px";
-                    this._treeDiv.style.top = "10px";
-                    this._treeDiv.style.width = "300px";
-                    this._treeDiv.style.height = "auto";
-                    this._treeSubsetDiv.style.maxHeight = (canvasRect.height - 340) + "px";
-                }
-
-                this._globalDiv.style.left = canvasRect.left + "px";
-                this._globalDiv.style.top = canvasRect.top + "px";
-
-                this._drawingCanvas.style.left = "0px";
-                this._drawingCanvas.style.top = "0px";
-                this._drawingCanvas.style.width = engine.getRenderWidth() + "px";
-                this._drawingCanvas.style.height = engine.getRenderHeight() + "px";
-
-                var devicePixelRatio = window.devicePixelRatio || 1;
-                var context = <any>this._drawingContext;
-                var backingStoreRatio = context.webkitBackingStorePixelRatio ||
-                    context.mozBackingStorePixelRatio ||
-                    context.msBackingStorePixelRatio ||
-                    context.oBackingStorePixelRatio ||
-                    context.backingStorePixelRatio || 1;
-
-                this._ratio = devicePixelRatio / backingStoreRatio;
-
-                this._drawingCanvas.width = engine.getRenderWidth() * this._ratio;
-                this._drawingCanvas.height = engine.getRenderHeight() * this._ratio;
-            }
-
-            this._onCanvasClick = (evt: MouseEvent): void => {
-                this._clickPosition = {
-                    x: evt.clientX * this._ratio,
-                    y: evt.clientY * this._ratio
-                };
-            }
-
-            this._syncUI = (): void => {
-                if (this._showUI) {
-                    if (this._displayStatistics) {
-                        this._displayStats();
-                        this._statsDiv.style.display = "";
-                    } else {
-                        this._statsDiv.style.display = "none";
-                    }
-
-                    if (this._displayLogs) {
-                        this._logDiv.style.display = "";
-                    } else {
-                        this._logDiv.style.display = "none";
-                    }
-
-                    if (this._displayTree) {
-                        this._treeDiv.style.display = "";
-
-                        if (this._needToRefreshMeshesTree) {
-                            this._needToRefreshMeshesTree = false;
-
-                            this._refreshMeshesTreeContent();
-                        }
-
-                    } else {
-                        this._treeDiv.style.display = "none";
-                    }
-                }
-            }
-
-            this._syncData = (): void => {
-                if (this._labelsEnabled || !this._showUI) {
-
-                    this._camera.getViewMatrix().multiplyToRef(this._camera.getProjectionMatrix(), this._transformationMatrix);
-
-                    this._drawingContext.clearRect(0, 0, this._drawingCanvas.width, this._drawingCanvas.height);
-
-                    var engine = this._scene.getEngine();
-                    var viewport = this._camera.viewport;
-                    var globalViewport = viewport.toGlobal(engine);
-
-                    // Meshes
-                    var meshes = this._camera.getActiveMeshes();
-                    for (var index = 0; index < meshes.length; index++) {
-                        var mesh = meshes.data[index];
-
-                        var position = mesh.getBoundingInfo().boundingSphere.center;
-
-                        var projectedPosition = Vector3.Project(position, mesh.getWorldMatrix(), this._transformationMatrix, globalViewport);
-
-                        if (mesh.renderOverlay || this.shouldDisplayAxis && this.shouldDisplayAxis(mesh)) {
-                            this._renderAxis(projectedPosition, mesh, globalViewport);
-                        }
-
-                        if (!this.shouldDisplayLabel || this.shouldDisplayLabel(mesh)) {
-                            this._renderLabel(mesh.name, projectedPosition, 12,
-                                () => { mesh.renderOverlay = !mesh.renderOverlay },
-                                () => { return mesh.renderOverlay ? 'red' : 'black'; });
-                        }
-                    }
-
-                    // Cameras
-                    var cameras = this._scene.cameras;
-                    for (index = 0; index < cameras.length; index++) {
-                        var camera = cameras[index];
-
-                        if (camera === this._camera) {
-                            continue;
-                        }
-
-                        projectedPosition = Vector3.Project(Vector3.Zero(), camera.getWorldMatrix(), this._transformationMatrix, globalViewport);
-
-                        if (!this.shouldDisplayLabel || this.shouldDisplayLabel(camera)) {
-                            this._renderLabel(camera.name, projectedPosition, 12,
-                                () => {
-                                    this._camera.detachControl(engine.getRenderingCanvas());
-                                    this._camera = camera;
-                                    this._camera.attachControl(engine.getRenderingCanvas());
-                                },
-                                () => { return "purple"; });
-                        }
-                    }
-
-                    // Lights
-                    var lights = this._scene.lights;
-                    for (index = 0; index < lights.length; index++) {
-                        var light = <any>lights[index];
-
-                        if (light.position) {
-
-                            projectedPosition = Vector3.Project(light.getAbsolutePosition(), this._identityMatrix, this._transformationMatrix, globalViewport);
-
-                            if (!this.shouldDisplayLabel || this.shouldDisplayLabel(light)) {
-                                this._renderLabel(light.name, projectedPosition, -20,
-                                    () => {
-                                        light.setEnabled(!light.isEnabled());
-                                    },
-                                    () => { return light.isEnabled() ? "orange" : "gray"; });
-                            }
-
-                        }
-                    }
-                }
-
-                this._clickPosition = undefined;
-            }
-        }
-
-        private _refreshMeshesTreeContent(): void {
-            while (this._treeSubsetDiv.hasChildNodes()) {
-                this._treeSubsetDiv.removeChild(this._treeSubsetDiv.lastChild);
-            }
-
-            // Add meshes
-            var sortedArray = this._scene.meshes.slice(0, this._scene.meshes.length);
-
-            sortedArray.sort((a, b) => {
-                if (a.name === b.name) {
-                    return 0;
-                }
-
-                return (a.name > b.name) ? 1 : -1;
-            });
-
-            for (var index = 0; index < sortedArray.length; index++) {
-                var mesh = sortedArray[index];
-
-                if (!mesh.isEnabled()) {
-                    continue;
-                }
-
-                this._generateAdvancedCheckBox(this._treeSubsetDiv, mesh.name, mesh.getTotalVertices() + " verts", mesh.isVisible, (element, m) => {
-                    m.isVisible = element.checked;
-                }, mesh);
-            }
-        }
-
-        private _renderSingleAxis(zero: Vector3, unit: Vector3, unitText: Vector3, label: string, color: string) {
-            this._drawingContext.beginPath();
-            this._drawingContext.moveTo(zero.x, zero.y);
-            this._drawingContext.lineTo(unit.x, unit.y);
-
-            this._drawingContext.strokeStyle = color;
-            this._drawingContext.lineWidth = 4;
-            this._drawingContext.stroke();
-
-            this._drawingContext.font = "normal 14px Segoe UI";
-            this._drawingContext.fillStyle = color;
-            this._drawingContext.fillText(label, unitText.x, unitText.y);
-        }
-
-        private _renderAxis(projectedPosition: Vector3, mesh: Mesh, globalViewport: Viewport) {
-            var position = mesh.getBoundingInfo().boundingSphere.center;
-            var worldMatrix = mesh.getWorldMatrix();
-
-            var unprojectedVector = Vector3.UnprojectFromTransform(projectedPosition.add(new Vector3(this._drawingCanvas.width * this.axisRatio, 0, 0)), globalViewport.width, globalViewport.height, worldMatrix, this._transformationMatrix);
-            var unit = (unprojectedVector.subtract(position)).length();
-
-            var xAxis = Vector3.Project(position.add(new Vector3(unit, 0, 0)), worldMatrix, this._transformationMatrix, globalViewport);
-            var xAxisText = Vector3.Project(position.add(new Vector3(unit * 1.5, 0, 0)), worldMatrix, this._transformationMatrix, globalViewport);
-
-            this._renderSingleAxis(projectedPosition, xAxis, xAxisText, "x", "#FF0000");
-
-            var yAxis = Vector3.Project(position.add(new Vector3(0, unit, 0)), worldMatrix, this._transformationMatrix, globalViewport);
-            var yAxisText = Vector3.Project(position.add(new Vector3(0, unit * 1.5, 0)), worldMatrix, this._transformationMatrix, globalViewport);
-
-            this._renderSingleAxis(projectedPosition, yAxis, yAxisText, "y", "#00FF00");
-
-            var zAxis = Vector3.Project(position.add(new Vector3(0, 0, unit)), worldMatrix, this._transformationMatrix, globalViewport);
-            var zAxisText = Vector3.Project(position.add(new Vector3(0, 0, unit * 1.5)), worldMatrix, this._transformationMatrix, globalViewport);
-
-            this._renderSingleAxis(projectedPosition, zAxis, zAxisText, "z", "#0000FF");
-        }
-
-        private _renderLabel(text: string, projectedPosition: Vector3, labelOffset: number, onClick: () => void, getFillStyle: () => string): void {
-            if (projectedPosition.z > 0 && projectedPosition.z < 1.0) {
-                this._drawingContext.font = "normal 12px Segoe UI";
-                var textMetrics = this._drawingContext.measureText(text);
-                var centerX = projectedPosition.x - textMetrics.width / 2;
-                var centerY = projectedPosition.y;
-                var clientRect = this._drawingCanvas.getBoundingClientRect();
-
-                if (this._showUI && this._isClickInsideRect(clientRect.left * this._ratio + centerX - 5, clientRect.top * this._ratio + centerY - labelOffset - 12, textMetrics.width + 10, 17)) {
-                    onClick();
-                }
-
-                this._drawingContext.beginPath();
-                this._drawingContext.rect(centerX - 5, centerY - labelOffset - 12, textMetrics.width + 10, 17);
-                this._drawingContext.fillStyle = getFillStyle();
-                this._drawingContext.globalAlpha = 0.5;
-                this._drawingContext.fill();
-                this._drawingContext.globalAlpha = 1.0;
-
-                this._drawingContext.strokeStyle = '#FFFFFF';
-                this._drawingContext.lineWidth = 1;
-                this._drawingContext.stroke();
-
-                this._drawingContext.fillStyle = "#FFFFFF";
-                this._drawingContext.fillText(text, centerX, centerY - labelOffset);
-
-                this._drawingContext.beginPath();
-                this._drawingContext.arc(projectedPosition.x, centerY, 5, 0, 2 * Math.PI, false);
-                this._drawingContext.fill();
-            }
-        }
-
-        private _isClickInsideRect(x: number, y: number, width: number, height: number): boolean {
-            if (!this._clickPosition) {
-                return false;
-            }
-
-            if (this._clickPosition.x < x || this._clickPosition.x > x + width) {
-                return false;
-            }
-
-            if (this._clickPosition.y < y || this._clickPosition.y > y + height) {
-                return false;
-            }
-
-            return true;
-        }
-
-        public isVisible(): boolean {
-            return this._enabled;
-        }
-
-        public hide() {
-            if (!this._enabled) {
-                return;
-            }
-
-            this._enabled = false;
-
-            var engine = this._scene.getEngine();
-
-            this._scene.unregisterBeforeRender(this._syncData);
-            this._scene.unregisterAfterRender(this._syncUI);
-            document.body.removeChild(this._globalDiv);
-
-            window.removeEventListener("resize", this._syncPositions);
-
-            this._scene.forceShowBoundingBoxes = false;
-            this._scene.forceWireframe = false;
-
-            StandardMaterial.DiffuseTextureEnabled = true;
-            StandardMaterial.AmbientTextureEnabled = true;
-            StandardMaterial.SpecularTextureEnabled = true;
-            StandardMaterial.EmissiveTextureEnabled = true;
-            StandardMaterial.BumpTextureEnabled = true;
-            StandardMaterial.OpacityTextureEnabled = true;
-            StandardMaterial.ReflectionTextureEnabled = true;
-
-            this._scene.shadowsEnabled = true;
-            this._scene.particlesEnabled = true;
-            this._scene.postProcessesEnabled = true;
-            this._scene.collisionsEnabled = true;
-            this._scene.lightsEnabled = true;
-            this._scene.texturesEnabled = true;
-            this._scene.lensFlaresEnabled = true;
-            this._scene.proceduralTexturesEnabled = true;
-            this._scene.renderTargetsEnabled = true;
-
-            engine.getRenderingCanvas().removeEventListener("click", this._onCanvasClick);
-        }
-
-        public show(showUI: boolean = true, camera: Camera = null) {
-            if (this._enabled) {
-                return;
-            }
-
-            this._enabled = true;
-
-            if (camera) {
-                this._camera = camera;
-            } else {
-                this._camera = this._scene.activeCamera;
-            }
-
-            this._showUI = showUI;
-
-            var engine = this._scene.getEngine();
-
-            this._globalDiv = document.createElement("div");
-
-            document.body.appendChild(this._globalDiv);
-
-            this._generateDOMelements();
-
-            window.addEventListener("resize", this._syncPositions);
-            engine.getRenderingCanvas().addEventListener("click", this._onCanvasClick);
-
-            this._syncPositions();
-            this._scene.registerBeforeRender(this._syncData);
-            this._scene.registerAfterRender(this._syncUI);
-        }
-
-        private _clearLabels(): void {
-            this._drawingContext.clearRect(0, 0, this._drawingCanvas.width, this._drawingCanvas.height);
-
-            for (var index = 0; index < this._scene.meshes.length; index++) {
-                var mesh = this._scene.meshes[index];
-                mesh.renderOverlay = false;
-            }
-        }
-
-        private _generateheader(root: HTMLDivElement, text: string): void {
-            var header = document.createElement("div");
-            header.innerHTML = text + "&nbsp;";
-
-            header.style.textAlign = "right";
-            header.style.width = "100%";
-            header.style.color = "white";
-            header.style.backgroundColor = "Black";
-            header.style.padding = "5px 5px 4px 0px";
-            header.style.marginLeft = "-5px";
-            header.style.fontWeight = "bold";
-
-            root.appendChild(header);
-        }
-
-        private _generateTexBox(root: HTMLDivElement, title: string, color: string): void {
-            var label = document.createElement("label");
-            label.innerHTML = title;
-            label.style.color = color;
-
-            root.appendChild(label);
-            root.appendChild(document.createElement("br"));
-        }
-
-        private _generateAdvancedCheckBox(root: HTMLDivElement, leftTitle: string, rightTitle: string, initialState: boolean, task: (element, tag) => void, tag: any = null): void {
-            var label = document.createElement("label");
-
-            var boundingBoxesCheckbox = document.createElement("input");
-            boundingBoxesCheckbox.type = "checkbox";
-            boundingBoxesCheckbox.checked = initialState;
-
-            boundingBoxesCheckbox.addEventListener("change", (evt: Event) => {
-                task(evt.target, tag);
-            });
-
-            label.appendChild(boundingBoxesCheckbox);
-            var container = document.createElement("span");
-            var leftPart = document.createElement("span");
-            var rightPart = document.createElement("span");
-
-            rightPart.style.cssFloat = "right";
-
-            leftPart.innerHTML = leftTitle;
-            rightPart.innerHTML = rightTitle;
-            rightPart.style.fontSize = "12px";
-            rightPart.style.maxWidth = "200px";
-
-            container.appendChild(leftPart);
-            container.appendChild(rightPart);
-
-            label.appendChild(container);
-            root.appendChild(label);
-            root.appendChild(document.createElement("br"));
-        }
-
-        private _generateCheckBox(root: HTMLDivElement, title: string, initialState: boolean, task: (element, tag) => void, tag: any = null): void {
-            var label = document.createElement("label");
-
-            var checkBox = document.createElement("input");
-            checkBox.type = "checkbox";
-            checkBox.checked = initialState;
-
-            checkBox.addEventListener("change", (evt: Event) => {
-                task(evt.target, tag);
-            });
-
-            label.appendChild(checkBox);
-            label.appendChild(document.createTextNode(title));
-            root.appendChild(label);
-            root.appendChild(document.createElement("br"));
-        }
-
-        private _generateButton(root: HTMLDivElement, title: string, task: (element, tag) => void, tag: any = null): void {
-            var button = document.createElement("button");
-            button.innerHTML = title;
-            button.style.height = "24px";
-            button.style.color = "#444444";
-            button.style.border = "1px solid white"; 
-            button.className = "debugLayerButton";
-
-            button.addEventListener("click",(evt: Event) => {
-                task(evt.target, tag);
-            });
-
-            root.appendChild(button);
-            root.appendChild(document.createElement("br"));
-        }
-
-        private _generateRadio(root: HTMLDivElement, title: string, name: string, initialState: boolean, task: (element, tag) => void, tag: any = null): void {
-            var label = document.createElement("label");
-
-            var boundingBoxesRadio = document.createElement("input");
-            boundingBoxesRadio.type = "radio";
-            boundingBoxesRadio.name = name;
-            boundingBoxesRadio.checked = initialState;
-
-            boundingBoxesRadio.addEventListener("change", (evt: Event) => {
-                task(evt.target, tag);
-            });
-
-            label.appendChild(boundingBoxesRadio);
-            label.appendChild(document.createTextNode(title));
-            root.appendChild(label);
-            root.appendChild(document.createElement("br"));
-        }
-
-        private _generateDOMelements(): void {
-            this._globalDiv.id = "DebugLayer";
-            this._globalDiv.style.position = "absolute";
-
-            this._globalDiv.style.fontFamily = "Segoe UI, Arial";
-            this._globalDiv.style.fontSize = "14px";
-            this._globalDiv.style.color = "white";
-
-            // Drawing canvas
-            this._drawingCanvas = document.createElement("canvas");
-            this._drawingCanvas.id = "DebugLayerDrawingCanvas";
-            this._drawingCanvas.style.position = "absolute";
-            this._drawingCanvas.style.pointerEvents = "none";
-            this._drawingContext = this._drawingCanvas.getContext("2d");
-            this._globalDiv.appendChild(this._drawingCanvas);
-
-            if (this._showUI) {
-                var background = "rgba(128, 128, 128, 0.4)";
-                var border = "rgb(180, 180, 180) solid 1px";
-
-                // Stats
-                this._statsDiv = document.createElement("div");
-                this._statsDiv.id = "DebugLayerStats";
-                this._statsDiv.style.border = border;
-                this._statsDiv.style.position = "absolute";
-                this._statsDiv.style.background = background;
-                this._statsDiv.style.padding = "0px 0px 0px 5px";
-                this._generateheader(this._statsDiv, "STATISTICS");
-                this._statsSubsetDiv = document.createElement("div");
-                this._statsSubsetDiv.style.paddingTop = "5px";
-                this._statsSubsetDiv.style.paddingBottom = "5px";
-                this._statsSubsetDiv.style.overflowY = "auto";
-                this._statsDiv.appendChild(this._statsSubsetDiv);
-
-                // Tree
-                this._treeDiv = document.createElement("div");
-                this._treeDiv.id = "DebugLayerTree";
-                this._treeDiv.style.border = border;
-                this._treeDiv.style.position = "absolute";
-                this._treeDiv.style.background = background;
-                this._treeDiv.style.padding = "0px 0px 0px 5px";
-                this._treeDiv.style.display = "none";
-                this._generateheader(this._treeDiv, "MESHES TREE");
-                this._treeSubsetDiv = document.createElement("div");
-                this._treeSubsetDiv.style.paddingTop = "5px";
-                this._treeSubsetDiv.style.paddingRight = "5px";
-                this._treeSubsetDiv.style.overflowY = "auto";
-                this._treeSubsetDiv.style.maxHeight = "300px";
-                this._treeDiv.appendChild(this._treeSubsetDiv);
-                this._needToRefreshMeshesTree = true;
-
-                // Logs
-                this._logDiv = document.createElement("div");
-                this._logDiv.style.border = border;
-                this._logDiv.id = "DebugLayerLogs";
-                this._logDiv.style.position = "absolute";
-                this._logDiv.style.background = background;
-                this._logDiv.style.padding = "0px 0px 0px 5px";
-                this._logDiv.style.display = "none";
-                this._generateheader(this._logDiv, "LOGS");
-                this._logSubsetDiv = document.createElement("div");
-                this._logSubsetDiv.style.height = "127px";
-                this._logSubsetDiv.style.paddingTop = "5px";
-                this._logSubsetDiv.style.overflowY = "auto";
-                this._logSubsetDiv.style.fontSize = "12px";
-                this._logSubsetDiv.style.fontFamily = "consolas";
-                this._logSubsetDiv.innerHTML = Tools.LogCache;
-                this._logDiv.appendChild(this._logSubsetDiv);
-                Tools.OnNewCacheEntry = (entry: string) => {
-                    this._logSubsetDiv.innerHTML = entry + this._logSubsetDiv.innerHTML;
-                }
-
-                // Options
-                this._optionsDiv = document.createElement("div");
-                this._optionsDiv.id = "DebugLayerOptions";
-                this._optionsDiv.style.border = border;
-                this._optionsDiv.style.position = "absolute";
-                this._optionsDiv.style.background = background;
-                this._optionsDiv.style.padding = "0px 0px 0px 5px";
-                this._optionsDiv.style.overflowY = "auto";
-                this._generateheader(this._optionsDiv, "OPTIONS");
-                this._optionsSubsetDiv = document.createElement("div");
-                this._optionsSubsetDiv.style.paddingTop = "5px";
-                this._optionsSubsetDiv.style.paddingBottom = "5px";
-                this._optionsSubsetDiv.style.overflowY = "auto";
-                this._optionsSubsetDiv.style.maxHeight = "200px";
-                this._optionsDiv.appendChild(this._optionsSubsetDiv);
-
-                this._generateTexBox(this._optionsSubsetDiv, "<b>Windows:</b>", this.accentColor);
-                this._generateCheckBox(this._optionsSubsetDiv, "Statistics", this._displayStatistics, (element) => { this._displayStatistics = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Logs", this._displayLogs, (element) => { this._displayLogs = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Meshes tree", this._displayTree, (element) => {
-                    this._displayTree = element.checked;
-                    this._needToRefreshMeshesTree = true;
-                });
-                this._optionsSubsetDiv.appendChild(document.createElement("br"));
-                this._generateTexBox(this._optionsSubsetDiv, "<b>General:</b>", this.accentColor);
-                this._generateCheckBox(this._optionsSubsetDiv, "Bounding boxes", this._scene.forceShowBoundingBoxes, (element) => { this._scene.forceShowBoundingBoxes = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Clickable labels", this._labelsEnabled, (element) => {
-                    this._labelsEnabled = element.checked;
-                    if (!this._labelsEnabled) {
-                        this._clearLabels();
-                    }
-                });
-                this._generateCheckBox(this._optionsSubsetDiv, "Generate user marks (F12)", Tools.PerformanceLogLevel === Tools.PerformanceUserMarkLogLevel,
-                    (element) => {
-                        if (element.checked) {
-                            Tools.PerformanceLogLevel = Tools.PerformanceUserMarkLogLevel;
-                        } else {
-                            Tools.PerformanceLogLevel = Tools.PerformanceNoneLogLevel;
-                        }
-                    });
-                ;
-                this._optionsSubsetDiv.appendChild(document.createElement("br"));
-                this._generateTexBox(this._optionsSubsetDiv, "<b>Rendering mode:</b>", this.accentColor);
-                this._generateRadio(this._optionsSubsetDiv, "Solid", "renderMode", !this._scene.forceWireframe && !this._scene.forcePointsCloud, (element) => {
-                    if (element.checked) {
-                        this._scene.forceWireframe = false;
-                        this._scene.forcePointsCloud = false;
-                    }
-                });
-                this._generateRadio(this._optionsSubsetDiv, "Wireframe", "renderMode", this._scene.forceWireframe, (element) => {
-                    if (element.checked) {
-                        this._scene.forceWireframe = true;
-                        this._scene.forcePointsCloud = false;
-                    }
-                });
-                this._generateRadio(this._optionsSubsetDiv, "Point", "renderMode", this._scene.forcePointsCloud, (element) => {
-                    if (element.checked) {
-                        this._scene.forceWireframe = false;
-                        this._scene.forcePointsCloud = true;
-                    }
-                });
-                this._optionsSubsetDiv.appendChild(document.createElement("br"));
-                this._generateTexBox(this._optionsSubsetDiv, "<b>Texture channels:</b>", this.accentColor);
-                this._generateCheckBox(this._optionsSubsetDiv, "Diffuse", StandardMaterial.DiffuseTextureEnabled, (element) => { StandardMaterial.DiffuseTextureEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Ambient", StandardMaterial.AmbientTextureEnabled, (element) => { StandardMaterial.AmbientTextureEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Specular", StandardMaterial.SpecularTextureEnabled, (element) => { StandardMaterial.SpecularTextureEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Emissive", StandardMaterial.EmissiveTextureEnabled, (element) => { StandardMaterial.EmissiveTextureEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Bump", StandardMaterial.BumpTextureEnabled, (element) => { StandardMaterial.BumpTextureEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Opacity", StandardMaterial.OpacityTextureEnabled, (element) => { StandardMaterial.OpacityTextureEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Reflection", StandardMaterial.ReflectionTextureEnabled, (element) => { StandardMaterial.ReflectionTextureEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Fresnel", StandardMaterial.FresnelEnabled, (element) => { StandardMaterial.FresnelEnabled = element.checked });
-                this._optionsSubsetDiv.appendChild(document.createElement("br"));
-                this._generateTexBox(this._optionsSubsetDiv, "<b>Options:</b>", this.accentColor);
-                this._generateCheckBox(this._optionsSubsetDiv, "Animations", this._scene.animationsEnabled, (element) => { this._scene.animationsEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Collisions", this._scene.collisionsEnabled, (element) => { this._scene.collisionsEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Fog", this._scene.fogEnabled, (element) => { this._scene.fogEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Lens flares", this._scene.lensFlaresEnabled, (element) => { this._scene.lensFlaresEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Lights", this._scene.lightsEnabled, (element) => { this._scene.lightsEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Particles", this._scene.particlesEnabled, (element) => { this._scene.particlesEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Post-processes", this._scene.postProcessesEnabled, (element) => { this._scene.postProcessesEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Procedural textures", this._scene.proceduralTexturesEnabled, (element) => { this._scene.proceduralTexturesEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Render targets", this._scene.renderTargetsEnabled, (element) => { this._scene.renderTargetsEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Shadows", this._scene.shadowsEnabled, (element) => { this._scene.shadowsEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Skeletons", this._scene.skeletonsEnabled, (element) => { this._scene.skeletonsEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Sprites", this._scene.spritesEnabled, (element) => { this._scene.spritesEnabled = element.checked });
-                this._generateCheckBox(this._optionsSubsetDiv, "Textures", this._scene.texturesEnabled, (element) => { this._scene.texturesEnabled = element.checked });
-                if (Engine.audioEngine.canUseWebAudio) {
-                    this._optionsSubsetDiv.appendChild(document.createElement("br"));
-                    this._generateTexBox(this._optionsSubsetDiv, "<b>Audio:</b>", this.accentColor);
-                    this._generateRadio(this._optionsSubsetDiv, "Headphones", "panningModel", this._scene.headphone, (element) => {
-                        if (element.checked) {
-                            this._scene.headphone = true;
-                        }
-                    });
-                    this._generateRadio(this._optionsSubsetDiv, "Normal Speakers", "panningModel", !this._scene.headphone, (element) => {
-                        if (element.checked) {
-                            this._scene.headphone = false;
-                        }
-                    });
-                    this._generateCheckBox(this._optionsSubsetDiv, "Disable audio", !this._scene.audioEnabled, (element) => {
-                        this._scene.audioEnabled = !element.checked;
-                    });
-                }
-                this._optionsSubsetDiv.appendChild(document.createElement("br"));
-                this._generateTexBox(this._optionsSubsetDiv, "<b>Tools:</b>", this.accentColor);
-                this._generateButton(this._optionsSubsetDiv, "Dump rendertargets", (element) => { this._scene.dumpNextRenderTargets = true; });
-                this._optionsSubsetDiv.appendChild(document.createElement("br"));
-  
-                this._globalDiv.appendChild(this._statsDiv);
-                this._globalDiv.appendChild(this._logDiv);
-                this._globalDiv.appendChild(this._optionsDiv);
-                this._globalDiv.appendChild(this._treeDiv);
-            }
-        }
-
-        private _displayStats() {
-            var scene = this._scene;
-            var engine = scene.getEngine();
-            var glInfo = engine.getGlInfo();
-
-            this._statsSubsetDiv.innerHTML = "Babylon.js v" + Engine.Version + " - <b>" + Tools.Format(engine.getFps(), 0) + " fps</b><br><br>"
-                + "<div style='column-count: 2;-moz-column-count:2;-webkit-column-count:2'>"
-                + "<b>Count</b><br>"
-                + "Total meshes: " + scene.meshes.length + "<br>"
-                + "Total vertices: " + scene.getTotalVertices() + "<br>"
-                + "Total materials: " + scene.materials.length + "<br>"
-                + "Total textures: " + scene.textures.length + "<br>"
-                + "Active meshes: " + scene.getActiveMeshes().length + "<br>"
-                + "Active indices: " + scene.getActiveIndices() + "<br>"
-                + "Active bones: " + scene.getActiveBones() + "<br>"
-                + "Active particles: " + scene.getActiveParticles() + "<br>"
-                + "<b>Draw calls: " + engine.drawCalls + "</b><br><br>"
-                + "<b>Duration</b><br>"
-                + "Meshes selection:</i> " + Tools.Format(scene.getEvaluateActiveMeshesDuration()) + " ms<br>"
-                + "Render Targets: " + Tools.Format(scene.getRenderTargetsDuration()) + " ms<br>"
-                + "Particles: " + Tools.Format(scene.getParticlesDuration()) + " ms<br>"
-                + "Sprites: " + Tools.Format(scene.getSpritesDuration()) + " ms<br><br>"
-                + "Render: <b>" + Tools.Format(scene.getRenderDuration()) + " ms</b><br>"
-                + "Frame: " + Tools.Format(scene.getLastFrameDuration()) + " ms<br>"
-                + "Potential FPS: " + Tools.Format(1000.0 / scene.getLastFrameDuration(), 0) + "<br><br>"
-                + "</div>"
-                + "<div style='column-count: 2;-moz-column-count:2;-webkit-column-count:2'>"
-                + "<b>Extensions</b><br>"
-                + "Std derivatives: " + (engine.getCaps().standardDerivatives ? "Yes" : "No") + "<br>"
-                + "Compressed textures: " + (engine.getCaps().s3tc ? "Yes" : "No") + "<br>"
-                + "Hardware instances: " + (engine.getCaps().instancedArrays ? "Yes" : "No") + "<br>"
-                + "Texture float: " + (engine.getCaps().textureFloat ? "Yes" : "No") + "<br>"
-                + "32bits indices: " + (engine.getCaps().uintIndices ? "Yes" : "No") + "<br>"
-                + "<b>Caps.</b><br>"
-                + "Max textures units: " + engine.getCaps().maxTexturesImageUnits + "<br>"
-                + "Max textures size: " + engine.getCaps().maxTextureSize + "<br>"
-                + "Max anisotropy: " + engine.getCaps().maxAnisotropy + "<br><br><br>"
-                + "</div><br>"
-                + "<b>Info</b><br>"
-                + glInfo.version + "<br>"
-                + glInfo.renderer + "<br>";
-
-            if (this.customStatsFunction) {
-                this._statsSubsetDiv.innerHTML += this._statsSubsetDiv.innerHTML;
-            }
-        }
-    }
-}

File diff suppressed because it is too large
+ 21 - 21
Preview release - Alpha/babylon.2.2.js


File diff suppressed because it is too large
+ 45 - 16
Preview release - Alpha/babylon.2.2.max.js


File diff suppressed because it is too large
+ 24 - 24
Preview release - Alpha/babylon.2.2.noworker.js


+ 1 - 0
Preview release - Alpha/what's new.md

@@ -8,6 +8,7 @@
     - Adding onAfterRender function in BABYLON.PostProcess [PR](https://github.com/BabylonJS/Babylon.js/pull/572) [julien-moreau](https://github.com/julien-moreau)
     - Improved shaders optimizer to remove specular code when not needed [deltakosh](https://github.com/deltakosh)    
     - Added some utility functions to Vector2/3/4 [PR](https://github.com/BabylonJS/Babylon.js/pull/578) [jahow](https://github.com/jahow)
+    - New rawTexture.update function [robgdl](https://github.com/robgdl)
   - **Bug fixes**
  
   - **Breaking changes**

Oimo.js → dist/Oimo.js


babylon.2.1.d.ts → dist/babylon.2.1.d.ts


babylon.2.1.debug.js → dist/babylon.2.1.debug.js


babylon.2.1.js → dist/babylon.2.1.js


babylon.2.1.noworker.js → dist/babylon.2.1.noworker.js


cannon.js → dist/cannon.js


poly2tri.js → dist/poly2tri.js


Previous releases/babylon.1.11.js → dist/previous releases/babylon.1.11.js


Previous releases/babylon.1.12.js → dist/previous releases/babylon.1.12.js


Previous releases/babylon.1.13.js → dist/previous releases/babylon.1.13.js


Previous releases/babylon.1.14-debug.js → dist/previous releases/babylon.1.14-debug.js


Previous releases/babylon.1.14.d.ts → dist/previous releases/babylon.1.14.d.ts


Previous releases/babylon.1.14.js → dist/previous releases/babylon.1.14.js


Previous releases/babylon.2.0.d.ts → dist/previous releases/babylon.2.0.d.ts


Previous releases/babylon.2.0.debug.js → dist/previous releases/babylon.2.0.debug.js


Previous releases/babylon.2.0.js → dist/previous releases/babylon.2.0.js


References/poly2tri.d.ts → external references/poly2tri.d.ts


References/waa.d.ts → external references/waa.d.ts


Babylon/.gitignore → src/.gitignore


Babylon/Actions/babylon.action.js → src/Actions/babylon.action.js


Babylon/Actions/babylon.action.ts → src/Actions/babylon.action.ts


Babylon/Actions/babylon.actionManager.js → src/Actions/babylon.actionManager.js


Babylon/Actions/babylon.actionManager.ts → src/Actions/babylon.actionManager.ts


Babylon/Actions/babylon.condition.js → src/Actions/babylon.condition.js


Babylon/Actions/babylon.condition.ts → src/Actions/babylon.condition.ts


Babylon/Actions/babylon.directActions.js → src/Actions/babylon.directActions.js


Babylon/Actions/babylon.directActions.ts → src/Actions/babylon.directActions.ts


Babylon/Actions/babylon.interpolateValueAction.js → src/Actions/babylon.interpolateValueAction.js


Babylon/Actions/babylon.interpolateValueAction.ts → src/Actions/babylon.interpolateValueAction.ts


Babylon/Animations/babylon.animatable.js → src/Animations/babylon.animatable.js


Babylon/Animations/babylon.animatable.ts → src/Animations/babylon.animatable.ts


Babylon/Animations/babylon.animation.js → src/Animations/babylon.animation.js


Babylon/Animations/babylon.animation.ts → src/Animations/babylon.animation.ts


Babylon/Animations/babylon.easing.js → src/Animations/babylon.easing.js


Babylon/Animations/babylon.easing.ts → src/Animations/babylon.easing.ts


Babylon/Audio/babylon.analyser.js → src/Audio/babylon.analyser.js


Babylon/Audio/babylon.analyser.ts → src/Audio/babylon.analyser.ts


Babylon/Audio/babylon.audioEngine.js → src/Audio/babylon.audioEngine.js


Babylon/Audio/babylon.audioEngine.ts → src/Audio/babylon.audioEngine.ts


Babylon/Audio/babylon.sound.js → src/Audio/babylon.sound.js


Babylon/Audio/babylon.sound.ts → src/Audio/babylon.sound.ts


Babylon/Audio/babylon.soundtrack.js → src/Audio/babylon.soundtrack.js


Babylon/Audio/babylon.soundtrack.ts → src/Audio/babylon.soundtrack.ts


Babylon/Bones/babylon.bone.js → src/Bones/babylon.bone.js


Babylon/Bones/babylon.bone.ts → src/Bones/babylon.bone.ts


Babylon/Bones/babylon.skeleton.js → src/Bones/babylon.skeleton.js


Babylon/Bones/babylon.skeleton.ts → src/Bones/babylon.skeleton.ts


Babylon/Cameras/VR/babylon.vrDeviceOrientationCamera.js → src/Cameras/VR/babylon.vrDeviceOrientationCamera.js


Babylon/Cameras/VR/babylon.vrDeviceOrientationCamera.ts → src/Cameras/VR/babylon.vrDeviceOrientationCamera.ts


Babylon/Cameras/VR/babylon.webVRCamera.js → src/Cameras/VR/babylon.webVRCamera.js


Babylon/Cameras/VR/babylon.webVRCamera.ts → src/Cameras/VR/babylon.webVRCamera.ts


Babylon/Cameras/babylon.arcRotateCamera.js → src/Cameras/babylon.arcRotateCamera.js


Babylon/Cameras/babylon.arcRotateCamera.ts → src/Cameras/babylon.arcRotateCamera.ts


Babylon/Cameras/babylon.camera.js → src/Cameras/babylon.camera.js


Babylon/Cameras/babylon.camera.ts → src/Cameras/babylon.camera.ts


Babylon/Cameras/babylon.deviceOrientationCamera.js → src/Cameras/babylon.deviceOrientationCamera.js


Babylon/Cameras/babylon.deviceOrientationCamera.ts → src/Cameras/babylon.deviceOrientationCamera.ts


Babylon/Cameras/babylon.followCamera.js → src/Cameras/babylon.followCamera.js


Babylon/Cameras/babylon.followCamera.ts → src/Cameras/babylon.followCamera.ts


Babylon/Cameras/babylon.freeCamera.js → src/Cameras/babylon.freeCamera.js


Babylon/Cameras/babylon.freeCamera.ts → src/Cameras/babylon.freeCamera.ts


Babylon/Cameras/babylon.gamepadCamera.js → src/Cameras/babylon.gamepadCamera.js


Babylon/Cameras/babylon.gamepadCamera.ts → src/Cameras/babylon.gamepadCamera.ts


Babylon/Cameras/babylon.stereoscopicCameras.js → src/Cameras/babylon.stereoscopicCameras.js


Babylon/Cameras/babylon.stereoscopicCameras.ts → src/Cameras/babylon.stereoscopicCameras.ts


Babylon/Cameras/babylon.targetCamera.js → src/Cameras/babylon.targetCamera.js


Babylon/Cameras/babylon.targetCamera.ts → src/Cameras/babylon.targetCamera.ts


Babylon/Cameras/babylon.touchCamera.js → src/Cameras/babylon.touchCamera.js


Babylon/Cameras/babylon.touchCamera.ts → src/Cameras/babylon.touchCamera.ts


Babylon/Cameras/babylon.virtualJoysticksCamera.js → src/Cameras/babylon.virtualJoysticksCamera.js


Babylon/Cameras/babylon.virtualJoysticksCamera.ts → src/Cameras/babylon.virtualJoysticksCamera.ts


Babylon/Collisions/babylon.collider.js → src/Collisions/babylon.collider.js


Babylon/Collisions/babylon.collider.ts → src/Collisions/babylon.collider.ts


Babylon/Collisions/babylon.collisionCoordinator.js → src/Collisions/babylon.collisionCoordinator.js


Babylon/Collisions/babylon.collisionCoordinator.ts → src/Collisions/babylon.collisionCoordinator.ts


Babylon/Collisions/babylon.collisionWorker.js → src/Collisions/babylon.collisionWorker.js


Babylon/Collisions/babylon.collisionWorker.ts → src/Collisions/babylon.collisionWorker.ts


Babylon/Collisions/babylon.pickingInfo.js → src/Collisions/babylon.pickingInfo.js


Babylon/Collisions/babylon.pickingInfo.ts → src/Collisions/babylon.pickingInfo.ts


Babylon/Culling/Octrees/babylon.octree.js → src/Culling/Octrees/babylon.octree.js


Babylon/Culling/Octrees/babylon.octree.ts → src/Culling/Octrees/babylon.octree.ts


Babylon/Culling/Octrees/babylon.octreeBlock.js → src/Culling/Octrees/babylon.octreeBlock.js


Babylon/Culling/Octrees/babylon.octreeBlock.ts → src/Culling/Octrees/babylon.octreeBlock.ts


+ 139 - 139
Babylon/Culling/babylon.boundingBox.js

@@ -1,140 +1,140 @@
-var BABYLON;
-(function (BABYLON) {
-    var BoundingBox = (function () {
-        function BoundingBox(minimum, maximum) {
-            this.minimum = minimum;
-            this.maximum = maximum;
-            this.vectors = new Array();
-            this.vectorsWorld = new Array();
-            // Bounding vectors            
-            this.vectors.push(this.minimum.clone());
-            this.vectors.push(this.maximum.clone());
-            this.vectors.push(this.minimum.clone());
-            this.vectors[2].x = this.maximum.x;
-            this.vectors.push(this.minimum.clone());
-            this.vectors[3].y = this.maximum.y;
-            this.vectors.push(this.minimum.clone());
-            this.vectors[4].z = this.maximum.z;
-            this.vectors.push(this.maximum.clone());
-            this.vectors[5].z = this.minimum.z;
-            this.vectors.push(this.maximum.clone());
-            this.vectors[6].x = this.minimum.x;
-            this.vectors.push(this.maximum.clone());
-            this.vectors[7].y = this.minimum.y;
-            // OBB
-            this.center = this.maximum.add(this.minimum).scale(0.5);
-            this.extendSize = this.maximum.subtract(this.minimum).scale(0.5);
-            this.directions = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()];
-            // World
-            for (var index = 0; index < this.vectors.length; index++) {
-                this.vectorsWorld[index] = BABYLON.Vector3.Zero();
-            }
-            this.minimumWorld = BABYLON.Vector3.Zero();
-            this.maximumWorld = BABYLON.Vector3.Zero();
-            this._update(BABYLON.Matrix.Identity());
-        }
-        // Methods
-        BoundingBox.prototype.getWorldMatrix = function () {
-            return this._worldMatrix;
-        };
-        BoundingBox.prototype._update = function (world) {
-            BABYLON.Vector3.FromFloatsToRef(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, this.minimumWorld);
-            BABYLON.Vector3.FromFloatsToRef(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, this.maximumWorld);
-            for (var index = 0; index < this.vectors.length; index++) {
-                var v = this.vectorsWorld[index];
-                BABYLON.Vector3.TransformCoordinatesToRef(this.vectors[index], world, v);
-                if (v.x < this.minimumWorld.x)
-                    this.minimumWorld.x = v.x;
-                if (v.y < this.minimumWorld.y)
-                    this.minimumWorld.y = v.y;
-                if (v.z < this.minimumWorld.z)
-                    this.minimumWorld.z = v.z;
-                if (v.x > this.maximumWorld.x)
-                    this.maximumWorld.x = v.x;
-                if (v.y > this.maximumWorld.y)
-                    this.maximumWorld.y = v.y;
-                if (v.z > this.maximumWorld.z)
-                    this.maximumWorld.z = v.z;
-            }
-            // OBB
-            this.maximumWorld.addToRef(this.minimumWorld, this.center);
-            this.center.scaleInPlace(0.5);
-            BABYLON.Vector3.FromFloatArrayToRef(world.m, 0, this.directions[0]);
-            BABYLON.Vector3.FromFloatArrayToRef(world.m, 4, this.directions[1]);
-            BABYLON.Vector3.FromFloatArrayToRef(world.m, 8, this.directions[2]);
-            this._worldMatrix = world;
-        };
-        BoundingBox.prototype.isInFrustum = function (frustumPlanes) {
-            return BoundingBox.IsInFrustum(this.vectorsWorld, frustumPlanes);
-        };
-        BoundingBox.prototype.isCompletelyInFrustum = function (frustumPlanes) {
-            return BoundingBox.IsCompletelyInFrustum(this.vectorsWorld, frustumPlanes);
-        };
-        BoundingBox.prototype.intersectsPoint = function (point) {
-            var delta = -BABYLON.Engine.Epsilon;
-            if (this.maximumWorld.x - point.x < delta || delta > point.x - this.minimumWorld.x)
-                return false;
-            if (this.maximumWorld.y - point.y < delta || delta > point.y - this.minimumWorld.y)
-                return false;
-            if (this.maximumWorld.z - point.z < delta || delta > point.z - this.minimumWorld.z)
-                return false;
-            return true;
-        };
-        BoundingBox.prototype.intersectsSphere = function (sphere) {
-            return BoundingBox.IntersectsSphere(this.minimumWorld, this.maximumWorld, sphere.centerWorld, sphere.radiusWorld);
-        };
-        BoundingBox.prototype.intersectsMinMax = function (min, max) {
-            if (this.maximumWorld.x < min.x || this.minimumWorld.x > max.x)
-                return false;
-            if (this.maximumWorld.y < min.y || this.minimumWorld.y > max.y)
-                return false;
-            if (this.maximumWorld.z < min.z || this.minimumWorld.z > max.z)
-                return false;
-            return true;
-        };
-        // Statics
-        BoundingBox.Intersects = function (box0, box1) {
-            if (box0.maximumWorld.x < box1.minimumWorld.x || box0.minimumWorld.x > box1.maximumWorld.x)
-                return false;
-            if (box0.maximumWorld.y < box1.minimumWorld.y || box0.minimumWorld.y > box1.maximumWorld.y)
-                return false;
-            if (box0.maximumWorld.z < box1.minimumWorld.z || box0.minimumWorld.z > box1.maximumWorld.z)
-                return false;
-            return true;
-        };
-        BoundingBox.IntersectsSphere = function (minPoint, maxPoint, sphereCenter, sphereRadius) {
-            var vector = BABYLON.Vector3.Clamp(sphereCenter, minPoint, maxPoint);
-            var num = BABYLON.Vector3.DistanceSquared(sphereCenter, vector);
-            return (num <= (sphereRadius * sphereRadius));
-        };
-        BoundingBox.IsCompletelyInFrustum = function (boundingVectors, frustumPlanes) {
-            for (var p = 0; p < 6; p++) {
-                for (var i = 0; i < 8; i++) {
-                    if (frustumPlanes[p].dotCoordinate(boundingVectors[i]) < 0) {
-                        return false;
-                    }
-                }
-            }
-            return true;
-        };
-        BoundingBox.IsInFrustum = function (boundingVectors, frustumPlanes) {
-            for (var p = 0; p < 6; p++) {
-                var inCount = 8;
-                for (var i = 0; i < 8; i++) {
-                    if (frustumPlanes[p].dotCoordinate(boundingVectors[i]) < 0) {
-                        --inCount;
-                    }
-                    else {
-                        break;
-                    }
-                }
-                if (inCount === 0)
-                    return false;
-            }
-            return true;
-        };
-        return BoundingBox;
-    })();
-    BABYLON.BoundingBox = BoundingBox;
-})(BABYLON || (BABYLON = {}));
+var BABYLON;
+(function (BABYLON) {
+    var BoundingBox = (function () {
+        function BoundingBox(minimum, maximum) {
+            this.minimum = minimum;
+            this.maximum = maximum;
+            this.vectors = new Array();
+            this.vectorsWorld = new Array();
+            // Bounding vectors            
+            this.vectors.push(this.minimum.clone());
+            this.vectors.push(this.maximum.clone());
+            this.vectors.push(this.minimum.clone());
+            this.vectors[2].x = this.maximum.x;
+            this.vectors.push(this.minimum.clone());
+            this.vectors[3].y = this.maximum.y;
+            this.vectors.push(this.minimum.clone());
+            this.vectors[4].z = this.maximum.z;
+            this.vectors.push(this.maximum.clone());
+            this.vectors[5].z = this.minimum.z;
+            this.vectors.push(this.maximum.clone());
+            this.vectors[6].x = this.minimum.x;
+            this.vectors.push(this.maximum.clone());
+            this.vectors[7].y = this.minimum.y;
+            // OBB
+            this.center = this.maximum.add(this.minimum).scale(0.5);
+            this.extendSize = this.maximum.subtract(this.minimum).scale(0.5);
+            this.directions = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()];
+            // World
+            for (var index = 0; index < this.vectors.length; index++) {
+                this.vectorsWorld[index] = BABYLON.Vector3.Zero();
+            }
+            this.minimumWorld = BABYLON.Vector3.Zero();
+            this.maximumWorld = BABYLON.Vector3.Zero();
+            this._update(BABYLON.Matrix.Identity());
+        }
+        // Methods
+        BoundingBox.prototype.getWorldMatrix = function () {
+            return this._worldMatrix;
+        };
+        BoundingBox.prototype._update = function (world) {
+            BABYLON.Vector3.FromFloatsToRef(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, this.minimumWorld);
+            BABYLON.Vector3.FromFloatsToRef(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, this.maximumWorld);
+            for (var index = 0; index < this.vectors.length; index++) {
+                var v = this.vectorsWorld[index];
+                BABYLON.Vector3.TransformCoordinatesToRef(this.vectors[index], world, v);
+                if (v.x < this.minimumWorld.x)
+                    this.minimumWorld.x = v.x;
+                if (v.y < this.minimumWorld.y)
+                    this.minimumWorld.y = v.y;
+                if (v.z < this.minimumWorld.z)
+                    this.minimumWorld.z = v.z;
+                if (v.x > this.maximumWorld.x)
+                    this.maximumWorld.x = v.x;
+                if (v.y > this.maximumWorld.y)
+                    this.maximumWorld.y = v.y;
+                if (v.z > this.maximumWorld.z)
+                    this.maximumWorld.z = v.z;
+            }
+            // OBB
+            this.maximumWorld.addToRef(this.minimumWorld, this.center);
+            this.center.scaleInPlace(0.5);
+            BABYLON.Vector3.FromFloatArrayToRef(world.m, 0, this.directions[0]);
+            BABYLON.Vector3.FromFloatArrayToRef(world.m, 4, this.directions[1]);
+            BABYLON.Vector3.FromFloatArrayToRef(world.m, 8, this.directions[2]);
+            this._worldMatrix = world;
+        };
+        BoundingBox.prototype.isInFrustum = function (frustumPlanes) {
+            return BoundingBox.IsInFrustum(this.vectorsWorld, frustumPlanes);
+        };
+        BoundingBox.prototype.isCompletelyInFrustum = function (frustumPlanes) {
+            return BoundingBox.IsCompletelyInFrustum(this.vectorsWorld, frustumPlanes);
+        };
+        BoundingBox.prototype.intersectsPoint = function (point) {
+            var delta = -BABYLON.Engine.Epsilon;
+            if (this.maximumWorld.x - point.x < delta || delta > point.x - this.minimumWorld.x)
+                return false;
+            if (this.maximumWorld.y - point.y < delta || delta > point.y - this.minimumWorld.y)
+                return false;
+            if (this.maximumWorld.z - point.z < delta || delta > point.z - this.minimumWorld.z)
+                return false;
+            return true;
+        };
+        BoundingBox.prototype.intersectsSphere = function (sphere) {
+            return BoundingBox.IntersectsSphere(this.minimumWorld, this.maximumWorld, sphere.centerWorld, sphere.radiusWorld);
+        };
+        BoundingBox.prototype.intersectsMinMax = function (min, max) {
+            if (this.maximumWorld.x < min.x || this.minimumWorld.x > max.x)
+                return false;
+            if (this.maximumWorld.y < min.y || this.minimumWorld.y > max.y)
+                return false;
+            if (this.maximumWorld.z < min.z || this.minimumWorld.z > max.z)
+                return false;
+            return true;
+        };
+        // Statics
+        BoundingBox.Intersects = function (box0, box1) {
+            if (box0.maximumWorld.x < box1.minimumWorld.x || box0.minimumWorld.x > box1.maximumWorld.x)
+                return false;
+            if (box0.maximumWorld.y < box1.minimumWorld.y || box0.minimumWorld.y > box1.maximumWorld.y)
+                return false;
+            if (box0.maximumWorld.z < box1.minimumWorld.z || box0.minimumWorld.z > box1.maximumWorld.z)
+                return false;
+            return true;
+        };
+        BoundingBox.IntersectsSphere = function (minPoint, maxPoint, sphereCenter, sphereRadius) {
+            var vector = BABYLON.Vector3.Clamp(sphereCenter, minPoint, maxPoint);
+            var num = BABYLON.Vector3.DistanceSquared(sphereCenter, vector);
+            return (num <= (sphereRadius * sphereRadius));
+        };
+        BoundingBox.IsCompletelyInFrustum = function (boundingVectors, frustumPlanes) {
+            for (var p = 0; p < 6; p++) {
+                for (var i = 0; i < 8; i++) {
+                    if (frustumPlanes[p].dotCoordinate(boundingVectors[i]) < 0) {
+                        return false;
+                    }
+                }
+            }
+            return true;
+        };
+        BoundingBox.IsInFrustum = function (boundingVectors, frustumPlanes) {
+            for (var p = 0; p < 6; p++) {
+                var inCount = 8;
+                for (var i = 0; i < 8; i++) {
+                    if (frustumPlanes[p].dotCoordinate(boundingVectors[i]) < 0) {
+                        --inCount;
+                    }
+                    else {
+                        break;
+                    }
+                }
+                if (inCount === 0)
+                    return false;
+            }
+            return true;
+        };
+        return BoundingBox;
+    })();
+    BABYLON.BoundingBox = BoundingBox;
+})(BABYLON || (BABYLON = {}));
 //# sourceMappingURL=babylon.boundingBox.js.map

Babylon/Culling/babylon.BoundingBox.ts → src/Culling/babylon.boundingBox.ts


Babylon/Culling/babylon.boundingInfo.js → src/Culling/babylon.boundingInfo.js


Babylon/Culling/babylon.boundingInfo.ts → src/Culling/babylon.boundingInfo.ts


Babylon/Culling/babylon.boundingSphere.js → src/Culling/babylon.boundingSphere.js


Babylon/Culling/babylon.boundingSphere.ts → src/Culling/babylon.boundingSphere.ts


Babylon/Layer/babylon.layer.js → src/Layer/babylon.layer.js


Babylon/Layer/babylon.layer.ts → src/Layer/babylon.layer.ts


Babylon/LensFlare/babylon.lensFlare.js → src/LensFlare/babylon.lensFlare.js


Babylon/LensFlare/babylon.lensFlare.ts → src/LensFlare/babylon.lensFlare.ts


+ 0 - 0
Babylon/LensFlare/babylon.lensFlareSystem.js


Some files were not shown because too many files changed in this diff