sebastien 6 years ago
parent
commit
e631a25f06

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


BIN
Playground/scenes/miniBar2.glb


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


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


+ 9 - 4
dist/preview release/babylon.max.js

@@ -65948,6 +65948,9 @@ var BABYLON;
                 this._renderFunction = this.update.bind(this);
             }
             Object.defineProperty(SkeletonViewer.prototype, "debugMesh", {
+                /**
+                 * Returns the mesh used to render the bones
+                 */
                 get: function () {
                     return this._debugMesh;
                 },
@@ -84927,11 +84930,13 @@ var BABYLON;
             for (var i = 0; i < cams.length; i++) {
                 var camera = cams[i];
                 var cameraName = camera.name;
-                this._postProcesses[this._singleInstance ? 0 : cameraName].forEach(function (postProcess) {
-                    camera.detachPostProcess(postProcess);
-                });
+                var postProcesses = this._postProcesses[this._singleInstance ? 0 : cameraName];
+                if (postProcesses) {
+                    this._postProcesses[this._singleInstance ? 0 : cameraName].forEach(function (postProcess) {
+                        camera.detachPostProcess(postProcess);
+                    });
+                }
                 if (this._cameras[cameraName]) {
-                    //this._indicesForCamera.splice(index, 1);
                     this._cameras[cameraName] = null;
                 }
             }

+ 9 - 4
dist/preview release/babylon.no-module.max.js

@@ -65915,6 +65915,9 @@ var BABYLON;
                 this._renderFunction = this.update.bind(this);
             }
             Object.defineProperty(SkeletonViewer.prototype, "debugMesh", {
+                /**
+                 * Returns the mesh used to render the bones
+                 */
                 get: function () {
                     return this._debugMesh;
                 },
@@ -84894,11 +84897,13 @@ var BABYLON;
             for (var i = 0; i < cams.length; i++) {
                 var camera = cams[i];
                 var cameraName = camera.name;
-                this._postProcesses[this._singleInstance ? 0 : cameraName].forEach(function (postProcess) {
-                    camera.detachPostProcess(postProcess);
-                });
+                var postProcesses = this._postProcesses[this._singleInstance ? 0 : cameraName];
+                if (postProcesses) {
+                    this._postProcesses[this._singleInstance ? 0 : cameraName].forEach(function (postProcess) {
+                        camera.detachPostProcess(postProcess);
+                    });
+                }
                 if (this._cameras[cameraName]) {
-                    //this._indicesForCamera.splice(index, 1);
                     this._cameras[cameraName] = null;
                 }
             }

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


+ 9 - 4
dist/preview release/es6.js

@@ -65915,6 +65915,9 @@ var BABYLON;
                 this._renderFunction = this.update.bind(this);
             }
             Object.defineProperty(SkeletonViewer.prototype, "debugMesh", {
+                /**
+                 * Returns the mesh used to render the bones
+                 */
                 get: function () {
                     return this._debugMesh;
                 },
@@ -84894,11 +84897,13 @@ var BABYLON;
             for (var i = 0; i < cams.length; i++) {
                 var camera = cams[i];
                 var cameraName = camera.name;
-                this._postProcesses[this._singleInstance ? 0 : cameraName].forEach(function (postProcess) {
-                    camera.detachPostProcess(postProcess);
-                });
+                var postProcesses = this._postProcesses[this._singleInstance ? 0 : cameraName];
+                if (postProcesses) {
+                    this._postProcesses[this._singleInstance ? 0 : cameraName].forEach(function (postProcess) {
+                        camera.detachPostProcess(postProcess);
+                    });
+                }
                 if (this._cameras[cameraName]) {
-                    //this._indicesForCamera.splice(index, 1);
                     this._cameras[cameraName] = null;
                 }
             }

File diff suppressed because it is too large
+ 2475 - 0
dist/preview release/viewer/babylon.viewer.d.ts


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


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


+ 22 - 19
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -962,18 +962,37 @@ declare module 'babylonjs-viewer/loader/plugins/loaderPlugin' {
 }
 
 declare module 'babylonjs-viewer/templating/viewerTemplatePlugin' {
-    
+    import { EventCallback, Template } from "babylonjs-viewer/templating/templateManager";
+    export interface IViewerTemplatePlugin {
+        readonly templateName: string;
+        readonly eventsToAttach?: Array<string>;
+        interactionPredicate(event: EventCallback): boolean;
+        onEvent?(event: EventCallback): void;
+        addHTMLTemplate?(template: Template): void;
+    }
+    export abstract class AbstractViewerNavbarButton implements IViewerTemplatePlugin {
+        readonly templateName: string;
+        readonly eventsToAttach: Array<string>;
+        protected _prepend: boolean;
+        protected _buttonName: string;
+        protected _buttonClass: string;
+        protected _htmlTemplate: string;
+        constructor(buttonName: string, buttonClass?: string, htmlTemplate?: string);
+        interactionPredicate(event: EventCallback): boolean;
+        abstract onEvent(event: EventCallback): void;
+        addHTMLTemplate(template: Template): void;
+        protected _generateHTMLElement(template: Template): Element | DocumentFragment;
+    }
 }
 
 declare module 'babylonjs-viewer/optimizer/custom' {
-    import { extendedUpgrade } from "babylonjs-viewer/optimizer/custom/extended";
     import { SceneManager } from "babylonjs-viewer/managers/sceneManager";
     /**
       *
       * @param name the name of the custom optimizer configuration
       * @param upgrade set to true if you want to upgrade optimizer and false if you want to degrade
       */
-    export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
+    export function getCustomOptimizerByName(name: string, upgrade?: boolean): (sceneManager: SceneManager) => boolean;
     export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
 }
 
@@ -1644,22 +1663,6 @@ declare module 'babylonjs-viewer/loader/plugins' {
     export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
 }
 
-declare module 'babylonjs-viewer/optimizer/custom/extended' {
-    import { SceneManager } from 'babylonjs-viewer/managers/sceneManager';
-    /**
-        * A custom upgrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedUpgrade(sceneManager: SceneManager): boolean;
-    /**
-        * A custom degrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedDegrade(sceneManager: SceneManager): boolean;
-}
-
 declare module 'babylonjs-viewer/configuration/interfaces' {
     export * from 'babylonjs-viewer/configuration/interfaces/cameraConfiguration';
     export * from 'babylonjs-viewer/configuration/interfaces/colorGradingConfiguration';

+ 1 - 1
src/Actions/action.ts

@@ -4,7 +4,7 @@ import { Scene } from "scene";
 import { Mesh } from "Mesh";
 import { Light } from "Lights";
 import { Camera } from "Cameras";
-import {Node} from "Node";
+import { Node } from "Node";
 import { ActionManager, Condition, ActionEvent } from "Actions";
     /**
      * The action to be carried out following a trigger

+ 0 - 1
src/Actions/condition.ts

@@ -318,4 +318,3 @@ import { ActionManager, Action } from "Actions";
             });
         }
     }
-

+ 0 - 1
src/Actions/directAudioActions.ts

@@ -1,5 +1,4 @@
 import { Action, Condition } from "Actions";
-
 import { Sound } from "Audio";
 
     /**

+ 1 - 2
src/Actions/interpolateValueAction.ts

@@ -1,8 +1,7 @@
 import { Action, Condition } from "Actions";
-
 import { Observable, Tools } from "Tools";
-
 import { Color3, Vector3, Matrix, Quaternion } from "Math";
+import { Animation } from "Animations";
 
     /**
      * This defines an action responsible to change the value of a property

+ 2 - 5
src/Animations/animatable.ts

@@ -1,9 +1,6 @@
 import { Nullable } from "types";
-
-import { RuntimeAnimation } from "Animations";
-
-import { Scene } from "Gamepad/gamepadSceneComponent";
-
+import { RuntimeAnimation, Animation } from "Animations";
+import { Scene } from "scene";
 import { Observable } from "Tools";
 
     /**

+ 1 - 1
src/Animations/animation.ts

@@ -1,7 +1,7 @@
 import { Path2, Vector3, Quaternion, Vector2, Color3, Size, Scalar, Matrix } from "Math";
 import { IEasingFunction, RuntimeAnimation, EasingFunction, Animatable } from "Animations";
 import { Nullable } from "types";
-import { Scene } from "Debug/debugLayer";
+import { Scene } from "scene";
 import { IAnimatable } from "Tools";
 import { Node } from "Node";
 

+ 1 - 1
src/Animations/animationPropertiesOverride.ts

@@ -1,4 +1,4 @@
-    import {Animation} from "Animations"
+    import { Animation } from "Animations";
     /**
      * Class used to override all child animations of a given target
      */

+ 2 - 0
src/Animations/easing.ts

@@ -1,3 +1,5 @@
+    import { BezierCurve } from "Math";
+
     /**
      * This represents the main contract an easing function should follow.
      * Easing functions are used throughout the animation system.

+ 1 - 1
src/Animations/runtimeAnimation.ts

@@ -1,5 +1,5 @@
 import { Quaternion, Vector3, Vector2, Size, Color3, Matrix } from "Math";
-import {Animation, AnimationEvent} from "Animations";
+import { Animatable, Animation, AnimationEvent } from "Animations";
 import { Scene } from "scene";
 
     // Static values to help the garbage collector

+ 0 - 3
src/Audio/analyser.ts

@@ -1,9 +1,6 @@
 import { Nullable } from "types";
-
 import { Scene } from "scene";
-
 import { IAudioEngine } from "Audio";
-
 import { Engine } from "Engine";
 
     /**

+ 8 - 2
src/Audio/audioSceneComponent.ts

@@ -1,10 +1,12 @@
-import {Engine} from "Engine"
-import {Camera} from "Cameras"
+import { Engine } from "Engine";
+import { Camera } from "Cameras";
 import { Sound, SoundTrack } from "Audio";
 import { Nullable } from "types";
 import { Scene } from "scene";
 import { Matrix, Vector3 } from "Math";
 import { SceneComponentConstants, ISceneSerializableComponent } from "sceneComponent";
+import { AbstractScene } from "abstractScene";
+import { AssetContainer } from "assetContainer";
 
     // Adds the parser to the scene parsers.
     AbstractScene.AddParser(SceneComponentConstants.NAME_AUDIO, (parsedData: any, scene: Scene, container: AssetContainer, rootUrl: string) => {
@@ -34,13 +36,16 @@ import { SceneComponentConstants, ISceneSerializableComponent } from "sceneCompo
         loadedSounds = [];
     });
 
+declare module "abstractScene" {
     export interface AbstractScene {
         /**
          * The list of sounds used in the scene.
          */
         sounds: Nullable<Array<Sound>>;
     }
+}
 
+declare module "scene" {
     export interface Scene {
         /**
          * @hidden
@@ -77,6 +82,7 @@ import { SceneComponentConstants, ISceneSerializableComponent } from "sceneCompo
          */
         headphone: boolean;
     }
+}
 
     Object.defineProperty(Scene.prototype, "mainSoundTrack", {
         get: function(this: Scene) {

+ 0 - 6
src/Audio/sound.ts

@@ -1,15 +1,9 @@
 import { Observable, Tools } from "Tools";
-
 import { Vector3, Tmp } from "Math";
-
 import { Nullable } from "types";
-
 import { Scene } from "scene";
-
 import { Engine } from "Engine";
-
 import { AudioSceneComponent } from "Audio";
-
 import { TransformNode, AbstractMesh } from "Mesh";
 import { SceneComponentConstants } from "sceneComponent";
 

+ 1 - 1
src/Behaviors/Cameras/bouncingBehavior.ts

@@ -4,7 +4,7 @@ import { BackEase, EasingFunction } from "Animations";
 import { Nullable } from "types";
 import { Observer } from "Tools";
 import { AbstractMesh } from "Mesh";
-import {Animation} from "Animations";
+import { Animation, Animatable } from "Animations";
 
     /**
      * Add a bouncing effect to an ArcRotateCamera when reaching a specified minimum and maximum radius

+ 0 - 5
src/Behaviors/Mesh/pointerDragBehavior.ts

@@ -1,13 +1,8 @@
 import { Behavior } from "Behaviors";
-
 import { Mesh, AbstractMesh } from "Mesh";
-
 import { Scene } from "scene";
-
 import { Nullable } from "types";
-
 import { Observer, Observable } from "Tools";
-
 import { Vector3 } from "Math";
 import { PointerInfo, PointerEventTypes } from "Events";
 import { BoundingBoxGizmo } from "Gizmos";

+ 3 - 0
src/Debug/skeletonViewer.ts

@@ -26,6 +26,9 @@ import { UtilityLayerRenderer } from "index";
         private _isEnabled = false;
         private _renderFunction: () => void;
 
+        /**
+         * Returns the mesh used to render the bones
+         */
         public get debugMesh(): Nullable<LinesMesh> {
             return this._debugMesh;
         }

+ 7 - 4
src/PostProcess/RenderPipeline/postProcessRenderEffect.ts

@@ -154,12 +154,15 @@ import { PostProcess } from "PostProcess";
             for (var i = 0; i < cams.length; i++) {
                 var camera: Camera = cams[i];
                 var cameraName: string = camera.name;
-                this._postProcesses[this._singleInstance ? 0 : cameraName].forEach((postProcess: PostProcess) => {
-                    camera.detachPostProcess(postProcess);
-                });
+                const postProcesses = this._postProcesses[this._singleInstance ? 0 : cameraName];
+
+                if (postProcesses) {
+                    postProcesses.forEach((postProcess: PostProcess) => {
+                        camera.detachPostProcess(postProcess);
+                    });
+                }
 
                 if (this._cameras[cameraName]) {
-                    //this._indicesForCamera.splice(index, 1);
                     this._cameras[cameraName] = null;
                 }
             }

+ 1 - 1
src/abstractScene.ts

@@ -1,4 +1,4 @@
-import { Scene } from "Physics";
+import { Scene } from "scene";
 import { Nullable } from "types";
 import { AbstractMesh, Geometry, TransformNode } from "Mesh";
 import { Skeleton } from "Bones";

+ 2 - 1
src/scene.ts

@@ -8,7 +8,7 @@ import { MorphTargetManager } from "Morph";
 import { Camera } from "Cameras";
 import { AbstractScene } from "abstractScene";
 import { BaseTexture, Material, ImageProcessingConfiguration, StandardMaterial, RenderTargetTexture, Effect, UniformBuffer, MultiMaterial, Texture } from "Materials";
-import { AnimationPropertiesOverride, Animatable, RuntimeAnimation, AnimationGroup } from "Animations";
+import { AnimationPropertiesOverride, Animatable, RuntimeAnimation, AnimationGroup, Animation } from "Animations";
 import { Light } from "Lights";
 import { PickingInfo, ICollisionCoordinator, CollisionCoordinatorLegacy, CollisionWorker, CollisionCoordinatorWorker } from "Collisions";
 import { PointerEventTypes, PointerInfoPre, PointerInfo, KeyboardInfoPre, KeyboardInfo, KeyboardEventTypes } from "Events";
@@ -19,6 +19,7 @@ import { RenderingManager, IRenderingManagerAutoClearSetup } from "Rendering";
 import { ISceneComponent, ISceneSerializableComponent, Stage, SimpleStageAction, RenderTargetsStageAction, MeshStageAction, EvaluateSubMeshStageAction, ActiveMeshStageAction, CameraStageAction, RenderingGroupStageAction, RenderingMeshStageAction, PointerMoveStageAction, PointerUpDownStageAction } from "sceneComponent";
 import { Engine } from "Engine";
 import { Ray } from "Culling";
+import { Node } from "node";
 
     /**
      * Define an interface for all classes that will hold resources