David Catuhe 6 年之前
父節點
當前提交
45699af8c9

文件差異過大導致無法顯示
+ 1237 - 1237
Playground/babylon.d.txt


文件差異過大導致無法顯示
+ 1237 - 1237
dist/preview release/babylon.d.ts


文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/babylon.js


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

@@ -46996,6 +46996,16 @@ var BABYLON;
                             defines.INVERTCUBICMAP = true;
                         }
                         defines.REFLECTIONMAP_3D = reflectionTexture.isCube;
+                        defines.REFLECTIONMAP_CUBIC = false;
+                        defines.REFLECTIONMAP_EXPLICIT = false;
+                        defines.REFLECTIONMAP_PLANAR = false;
+                        defines.REFLECTIONMAP_PROJECTION = false;
+                        defines.REFLECTIONMAP_SKYBOX = false;
+                        defines.REFLECTIONMAP_SPHERICAL = false;
+                        defines.REFLECTIONMAP_EQUIRECTANGULAR = false;
+                        defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false;
+                        defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = false;
+                        defines.REFLECTIONMAP_SKYBOX_TRANSFORMED = false;
                         switch (reflectionTexture.coordinatesMode) {
                             case BABYLON.Texture.EXPLICIT_MODE:
                                 defines.REFLECTIONMAP_EXPLICIT = true;

+ 10 - 0
dist/preview release/babylon.no-module.max.js

@@ -46963,6 +46963,16 @@ var BABYLON;
                             defines.INVERTCUBICMAP = true;
                         }
                         defines.REFLECTIONMAP_3D = reflectionTexture.isCube;
+                        defines.REFLECTIONMAP_CUBIC = false;
+                        defines.REFLECTIONMAP_EXPLICIT = false;
+                        defines.REFLECTIONMAP_PLANAR = false;
+                        defines.REFLECTIONMAP_PROJECTION = false;
+                        defines.REFLECTIONMAP_SKYBOX = false;
+                        defines.REFLECTIONMAP_SPHERICAL = false;
+                        defines.REFLECTIONMAP_EQUIRECTANGULAR = false;
+                        defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false;
+                        defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = false;
+                        defines.REFLECTIONMAP_SKYBOX_TRANSFORMED = false;
                         switch (reflectionTexture.coordinatesMode) {
                             case BABYLON.Texture.EXPLICIT_MODE:
                                 defines.REFLECTIONMAP_EXPLICIT = true;

文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/babylon.worker.js


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

@@ -46963,6 +46963,16 @@ var BABYLON;
                             defines.INVERTCUBICMAP = true;
                         }
                         defines.REFLECTIONMAP_3D = reflectionTexture.isCube;
