David Catuhe 7 years ago
parent
commit
cd7fbccc7c

File diff suppressed because it is too large
+ 1121 - 1120
Playground/babylon.d.txt


File diff suppressed because it is too large
+ 7355 - 7354
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 3 - 3
dist/preview release/babylon.js


+ 6 - 0
dist/preview release/babylon.max.js

@@ -23899,6 +23899,10 @@ var BABYLON;
                 }
                 this._activeAnimatables = [];
             }
+            for (var _i = 0, _a = this.animationGroups; _i < _a.length; _i++) {
+                var group = _a[_i];
+                group.stop();
+            }
         };
         Scene.prototype._animate = function () {
             if (!this.animationsEnabled || this._activeAnimatables.length === 0) {
@@ -91603,6 +91607,8 @@ var BABYLON;
         NullEngine.prototype._createTexture = function () {
             return {};
         };
+        NullEngine.prototype._releaseTexture = function (texture) {
+        };
         NullEngine.prototype.createTexture = function (urlArg, noMipmap, invertY, scene, samplingMode, onLoad, onError, buffer, fallBack, format) {
             if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
             if (onLoad === void 0) { onLoad = null; }

File diff suppressed because it is too large
+ 3 - 3
dist/preview release/babylon.worker.js


+ 6 - 0
dist/preview release/es6.js

@@ -23866,6 +23866,10 @@ var BABYLON;
                 }
                 this._activeAnimatables = [];
             }
+            for (var _i = 0, _a = this.animationGroups; _i < _a.length; _i++) {
+                var group = _a[_i];
+                group.stop();
+            }
         };
         Scene.prototype._animate = function () {
             if (!this.animationsEnabled || this._activeAnimatables.length === 0) {
@@ -91570,6 +91574,8 @@ var BABYLON;
         NullEngine.prototype._createTexture = function () {
             return {};
         };
+        NullEngine.prototype._releaseTexture = function (texture) {
+        };
         NullEngine.prototype.createTexture = function (urlArg, noMipmap, invertY, scene, samplingMode, onLoad, onError, buffer, fallBack, format) {
             if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
             if (onLoad === void 0) { onLoad = null; }

File diff suppressed because it is too large
+ 4 - 4
dist/preview release/inspector/babylon.inspector.bundle.js


+ 3 - 0
dist/preview release/inspector/babylon.inspector.d.ts

@@ -294,6 +294,7 @@ declare module INSPECTOR {
         getProperties(): Array<PropertyLine>;
         getTools(): Array<AbstractTreeTool>;
         setPOV(): void;
+        getCurrentActiveCamera(): string;
     }
 }
 
@@ -1256,6 +1257,8 @@ declare module INSPECTOR {
 declare module INSPECTOR {
     interface ICameraPOV {
         setPOV: () => void;
+        getCurrentActiveCamera: () => string;
+        id: () => string;
     }
     /**
      *

+ 31 - 29
dist/preview release/inspector/babylon.inspector.js

@@ -710,12 +710,22 @@ var INSPECTOR;
         };
         CameraAdapter.prototype.getTools = function () {
             var tools = [];
-            // tools.push(new Checkbox(this));
             tools.push(new INSPECTOR.CameraPOV(this));
             return tools;
         };
+        // Set the point of view of the chosen camera
         CameraAdapter.prototype.setPOV = function () {
-            this._obj.getScene().activeCamera = this._obj;
+            this._obj.getScene().switchActiveCamera(this._obj);
+        };
+        // Return the name of the current active camera
+        CameraAdapter.prototype.getCurrentActiveCamera = function () {
+            var activeCamera = this._obj.getScene().activeCamera;
+            if (activeCamera != null) {
+                return activeCamera.name;
+            }
+            else {
+                return "0";
+            }
         };
         return CameraAdapter;
     }(INSPECTOR.Adapter));
@@ -3441,25 +3451,6 @@ var INSPECTOR;
                 point.addEventListener('click', function () { _this._inspector.scene.forcePointsCloud = true; _this._inspector.scene.forceWireframe = false; });
                 wireframe.addEventListener('click', function () { _this._inspector.scene.forcePointsCloud = false; _this._inspector.scene.forceWireframe = true; });
                 solid.addEventListener('click', function () { _this._inspector.scene.forcePointsCloud = false; _this._inspector.scene.forceWireframe = false; });
-                // Cameras
-                title = INSPECTOR.Helpers.CreateDiv('actions-title', _this._actions);
-                title.textContent = 'Cameras';
-                var cameraRadioButtons = [];
-                var _loop_1 = function (camera) {
-                    var cameraRadio = INSPECTOR.Helpers.CreateDiv('action-radio', this_1._actions);
-                    cameraRadio.textContent = camera.name;
-                    if (this_1._inspector.scene.activeCamera == camera) {
-                        cameraRadio.classList.add('active');
-                    }
-                    cameraRadioButtons.push(cameraRadio);
-                    cameraRadio.addEventListener('click', function () { _this._inspector.scene.switchActiveCamera(camera); });
-                };
-                var this_1 = this;
-                for (var _a = 0, _b = _this._inspector.scene.cameras; _a < _b.length; _a++) {
-                    var camera = _b[_a];
-                    _loop_1(camera);
-                }
-                _this._generateRadioAction(cameraRadioButtons);
                 // Textures
                 title = INSPECTOR.Helpers.CreateDiv('actions-title', _this._actions);
                 title.textContent = 'Textures channels';
@@ -5023,7 +5014,15 @@ var INSPECTOR;
         function CameraPOV(camera) {
             var _this = _super.call(this) || this;
             _this.cameraPOV = camera;
-            _this._elem.classList.add('fa-video-camera');
+            // Setting the id of the line with the name of the camera
+            _this._elem.id = _this.cameraPOV.id();
+            // Put the right icon 
+            if (_this._elem.id == _this.cameraPOV.getCurrentActiveCamera()) {
+                _this._elem.classList.add('fa-check-circle');
+            }
+            else {
+                _this._elem.classList.add('fa-circle');
+            }
             return _this;
         }
         CameraPOV.prototype.action = function () {
@@ -5031,16 +5030,19 @@ var INSPECTOR;
             this._gotoPOV();
         };
         CameraPOV.prototype._gotoPOV = function () {
-            var actives = INSPECTOR.Inspector.DOCUMENT.querySelectorAll(".fa-video-camera.active");
-            console.log(actives);
+            // Uncheck all the radio buttons
+            var actives = INSPECTOR.Inspector.DOCUMENT.querySelectorAll(".fa-check-circle");
             for (var i = 0; i < actives.length; i++) {
-                actives[i].classList.remove('active');
+                actives[i].classList.remove('fa-check-circle');
+                actives[i].classList.add('fa-circle');
             }
-            //if (this._on) {
-            // set icon camera
-            this._elem.classList.add('active');
-            //}
+            // setting the point off view to the right camera
             this.cameraPOV.setPOV();
+            // Check the right radio button
+            if (this._elem.id == this.cameraPOV.getCurrentActiveCamera()) {
+                this._elem.classList.remove('fa-circle');
+                this._elem.classList.add('fa-check-circle');
+            }
         };
         return CameraPOV;
     }(INSPECTOR.AbstractTreeTool));

File diff suppressed because it is too large
+ 4 - 4
dist/preview release/inspector/babylon.inspector.min.js


File diff suppressed because it is too large
+ 11 - 11
dist/preview release/viewer/babylon.viewer.js


+ 6 - 0
dist/preview release/viewer/babylon.viewer.max.js

@@ -23987,6 +23987,10 @@ var BABYLON;
                 }
                 this._activeAnimatables = [];
             }
+            for (var _i = 0, _a = this.animationGroups; _i < _a.length; _i++) {
+                var group = _a[_i];
+                group.stop();
+            }
         };
         Scene.prototype._animate = function () {
             if (!this.animationsEnabled || this._activeAnimatables.length === 0) {
@@ -91691,6 +91695,8 @@ var BABYLON;
         NullEngine.prototype._createTexture = function () {
             return {};
         };
+        NullEngine.prototype._releaseTexture = function (texture) {
+        };
         NullEngine.prototype.createTexture = function (urlArg, noMipmap, invertY, scene, samplingMode, onLoad, onError, buffer, fallBack, format) {
             if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
             if (onLoad === void 0) { onLoad = null; }

+ 3 - 0
src/Engine/babylon.nullEngine.ts

@@ -290,6 +290,9 @@
             return {};
         }
 
+        public _releaseTexture(texture: InternalTexture): void {
+        }
+
         public createTexture(urlArg: string, noMipmap: boolean, invertY: boolean, scene: Scene, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message: string, exception: any) => void> = null, buffer: Nullable<ArrayBuffer | HTMLImageElement> = null, fallBack?: InternalTexture, format?: number): InternalTexture {
             var texture = new InternalTexture(this, InternalTexture.DATASOURCE_URL);
             var url = String(urlArg);

+ 4 - 0
src/babylon.scene.ts

@@ -2635,6 +2635,10 @@
                 }
                 this._activeAnimatables = [];
             }
+
+            for (var group of this.animationGroups) {
+                group.stop();
+            }
         }
 
         private _animate(): void {

+ 18 - 14
tests/nullEngine/app.js

@@ -1,5 +1,5 @@
 var BABYLON = require("../../dist/preview release/babylon.max");
-var LOADERS = require("../../dist/preview release/loaders/babylonjs.loaders");
+// var LOADERS = require("../../dist/preview release/loaders/babylonjs.loaders");
 global.XMLHttpRequest = require('xhr2').XMLHttpRequest;
 
 var engine = new BABYLON.NullEngine();
@@ -142,16 +142,20 @@ var engine = new BABYLON.NullEngine();
 //     //});
   
 //   }, progress => {}, (scene, err) => console.error('error:', err));
-var scene = new BABYLON.Scene(engine);
-var camera = new BABYLON.ArcRotateCamera("camera", 0, 0, 0, BABYLON.Vector3.Zero(), scene);
-scene.render();
-var pos = BABYLON.Vector3.Project(
-              new BABYLON.Vector3(0.5, 0.5, 0.5),
-              BABYLON.Matrix.Identity(),
-              scene.getTransformMatrix(),
-              scene.activeCamera.viewport.toGlobal(
-              engine.getRenderWidth(),
-              engine.getRenderHeight()
-            ));;
-
-            console.log(pos);
+// var scene = new BABYLON.Scene(engine);
+// var camera = new BABYLON.ArcRotateCamera("camera", 0, 0, 0, BABYLON.Vector3.Zero(), scene);
+// scene.render();
+// var pos = BABYLON.Vector3.Project(
+//               new BABYLON.Vector3(0.5, 0.5, 0.5),
+//               BABYLON.Matrix.Identity(),
+//               scene.getTransformMatrix(),
+//               scene.activeCamera.viewport.toGlobal(
+//               engine.getRenderWidth(),
+//               engine.getRenderHeight()
+//             ));;
+
+//             console.log(pos);
+
+const scene = new BABYLON.Scene(engine);
+new BABYLON.PBRMetallicRoughnessMaterial("asdfasf", scene);
+scene.dispose();