浏览代码

Added a button to log the camera object (much needed for some projects to create POI)

Temechon 9 年之前
父节点
当前提交
506e36d685
共有 2 个文件被更改,包括 15 次插入0 次删除
  1. 8 0
      src/Debug/babylon.debugLayer.js
  2. 7 0
      src/Debug/babylon.debugLayer.ts

+ 8 - 0
src/Debug/babylon.debugLayer.js

@@ -557,6 +557,14 @@ var BABYLON;
                 this._generateTexBox(this._optionsSubsetDiv, "<b>Tools:</b>", this.accentColor);
                 this._generateButton(this._optionsSubsetDiv, "Dump rendertargets", function (element) { _this._scene.dumpNextRenderTargets = true; });
                 this._generateButton(this._optionsSubsetDiv, "Run SceneOptimizer", function (element) { BABYLON.SceneOptimizer.OptimizeAsync(_this._scene); });
+                this._generateButton(this._optionsSubsetDiv, "Log camera object", function (element) {
+                    if (_this._camera) {
+                        console.log(_this._camera);
+                    }
+                    else {
+                        console.warn("No camera defined, or debug layer created before camera creation!");
+                    }
+                });
                 this._optionsSubsetDiv.appendChild(document.createElement("br"));
                 this._globalDiv.appendChild(this._statsDiv);
                 this._globalDiv.appendChild(this._logDiv);

+ 7 - 0
src/Debug/babylon.debugLayer.ts

@@ -700,6 +700,13 @@
                 this._generateTexBox(this._optionsSubsetDiv, "<b>Tools:</b>", this.accentColor);
                 this._generateButton(this._optionsSubsetDiv, "Dump rendertargets", (element) => { this._scene.dumpNextRenderTargets = true; });
                 this._generateButton(this._optionsSubsetDiv, "Run SceneOptimizer", (element) => { SceneOptimizer.OptimizeAsync(this._scene); });
+                this._generateButton(this._optionsSubsetDiv, "Log camera object", (element) => {
+                    if (this._camera) {
+                        console.log(this._camera);
+                    } else {
+                        console.warn("No camera defined, or debug layer created before camera creation!");
+                    }
+                });
                 this._optionsSubsetDiv.appendChild(document.createElement("br"));
   
                 this._globalDiv.appendChild(this._statsDiv);