+                        defines.REFLECTIONMAP_CUBIC = false;
+                        defines.REFLECTIONMAP_EXPLICIT = false;
+                        defines.REFLECTIONMAP_PLANAR = false;
+                        defines.REFLECTIONMAP_PROJECTION = false;
+                        defines.REFLECTIONMAP_SKYBOX = false;
+                        defines.REFLECTIONMAP_SPHERICAL = false;
+                        defines.REFLECTIONMAP_EQUIRECTANGULAR = false;
+                        defines.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false;
+                        defines.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = false;
+                        defines.REFLECTIONMAP_SKYBOX_TRANSFORMED = false;
                         switch (reflectionTexture.coordinatesMode) {
                             case BABYLON.Texture.EXPLICIT_MODE:
                                 defines.REFLECTIONMAP_EXPLICIT = true;

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

@@ -482,6 +482,37 @@ declare module BabylonViewer {
     export const telemetryManager: TelemetryManager;
 }
 declare module BabylonViewer {
+    /**
+        * An instance of the class is in charge of loading the model correctly.
+        * This class will continously be expended with tasks required from the specific loaders Babylon has.
+        *
+        * A Model loader is unique per (Abstract)Viewer. It is being generated by the viewer
+        */
+    export class ModelLoader {
+            readonly baseUrl: string;
+            /**
+                * Create a new Model loader
+                * @param _viewer the viewer using this model loader
+                */
+            constructor(_observablesManager: ObservablesManager, _configurationContainer?: ConfigurationContainer | undefined);
+            /**
+                * Adds a new plugin to the loader process.
+                *
+                * @param plugin the plugin name or the plugin itself
+                */
+            addPlugin(plugin: ILoaderPlugin | string): void;
+            /**
+                * Load a model using predefined configuration
+                * @param modelConfiguration the modelConfiguration to use to load the model
+                */
+            load(modelConfiguration: IModelConfiguration): ViewerModel;
+            cancelLoad(model: ViewerModel): void;
+            /**
+                * dispose the model loader.
+                * If loaders are registered and are in the middle of loading, they will be disposed and the request(s) will be cancelled.
+                */
+            dispose(): void;
+    }
 }
 declare module BabylonViewer {
     /**
@@ -1514,30 +1545,21 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
+    /**
+        * Get a loader plugin according to its name.
+        * The plugin will be cached and will be reused if called for again.
+        *
+        * @param name the name of the plugin
+        */
+    export function getLoaderPluginByName(name: string): ILoaderPlugin;
+    /**
+        *
+        */
+    export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
+}
+declare module BabylonViewer {
 }
 declare module BabylonViewer {
-    export interface IEnvironmentMapConfiguration {
-            /**
-                * Environment map texture path in relative to the asset folder.
-                */
-            texture: string;
-            /**
-                * Default rotation to apply to the environment map.
-                */
-            rotationY: number;
-            /**
-                * Tint level of the main color on the environment map.
-                */
-            tintLevel: number;
-            /**
-                * The environment's main color.
-                */
-            mainColor?: {
-                    r?: number;
-                    g?: number;
-                    b?: number;
-            };
-    }
 }
 declare module BabylonViewer {
     /**
@@ -1649,6 +1671,41 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
+    export class TelemetryLoaderPlugin implements ILoaderPlugin {
+        onInit(loader: BABYLON.ISceneLoaderPlugin | BABYLON.ISceneLoaderPluginAsync, model: ViewerModel): void;
+        onLoaded(model: ViewerModel): void;
+        onError(message: string, exception: any): void;
+        onComplete(): void;
+    }
+}
+declare module BabylonViewer {
+    /**
+      * A loder plugin to use MSFT_lod extension correctly (glTF)
+      */
+    export class MSFTLodLoaderPlugin implements ILoaderPlugin {
+        onInit(loader: BABYLON.ISceneLoaderPlugin | BABYLON.ISceneLoaderPluginAsync, model: ViewerModel): void;
+        onExtensionLoaded(extension: BABYLON.IGLTFLoaderExtension): void;
+    }
+}
+declare module BabylonViewer {
+    /**
+      * Force-apply material configuration right after a material was loaded.
+      */
+    export class ApplyMaterialConfigPlugin implements ILoaderPlugin {
+        onInit(loader: BABYLON.ISceneLoaderPlugin | BABYLON.ISceneLoaderPluginAsync, model: ViewerModel): void;
+        onMaterialLoaded(material: BABYLON.Material): void;
+    }
+}
+declare module BabylonViewer {
+    /**
+      * A (PBR) material will be extended using this function.
+      * This function will hold extra default configuration for the viewer, if not implemented in Babylon itself.
+      */
+    export class ExtendedMaterialLoaderPlugin implements ILoaderPlugin {
+        onMaterialLoaded(baseMaterial: BABYLON.Material): void;
+    }
+}
+declare module BabylonViewer {
     export interface ICameraConfiguration {
         position?: {
             x: number;

文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 108 - 23
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -527,7 +527,42 @@ declare module 'babylonjs-viewer/managers/telemetryManager' {
 }
 
 declare module 'babylonjs-viewer/loader/modelLoader' {
-    
+    import { ConfigurationContainer } from 'babylonjs-viewer/configuration/configurationContainer';
+    import { IModelConfiguration } from 'babylonjs-viewer/configuration/interfaces/modelConfiguration';
+    import { ObservablesManager } from 'babylonjs-viewer/managers/observablesManager';
+    import { ViewerModel } from 'babylonjs-viewer/model/viewerModel';
+    import { ILoaderPlugin } from 'babylonjs-viewer/loader/plugins';
+    /**
+        * An instance of the class is in charge of loading the model correctly.
+        * This class will continously be expended with tasks required from the specific loaders Babylon has.
+        *
+        * A Model loader is unique per (Abstract)Viewer. It is being generated by the viewer
+        */
+    export class ModelLoader {
+            readonly baseUrl: string;
+            /**
+                * Create a new Model loader
+                * @param _viewer the viewer using this model loader
+                */
+            constructor(_observablesManager: ObservablesManager, _configurationContainer?: ConfigurationContainer | undefined);
+            /**
+                * Adds a new plugin to the loader process.
+                *
+                * @param plugin the plugin name or the plugin itself
+                */
+            addPlugin(plugin: ILoaderPlugin | string): void;
+            /**
+                * Load a model using predefined configuration
+                * @param modelConfiguration the modelConfiguration to use to load the model
+                */
+            load(modelConfiguration: IModelConfiguration): ViewerModel;
+            cancelLoad(model: ViewerModel): void;
+            /**
+                * dispose the model loader.
+                * If loaders are registered and are in the middle of loading, they will be disposed and the request(s) will be cancelled.
+                */
+            dispose(): void;
+    }
 }
 
 declare module 'babylonjs-viewer/model/viewerModel' {
@@ -1607,6 +1642,26 @@ declare module 'babylonjs-viewer/configuration/interfaces/modelConfiguration' {
     }
 }
 
+declare module 'babylonjs-viewer/loader/plugins' {
+    import { TelemetryLoaderPlugin } from "babylonjs-viewer/loader/plugins/telemetryLoaderPlugin";
+    import { ILoaderPlugin } from "babylonjs-viewer/loader/plugins/loaderPlugin";
+    import { MSFTLodLoaderPlugin } from 'babylonjs-viewer/loader/plugins/msftLodLoaderPlugin';
+    import { ApplyMaterialConfigPlugin } from 'babylonjs-viewer/loader/plugins/applyMaterialConfig';
+    import { ExtendedMaterialLoaderPlugin } from 'babylonjs-viewer/loader/plugins/extendedMaterialLoaderPlugin';
+    export { TelemetryLoaderPlugin, ILoaderPlugin, MSFTLodLoaderPlugin, ApplyMaterialConfigPlugin, ExtendedMaterialLoaderPlugin };
+    /**
+        * Get a loader plugin according to its name.
+        * The plugin will be cached and will be reused if called for again.
+        *
+        * @param name the name of the plugin
+        */
+    export function getLoaderPluginByName(name: string): ILoaderPlugin;
+    /**
+        *
+        */
+    export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
+}
+
 declare module 'babylonjs-viewer/configuration/interfaces' {
     export * from 'babylonjs-viewer/configuration/interfaces/cameraConfiguration';
     export * from 'babylonjs-viewer/configuration/interfaces/colorGradingConfiguration';
@@ -1626,28 +1681,7 @@ declare module 'babylonjs-viewer/configuration/interfaces' {
 }
 
 declare module 'babylonjs-viewer/configuration/interfaces/environmentMapConfiguration' {
-    export interface IEnvironmentMapConfiguration {
-            /**
-                * Environment map texture path in relative to the asset folder.
-                */
-            texture: string;
-            /**
-                * Default rotation to apply to the environment map.
-                */
-            rotationY: number;
-            /**
-                * Tint level of the main color on the environment map.
-                */
-            tintLevel: number;
-            /**
-                * The environment's main color.
-                */
-            mainColor?: {
-                    r?: number;
-                    g?: number;
-                    b?: number;
-            };
-    }
+    
 }
 
 declare module 'babylonjs-viewer/templating/eventManager' {
@@ -1765,6 +1799,57 @@ declare module 'babylonjs-viewer/configuration/interfaces/modelAnimationConfigur
     }
 }
 
+declare module 'babylonjs-viewer/loader/plugins/telemetryLoaderPlugin' {
+    import { ILoaderPlugin } from "babylonjs-viewer/loader/plugins/loaderPlugin";
+    import { ViewerModel } from "babylonjs-viewer/model/viewerModel";
+    import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from "babylonjs";
+    export class TelemetryLoaderPlugin implements ILoaderPlugin {
+        onInit(loader: ISceneLoaderPlugin | ISceneLoaderPluginAsync, model: ViewerModel): void;
+        onLoaded(model: ViewerModel): void;
+        onError(message: string, exception: any): void;
+        onComplete(): void;
+    }
+}
+
+declare module 'babylonjs-viewer/loader/plugins/msftLodLoaderPlugin' {
+    import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from 'babylonjs';
+    import { IGLTFLoaderExtension } from 'babylonjs-loaders';
+    import { ViewerModel } from 'babylonjs-viewer/model/viewerModel';
+    import { ILoaderPlugin } from 'babylonjs-viewer/loader/plugins/loaderPlugin';
+    /**
+      * A loder plugin to use MSFT_lod extension correctly (glTF)
+      */
+    export class MSFTLodLoaderPlugin implements ILoaderPlugin {
+        onInit(loader: ISceneLoaderPlugin | ISceneLoaderPluginAsync, model: ViewerModel): void;
+        onExtensionLoaded(extension: IGLTFLoaderExtension): void;
+    }
+}
+
+declare module 'babylonjs-viewer/loader/plugins/applyMaterialConfig' {
+    import { ISceneLoaderPlugin, ISceneLoaderPluginAsync, Material } from 'babylonjs';
+    import { ViewerModel } from 'babylonjs-viewer/model/viewerModel';
+    import { ILoaderPlugin } from 'babylonjs-viewer/loader/plugins/loaderPlugin';
+    /**
+      * Force-apply material configuration right after a material was loaded.
+      */
+    export class ApplyMaterialConfigPlugin implements ILoaderPlugin {
+        onInit(loader: ISceneLoaderPlugin | ISceneLoaderPluginAsync, model: ViewerModel): void;
+        onMaterialLoaded(material: Material): void;
+    }
+}
+
+declare module 'babylonjs-viewer/loader/plugins/extendedMaterialLoaderPlugin' {
+    import { Material } from 'babylonjs';
+    import { ILoaderPlugin } from 'babylonjs-viewer/loader/plugins/loaderPlugin';
+    /**
+      * A (PBR) material will be extended using this function.
+      * This function will hold extra default configuration for the viewer, if not implemented in Babylon itself.
+      */
+    export class ExtendedMaterialLoaderPlugin implements ILoaderPlugin {
+        onMaterialLoaded(baseMaterial: Material): void;
+    }
+}
+
 declare module 'babylonjs-viewer/configuration/interfaces/cameraConfiguration' {
     export interface ICameraConfiguration {
         position?: {