|
@@ -334,6 +334,9 @@ declare module 'babylonjs-viewer/viewer/viewer' {
|
|
* The configuration loader of this viewer
|
|
* The configuration loader of this viewer
|
|
*/
|
|
*/
|
|
protected _configurationLoader: ConfigurationLoader;
|
|
protected _configurationLoader: ConfigurationLoader;
|
|
|
|
+ /**
|
|
|
|
+ * Is the viewer already initialized. for internal use.
|
|
|
|
+ */
|
|
protected _isInit: boolean;
|
|
protected _isInit: boolean;
|
|
constructor(containerElement: HTMLElement, initialConfiguration?: ViewerConfiguration);
|
|
constructor(containerElement: HTMLElement, initialConfiguration?: ViewerConfiguration);
|
|
/**
|
|
/**
|
|
@@ -383,9 +386,10 @@ declare module 'babylonjs-viewer/viewer/viewer' {
|
|
* Only provided information will be updated, old configuration values will be kept.
|
|
* Only provided information will be updated, old configuration values will be kept.
|
|
* If this.configuration was manually changed, you can trigger this function with no parameters,
|
|
* If this.configuration was manually changed, you can trigger this function with no parameters,
|
|
* and the entire configuration will be updated.
|
|
* and the entire configuration will be updated.
|
|
- * @param newConfiguration
|
|
|
|
|
|
+ * @param newConfiguration the partial configuration to update
|
|
|
|
+ *
|
|
*/
|
|
*/
|
|
- updateConfiguration(newConfiguration?: Partial<ViewerConfiguration>, mode?: ViewerModel): void;
|
|
|
|
|
|
+ updateConfiguration(newConfiguration?: Partial<ViewerConfiguration>): void;
|
|
/**
|
|
/**
|
|
* this is used to register native functions using the configuration object.
|
|
* this is used to register native functions using the configuration object.
|
|
* This will configure the observers.
|
|
* This will configure the observers.
|
|
@@ -416,7 +420,7 @@ declare module 'babylonjs-viewer/viewer/viewer' {
|
|
*/
|
|
*/
|
|
protected _initEngine(): Promise<Engine>;
|
|
protected _initEngine(): Promise<Engine>;
|
|
/**
|
|
/**
|
|
- * Initialize a model loading. The returns object (a ViewerModel object) will be loaded in the background.
|
|
|
|
|
|
+ * Initialize a model loading. The returned object (a ViewerModel object) will be loaded in the background.
|
|
* The difference between this and loadModel is that loadModel will fulfill the promise when the model finished loading.
|
|
* The difference between this and loadModel is that loadModel will fulfill the promise when the model finished loading.
|
|
*
|
|
*
|
|
* @param modelConfig model configuration to use when loading the model.
|
|
* @param modelConfig model configuration to use when loading the model.
|
|
@@ -425,7 +429,9 @@ declare module 'babylonjs-viewer/viewer/viewer' {
|
|
*/
|
|
*/
|
|
initModel(modelConfig: string | IModelConfiguration, clearScene?: boolean): ViewerModel;
|
|
initModel(modelConfig: string | IModelConfiguration, clearScene?: boolean): ViewerModel;
|
|
/**
|
|
/**
|
|
- * load a model using the provided configuration
|
|
|
|
|
|
+ * load a model using the provided configuration.
|
|
|
|
+ * This function, as opposed to initModel, will return a promise that resolves when the model is loaded, and rejects with error.
|
|
|
|
+ * If you want to attach to the observables of the model, use initModle instead.
|
|
*
|
|
*
|
|
* @param modelConfig the model configuration or URL to load.
|
|
* @param modelConfig the model configuration or URL to load.
|
|
* @param clearScene Should the scene be cleared before loading the model
|
|
* @param clearScene Should the scene be cleared before loading the model
|
|
@@ -480,6 +486,9 @@ declare module 'babylonjs-viewer/telemetryManager' {
|
|
* @return The current session ID
|
|
* @return The current session ID
|
|
*/
|
|
*/
|
|
readonly session: string;
|
|
readonly session: string;
|
|
|
|
+ /**
|
|
|
|
+ * Disposes the telemetry manager
|
|
|
|
+ */
|
|
dispose(): void;
|
|
dispose(): void;
|
|
}
|
|
}
|
|
export const telemetryManager: TelemetryManager;
|
|
export const telemetryManager: TelemetryManager;
|
|
@@ -502,6 +511,11 @@ declare module 'babylonjs-viewer/loader/modelLoader' {
|
|
* @param _viewer the viewer using this model loader
|
|
* @param _viewer the viewer using this model loader
|
|
*/
|
|
*/
|
|
constructor(_viewer: AbstractViewer);
|
|
constructor(_viewer: AbstractViewer);
|
|
|
|
+ /**
|
|
|
|
+ * Adds a new plugin to the loader process.
|
|
|
|
+ *
|
|
|
|
+ * @param plugin the plugin name or the plugin itself
|
|
|
|
+ */
|
|
addPlugin(plugin: ILoaderPlugin | string): void;
|
|
addPlugin(plugin: ILoaderPlugin | string): void;
|
|
/**
|
|
/**
|
|
* Load a model using predefined configuration
|
|
* Load a model using predefined configuration
|
|
@@ -523,6 +537,9 @@ declare module 'babylonjs-viewer/model/viewerModel' {
|
|
import { IModelConfiguration } from "babylonjs-viewer/configuration/configuration";
|
|
import { IModelConfiguration } from "babylonjs-viewer/configuration/configuration";
|
|
import { IModelAnimation } from "babylonjs-viewer/model/modelAnimation";
|
|
import { IModelAnimation } from "babylonjs-viewer/model/modelAnimation";
|
|
import { AbstractViewer } from "babylonjs-viewer/";
|
|
import { AbstractViewer } from "babylonjs-viewer/";
|
|
|
|
+ /**
|
|
|
|
+ * The current state of the model
|
|
|
|
+ */
|
|
export enum ModelState {
|
|
export enum ModelState {
|
|
INIT = 0,
|
|
INIT = 0,
|
|
LOADING = 1,
|
|
LOADING = 1,
|
|
@@ -891,6 +908,11 @@ declare module 'babylonjs-viewer/loader/plugins/loaderPlugin' {
|
|
import { ViewerModel } from "babylonjs-viewer/model/viewerModel";
|
|
import { ViewerModel } from "babylonjs-viewer/model/viewerModel";
|
|
import { IGLTFLoaderExtension, IGLTFLoaderData } from "babylonjs-loaders";
|
|
import { IGLTFLoaderExtension, IGLTFLoaderData } from "babylonjs-loaders";
|
|
import { AbstractMesh, ISceneLoaderPlugin, ISceneLoaderPluginAsync, SceneLoaderProgressEvent, BaseTexture, Material } from "babylonjs";
|
|
import { AbstractMesh, ISceneLoaderPlugin, ISceneLoaderPluginAsync, SceneLoaderProgressEvent, BaseTexture, Material } from "babylonjs";
|
|
|
|
+ /**
|
|
|
|
+ * This interface defines the structure of a loader plugin.
|
|
|
|
+ * Any of those functions will be called if (!) the loader supports those callbacks.
|
|
|
|
+ * Any loader supports onInit, onLoaded, onError and onProgress.
|
|
|
|
+ */
|
|
export interface ILoaderPlugin {
|
|
export interface ILoaderPlugin {
|
|
onInit?: (loader: ISceneLoaderPlugin | ISceneLoaderPluginAsync, model: ViewerModel) => void;
|
|
onInit?: (loader: ISceneLoaderPlugin | ISceneLoaderPluginAsync, model: ViewerModel) => void;
|
|
onLoaded?: (model: ViewerModel) => void;
|
|
onLoaded?: (model: ViewerModel) => void;
|
|
@@ -1455,12 +1477,30 @@ declare module 'babylonjs-viewer/templateManager' {
|
|
* A single template configuration object
|
|
* A single template configuration object
|
|
*/
|
|
*/
|
|
export interface ITemplateConfiguration {
|
|
export interface ITemplateConfiguration {
|
|
|
|
+ /**
|
|
|
|
+ * can be either the id of the template's html element or a URL.
|
|
|
|
+ * See - http://doc.babylonjs.com/extensions/the_templating_system#location-vs-html
|
|
|
|
+ */
|
|
location?: string;
|
|
location?: string;
|
|
|
|
+ /**
|
|
|
|
+ * If no location is provided you can provide here the raw html of this template.
|
|
|
|
+ * See http://doc.babylonjs.com/extensions/the_templating_system#location-vs-html
|
|
|
|
+ */
|
|
html?: string;
|
|
html?: string;
|
|
id?: string;
|
|
id?: string;
|
|
|
|
+ /**
|
|
|
|
+ * Parameters that will be delivered to the template and will render it accordingly.
|
|
|
|
+ */
|
|
params?: {
|
|
params?: {
|
|
[key: string]: string | number | boolean | object;
|
|
[key: string]: string | number | boolean | object;
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Events to attach to this template.
|
|
|
|
+ * event name is the key. the value can either be a boolean (attach to the parent element)
|
|
|
|
+ * or a map of html id elements.
|
|
|
|
+ *
|
|
|
|
+ * See - http://doc.babylonjs.com/extensions/the_templating_system#event-binding
|
|
|
|
+ */
|
|
events?: {
|
|
events?: {
|
|
pointerdown?: boolean | {
|
|
pointerdown?: boolean | {
|
|
[id: string]: boolean;
|
|
[id: string]: boolean;
|
|
@@ -1617,6 +1657,8 @@ declare module 'babylonjs-viewer/templateManager' {
|
|
* The parameters are provided to Handlebars which in turn generates the template.
|
|
* The parameters are provided to Handlebars which in turn generates the template.
|
|
* This function will update the template with the new parameters
|
|
* This function will update the template with the new parameters
|
|
*
|
|
*
|
|
|
|
+ * Note that when updating parameters the events will be registered again (after being cleared).
|
|
|
|
+ *
|
|
* @param params the new template parameters
|
|
* @param params the new template parameters
|
|
*/
|
|
*/
|
|
updateParams(params: {
|
|
updateParams(params: {
|
|
@@ -1785,7 +1827,7 @@ declare module 'babylonjs-viewer/viewer/sceneManager' {
|
|
* @param newConfiguration the delta that should be configured. This includes only the changes
|
|
* @param newConfiguration the delta that should be configured. This includes only the changes
|
|
* @param globalConfiguration The global configuration object, after the new configuration was merged into it
|
|
* @param globalConfiguration The global configuration object, after the new configuration was merged into it
|
|
*/
|
|
*/
|
|
- updateConfiguration(newConfiguration: Partial<ViewerConfiguration>, globalConfiguration: ViewerConfiguration, model?: ViewerModel): void;
|
|
|
|
|
|
+ updateConfiguration(newConfiguration: Partial<ViewerConfiguration>, globalConfiguration: ViewerConfiguration): void;
|
|
bloomEnabled: boolean;
|
|
bloomEnabled: boolean;
|
|
fxaaEnabled: boolean;
|
|
fxaaEnabled: boolean;
|
|
/**
|
|
/**
|
|
@@ -1805,8 +1847,8 @@ declare module 'babylonjs-viewer/viewer/sceneManager' {
|
|
* @param cameraConfig the new camera configuration
|
|
* @param cameraConfig the new camera configuration
|
|
* @param model optionally use the model to configure the camera.
|
|
* @param model optionally use the model to configure the camera.
|
|
*/
|
|
*/
|
|
- protected _configureCamera(cameraConfig?: ICameraConfiguration, model?: ViewerModel): void;
|
|
|
|
- protected _configureEnvironment(skyboxConifguration?: ISkyboxConfiguration | boolean, groundConfiguration?: IGroundConfiguration | boolean, model?: ViewerModel): Promise<Scene> | undefined;
|
|
|
|
|
|
+ protected _configureCamera(cameraConfig?: ICameraConfiguration): void;
|
|
|
|
+ protected _configureEnvironment(skyboxConifguration?: ISkyboxConfiguration | boolean, groundConfiguration?: IGroundConfiguration | boolean): Promise<Scene> | undefined;
|
|
/**
|
|
/**
|
|
* configure the lights.
|
|
* configure the lights.
|
|
*
|
|
*
|
|
@@ -1815,7 +1857,7 @@ declare module 'babylonjs-viewer/viewer/sceneManager' {
|
|
*/
|
|
*/
|
|
protected _configureLights(lightsConfiguration?: {
|
|
protected _configureLights(lightsConfiguration?: {
|
|
[name: string]: ILightConfiguration | boolean;
|
|
[name: string]: ILightConfiguration | boolean;
|
|
- }, model?: ViewerModel): void;
|
|
|
|
|
|
+ }): void;
|
|
/**
|
|
/**
|
|
* Gets the shadow map blur kernel according to the light configuration.
|
|
* Gets the shadow map blur kernel according to the light configuration.
|
|
* @param light The light used to generate the shadows
|
|
* @param light The light used to generate the shadows
|
|
@@ -1927,6 +1969,11 @@ declare module 'babylonjs-viewer/eventManager' {
|
|
declare module 'babylonjs-viewer/labs/viewerLabs' {
|
|
declare module 'babylonjs-viewer/labs/viewerLabs' {
|
|
import { PBREnvironment } from "babylonjs-viewer/labs/environmentSerializer";
|
|
import { PBREnvironment } from "babylonjs-viewer/labs/environmentSerializer";
|
|
import { SceneManager } from 'babylonjs-viewer/viewer/sceneManager';
|
|
import { SceneManager } from 'babylonjs-viewer/viewer/sceneManager';
|
|
|
|
+ /**
|
|
|
|
+ * The ViewerLabs class will hold functions that are not (!) backwards compatible.
|
|
|
|
+ * The APIs in all labs-related classes and configuration might change.
|
|
|
|
+ * Once stable, lab features will be moved to the publis API and configuration object.
|
|
|
|
+ */
|
|
export class ViewerLabs {
|
|
export class ViewerLabs {
|
|
constructor(_sceneManager: SceneManager);
|
|
constructor(_sceneManager: SceneManager);
|
|
assetsRootURL: string;
|
|
assetsRootURL: string;
|
|
@@ -1973,9 +2020,9 @@ declare module 'babylonjs-viewer/labs/environmentSerializer' {
|
|
import { Vector3 } from "babylonjs";
|
|
import { Vector3 } from "babylonjs";
|
|
import { TextureCube } from 'babylonjs-viewer/labs/texture';
|
|
import { TextureCube } from 'babylonjs-viewer/labs/texture';
|
|
/**
|
|
/**
|
|
- * Spherical polynomial coefficients (counter part to spherical harmonic coefficients used in shader irradiance calculation)
|
|
|
|
- * @ignoreChildren
|
|
|
|
- */
|
|
|
|
|
|
+ * Spherical polynomial coefficients (counter part to spherical harmonic coefficients used in shader irradiance calculation)
|
|
|
|
+ * @ignoreChildren
|
|
|
|
+ */
|
|
export interface SphericalPolynomalCoefficients {
|
|
export interface SphericalPolynomalCoefficients {
|
|
x: Vector3;
|
|
x: Vector3;
|
|
y: Vector3;
|
|
y: Vector3;
|