@babylonjs/viewer 5.0.0-rc.4 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configuration/configuration.d.ts +107 -107
- package/configuration/configuration.js +15 -15
- package/configuration/configuration.js.map +1 -1
- package/configuration/configurationCompatibility.d.ts +8 -8
- package/configuration/configurationCompatibility.js +65 -65
- package/configuration/configurationCompatibility.js.map +1 -1
- package/configuration/configurationContainer.d.ts +10 -10
- package/configuration/configurationContainer.js +9 -9
- package/configuration/configurationContainer.js.map +1 -1
- package/configuration/globals.d.ts +6 -6
- package/configuration/globals.js +17 -17
- package/configuration/globals.js.map +1 -1
- package/configuration/index.d.ts +2 -2
- package/configuration/index.js +3 -2
- package/configuration/index.js.map +1 -1
- package/configuration/interfaces/cameraConfiguration.d.ts +31 -31
- package/configuration/interfaces/cameraConfiguration.js +1 -1
- package/configuration/interfaces/cameraConfiguration.js.map +1 -1
- package/configuration/interfaces/colorGradingConfiguration.d.ts +81 -81
- package/configuration/interfaces/colorGradingConfiguration.js +1 -1
- package/configuration/interfaces/colorGradingConfiguration.js.map +1 -1
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +20 -20
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +1 -1
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +1 -1
- package/configuration/interfaces/environmentMapConfiguration.d.ts +22 -22
- package/configuration/interfaces/environmentMapConfiguration.js +1 -1
- package/configuration/interfaces/environmentMapConfiguration.js.map +1 -1
- package/configuration/interfaces/groundConfiguration.d.ts +24 -24
- package/configuration/interfaces/groundConfiguration.js +1 -1
- package/configuration/interfaces/groundConfiguration.js.map +1 -1
- package/configuration/interfaces/imageProcessingConfiguration.d.ts +43 -43
- package/configuration/interfaces/imageProcessingConfiguration.js +1 -1
- package/configuration/interfaces/imageProcessingConfiguration.js.map +1 -1
- package/configuration/interfaces/index.d.ts +15 -15
- package/configuration/interfaces/index.js +15 -15
- package/configuration/interfaces/index.js.map +1 -1
- package/configuration/interfaces/lightConfiguration.d.ts +60 -60
- package/configuration/interfaces/lightConfiguration.js +1 -1
- package/configuration/interfaces/lightConfiguration.js.map +1 -1
- package/configuration/interfaces/modelAnimationConfiguration.d.ts +26 -26
- package/configuration/interfaces/modelAnimationConfiguration.js +1 -1
- package/configuration/interfaces/modelAnimationConfiguration.js.map +1 -1
- package/configuration/interfaces/modelConfiguration.d.ts +65 -65
- package/configuration/interfaces/modelConfiguration.js +1 -1
- package/configuration/interfaces/modelConfiguration.js.map +1 -1
- package/configuration/interfaces/observersConfiguration.d.ts +5 -5
- package/configuration/interfaces/observersConfiguration.js +1 -1
- package/configuration/interfaces/observersConfiguration.js.map +1 -1
- package/configuration/interfaces/sceneConfiguration.d.ts +48 -48
- package/configuration/interfaces/sceneConfiguration.js +1 -1
- package/configuration/interfaces/sceneConfiguration.js.map +1 -1
- package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +23 -23
- package/configuration/interfaces/sceneOptimizerConfiguration.js +1 -1
- package/configuration/interfaces/sceneOptimizerConfiguration.js.map +1 -1
- package/configuration/interfaces/skyboxConfiguration.d.ts +21 -21
- package/configuration/interfaces/skyboxConfiguration.js +1 -1
- package/configuration/interfaces/skyboxConfiguration.js.map +1 -1
- package/configuration/interfaces/templateConfiguration.d.ts +67 -67
- package/configuration/interfaces/templateConfiguration.js +1 -1
- package/configuration/interfaces/templateConfiguration.js.map +1 -1
- package/configuration/interfaces/vrConfiguration.d.ts +16 -16
- package/configuration/interfaces/vrConfiguration.js +1 -1
- package/configuration/interfaces/vrConfiguration.js.map +1 -1
- package/configuration/loader.d.ts +4 -4
- package/configuration/loader.js +16 -28
- package/configuration/loader.js.map +1 -1
- package/configuration/mappers.d.ts +42 -42
- package/configuration/mappers.js +190 -189
- package/configuration/mappers.js.map +1 -1
- package/configuration/renderOnlyLoader.d.ts +33 -33
- package/configuration/renderOnlyLoader.js +161 -158
- package/configuration/renderOnlyLoader.js.map +1 -1
- package/configuration/types/default.d.ts +6 -6
- package/configuration/types/default.js +120 -119
- package/configuration/types/default.js.map +1 -1
- package/configuration/types/environmentMap.d.ts +5 -5
- package/configuration/types/environmentMap.js +13 -13
- package/configuration/types/environmentMap.js.map +1 -1
- package/configuration/types/extended.d.ts +6 -6
- package/configuration/types/extended.js +316 -316
- package/configuration/types/extended.js.map +1 -1
- package/configuration/types/index.d.ts +13 -13
- package/configuration/types/index.js +49 -48
- package/configuration/types/index.js.map +1 -1
- package/configuration/types/minimal.d.ts +6 -6
- package/configuration/types/minimal.js +42 -42
- package/configuration/types/minimal.js.map +1 -1
- package/configuration/types/renderOnlyDefault.d.ts +30 -30
- package/configuration/types/renderOnlyDefault.js +30 -30
- package/configuration/types/renderOnlyDefault.js.map +1 -1
- package/configuration/types/shadowLight.d.ts +9 -9
- package/configuration/types/shadowLight.js +63 -63
- package/configuration/types/shadowLight.js.map +1 -1
- package/helper/index.d.ts +26 -26
- package/helper/index.js +62 -56
- package/helper/index.js.map +1 -1
- package/index.d.ts +30 -30
- package/index.js +45 -41
- package/index.js.map +1 -1
- package/initializer.d.ts +11 -11
- package/initializer.js +34 -33
- package/initializer.js.map +1 -1
- package/interfaces.d.ts +5 -5
- package/interfaces.js +1 -1
- package/interfaces.js.map +1 -1
- package/labs/environmentSerializer.d.ts +126 -126
- package/labs/environmentSerializer.js +190 -186
- package/labs/environmentSerializer.js.map +1 -1
- package/labs/texture.d.ts +183 -184
- package/labs/texture.js +300 -297
- package/labs/texture.js.map +1 -1
- package/labs/viewerLabs.d.ts +51 -51
- package/labs/viewerLabs.js +133 -131
- package/labs/viewerLabs.js.map +1 -1
- package/license.md +71 -0
- package/loader/modelLoader.d.ts +47 -44
- package/loader/modelLoader.js +189 -182
- package/loader/modelLoader.js.map +1 -1
- package/loader/plugins/applyMaterialConfig.d.ts +12 -12
- package/loader/plugins/applyMaterialConfig.js +15 -15
- package/loader/plugins/applyMaterialConfig.js.map +1 -1
- package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +9 -9
- package/loader/plugins/extendedMaterialLoaderPlugin.js +15 -15
- package/loader/plugins/extendedMaterialLoaderPlugin.js.map +1 -1
- package/loader/plugins/index.d.ts +18 -17
- package/loader/plugins/index.js +42 -41
- package/loader/plugins/index.js.map +1 -1
- package/loader/plugins/loaderPlugin.d.ts +24 -24
- package/loader/plugins/loaderPlugin.js +1 -1
- package/loader/plugins/loaderPlugin.js.map +1 -1
- package/loader/plugins/msftLodLoaderPlugin.d.ts +12 -12
- package/loader/plugins/msftLodLoaderPlugin.js +20 -19
- package/loader/plugins/msftLodLoaderPlugin.js.map +1 -1
- package/loader/plugins/telemetryLoaderPlugin.d.ts +12 -12
- package/loader/plugins/telemetryLoaderPlugin.js +35 -35
- package/loader/plugins/telemetryLoaderPlugin.js.map +1 -1
- package/managers/observablesManager.d.ts +66 -66
- package/managers/observablesManager.js +34 -34
- package/managers/observablesManager.js.map +1 -1
- package/managers/sceneManager.d.ts +243 -245
- package/managers/sceneManager.js +1388 -1387
- package/managers/sceneManager.js.map +1 -1
- package/managers/telemetryManager.d.ts +57 -57
- package/managers/telemetryManager.js +113 -113
- package/managers/telemetryManager.js.map +1 -1
- package/model/modelAnimation.d.ts +215 -215
- package/model/modelAnimation.js +232 -232
- package/model/modelAnimation.js.map +1 -1
- package/model/viewerModel.d.ts +228 -236
- package/model/viewerModel.js +669 -664
- package/model/viewerModel.js.map +1 -1
- package/optimizer/custom/extended.d.ts +11 -13
- package/optimizer/custom/extended.js +98 -100
- package/optimizer/custom/extended.js.map +1 -1
- package/optimizer/custom/index.d.ts +8 -8
- package/optimizer/custom/index.js +24 -24
- package/optimizer/custom/index.js.map +1 -1
- package/package.json +41 -215
- package/readme.md +12 -8
- package/renderOnlyIndex.d.ts +11 -11
- package/renderOnlyIndex.js +17 -15
- package/renderOnlyIndex.js.map +1 -1
- package/templating/eventManager.d.ts +35 -35
- package/templating/eventManager.js +65 -63
- package/templating/eventManager.js.map +1 -1
- package/templating/plugins/hdButtonPlugin.d.ts +9 -9
- package/templating/plugins/hdButtonPlugin.js +21 -34
- package/templating/plugins/hdButtonPlugin.js.map +1 -1
- package/templating/plugins/printButton.d.ts +9 -10
- package/templating/plugins/printButton.js +40 -53
- package/templating/plugins/printButton.js.map +1 -1
- package/templating/templateManager.d.ts +190 -189
- package/templating/templateManager.js +553 -543
- package/templating/templateManager.js.map +1 -1
- package/templating/viewerTemplatePlugin.d.ts +21 -21
- package/templating/viewerTemplatePlugin.js +68 -68
- package/templating/viewerTemplatePlugin.js.map +1 -1
- package/viewer/defaultViewer.d.ts +122 -116
- package/viewer/defaultViewer.js +665 -670
- package/viewer/defaultViewer.js.map +1 -1
- package/viewer/renderOnlyViewer.d.ts +8 -8
- package/viewer/renderOnlyViewer.js +43 -50
- package/viewer/renderOnlyViewer.js.map +1 -1
- package/viewer/viewer.d.ts +254 -253
- package/viewer/viewer.js +777 -763
- package/viewer/viewer.js.map +1 -1
- package/viewer/viewerManager.d.ts +55 -55
- package/viewer/viewerManager.js +87 -86
- package/viewer/viewerManager.js.map +1 -1
- package/viewer/viewerWithTemplate.d.ts +9 -9
- package/viewer/viewerWithTemplate.js +19 -32
- package/viewer/viewerWithTemplate.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadowLight.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"shadowLight.js","sourceRoot":"","sources":["../../../../../../tools/viewer/src/configuration/types/shadowLight.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,IAAM,mCAAmC,GAAwB;IACpE,KAAK,EAAE;QACH,cAAc,EAAE,IAAI;QACpB,UAAU,EAAE,IAAI;KACnB;IACD,MAAM,EAAE;QACJ,cAAc,EAAE,IAAI;KACvB;IACD,MAAM,EAAE;QACJ,sBAAsB,EAAE;YACpB,IAAI,EAAE,CAAC;YACP,aAAa,EAAE,IAAI;YACnB,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE;YAC9B,QAAQ,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE;YACxC,OAAO,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;YACzC,SAAS,EAAE,KAAK;YAChB,aAAa,EAAE,CAAC;YAChB,gBAAgB,EAAE,IAAI;YACtB,iBAAiB,EAAE,GAAG;YACtB,iBAAiB,EAAE,MAAM;YACzB,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE;gBACV,UAAU,EAAE,EAAE;gBACd,gCAAgC,EAAE,IAAI;aACzC;SACJ;KACJ;CACJ,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,IAAM,6BAA6B,GAAwB;IAC9D,KAAK,EAAE;QACH,cAAc,EAAE,IAAI;QACpB,UAAU,EAAE,IAAI;KACnB;IACD,MAAM,EAAE;QACJ,cAAc,EAAE,IAAI;KACvB;IACD,MAAM,EAAE;QACJ,eAAe,EAAE;YACb,IAAI,EAAE,CAAC;YACP,SAAS,EAAE,CAAC;YACZ,aAAa,EAAE,IAAI;YACnB,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE;YAC9B,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;YAClC,KAAK,EAAE,CAAC;YACR,gBAAgB,EAAE,GAAG;YACrB,gBAAgB,EAAE,IAAI;YACtB,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE;gBACV,kBAAkB,EAAE,GAAG;gBACvB,UAAU,EAAE,EAAE;gBACd,2BAA2B,EAAE,IAAI;aACpC;SACJ;KACJ;CACJ,CAAC","sourcesContent":["import type { ViewerConfiguration } from \"./../configuration\";\r\n\r\n/**\r\n * Defines a default directional shadow light for normalized objects (!)\r\n */\r\nexport const shadowDirectionalLightConfiguration: ViewerConfiguration = {\r\n model: {\r\n receiveShadows: true,\r\n castShadow: true,\r\n },\r\n ground: {\r\n receiveShadows: true,\r\n },\r\n lights: {\r\n shadowDirectionalLight: {\r\n type: 1,\r\n shadowEnabled: true,\r\n target: { x: 0, y: 0, z: 0.5 },\r\n position: { x: 1.49, y: 2.39, z: -1.33 },\r\n diffuse: { r: 0.867, g: 0.816, b: 0.788 },\r\n intensity: 4.887,\r\n intensityMode: 0,\r\n shadowBufferSize: 1024,\r\n shadowFrustumSize: 6.0,\r\n shadowFieldOfView: 50.977,\r\n shadowMinZ: 0.1,\r\n shadowMaxZ: 10.0,\r\n shadowConfig: {\r\n blurKernel: 32,\r\n useBlurCloseExponentialShadowMap: true,\r\n },\r\n },\r\n },\r\n};\r\n\r\n/**\r\n * Defines a default shadow-enabled spot light for normalized objects.\r\n */\r\nexport const shadowSpotlLightConfiguration: ViewerConfiguration = {\r\n model: {\r\n receiveShadows: true,\r\n castShadow: true,\r\n },\r\n ground: {\r\n receiveShadows: true,\r\n },\r\n lights: {\r\n shadowSpotLight: {\r\n type: 2,\r\n intensity: 2,\r\n shadowEnabled: true,\r\n target: { x: 0, y: 0, z: 0.5 },\r\n position: { x: 0, y: 3.5, z: 3.7 },\r\n angle: 1,\r\n shadowOrthoScale: 0.5,\r\n shadowBufferSize: 1024,\r\n shadowMinZ: 0.1,\r\n shadowMaxZ: 50.0,\r\n shadowConfig: {\r\n frustumEdgeFalloff: 0.5,\r\n blurKernel: 32,\r\n useBlurExponentialShadowMap: true,\r\n },\r\n },\r\n },\r\n};\r\n"]}
|
package/helper/index.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
declare
|
|
2
|
-
export { expDm as deepmerge };
|
|
3
|
-
/**
|
|
4
|
-
* Is the provided string a URL?
|
|
5
|
-
*
|
|
6
|
-
* @param urlToCheck the url to inspect
|
|
7
|
-
*/
|
|
8
|
-
export declare function isUrl(urlToCheck: string): boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Convert a string from kebab-case to camelCase
|
|
11
|
-
* @param s string to convert
|
|
12
|
-
*/
|
|
13
|
-
export declare function kebabToCamel(s:
|
|
14
|
-
/**
|
|
15
|
-
* Convert a string from camelCase to kebab-case
|
|
16
|
-
* @param str string to convert
|
|
17
|
-
*/
|
|
18
|
-
export declare function camelToKebab(str:
|
|
19
|
-
/**
|
|
20
|
-
* This will extend an object with configuration values.
|
|
21
|
-
* What it practically does it take the keys from the configuration and set them on the object.
|
|
22
|
-
* If the configuration is a tree, it will traverse into the tree.
|
|
23
|
-
* @param object the object to extend
|
|
24
|
-
* @param config the configuration object that will extend the object
|
|
25
|
-
*/
|
|
26
|
-
export declare function extendClassWithConfig(object: any, config: any): void;
|
|
1
|
+
declare const expDm: Ideepmerge;
|
|
2
|
+
export { expDm as deepmerge };
|
|
3
|
+
/**
|
|
4
|
+
* Is the provided string a URL?
|
|
5
|
+
*
|
|
6
|
+
* @param urlToCheck the url to inspect
|
|
7
|
+
*/
|
|
8
|
+
export declare function isUrl(urlToCheck: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Convert a string from kebab-case to camelCase
|
|
11
|
+
* @param s string to convert
|
|
12
|
+
*/
|
|
13
|
+
export declare function kebabToCamel(s: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Convert a string from camelCase to kebab-case
|
|
16
|
+
* @param str string to convert
|
|
17
|
+
*/
|
|
18
|
+
export declare function camelToKebab(str: string): string | null;
|
|
19
|
+
/**
|
|
20
|
+
* This will extend an object with configuration values.
|
|
21
|
+
* What it practically does it take the keys from the configuration and set them on the object.
|
|
22
|
+
* If the configuration is a tree, it will traverse into the tree.
|
|
23
|
+
* @param object the object to extend
|
|
24
|
+
* @param config the configuration object that will extend the object
|
|
25
|
+
*/
|
|
26
|
+
export declare function extendClassWithConfig(object: any, config: any): void;
|
package/helper/index.js
CHANGED
|
@@ -1,57 +1,63 @@
|
|
|
1
|
-
import * as deepmerge from
|
|
2
|
-
var expDm = deepmerge[
|
|
3
|
-
export { expDm as deepmerge };
|
|
4
|
-
/**
|
|
5
|
-
* Is the provided string a URL?
|
|
6
|
-
*
|
|
7
|
-
* @param urlToCheck the url to inspect
|
|
8
|
-
*/
|
|
9
|
-
export function isUrl(urlToCheck) {
|
|
10
|
-
if (urlToCheck.indexOf(
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Convert a string from kebab-case to camelCase
|
|
17
|
-
* @param s string to convert
|
|
18
|
-
*/
|
|
19
|
-
export function kebabToCamel(s) {
|
|
20
|
-
return s.replace(/(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
import * as deepmerge from "deepmerge";
|
|
2
|
+
var expDm = deepmerge["default"];
|
|
3
|
+
export { expDm as deepmerge };
|
|
4
|
+
/**
|
|
5
|
+
* Is the provided string a URL?
|
|
6
|
+
*
|
|
7
|
+
* @param urlToCheck the url to inspect
|
|
8
|
+
*/
|
|
9
|
+
export function isUrl(urlToCheck) {
|
|
10
|
+
if (urlToCheck.indexOf("http") === 0 || urlToCheck.indexOf("/") === 0 || urlToCheck.indexOf("./") === 0 || urlToCheck.indexOf("../") === 0) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Convert a string from kebab-case to camelCase
|
|
17
|
+
* @param s string to convert
|
|
18
|
+
*/
|
|
19
|
+
export function kebabToCamel(s) {
|
|
20
|
+
return s.replace(/(-\w)/g, function (m) {
|
|
21
|
+
return m[1].toUpperCase();
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//https://gist.github.com/youssman/745578062609e8acac9f
|
|
25
|
+
/**
|
|
26
|
+
* Convert a string from camelCase to kebab-case
|
|
27
|
+
* @param str string to convert
|
|
28
|
+
*/
|
|
29
|
+
export function camelToKebab(str) {
|
|
30
|
+
return !str
|
|
31
|
+
? null
|
|
32
|
+
: str.replace(/([A-Z])/g, function (g) {
|
|
33
|
+
return "-" + g[0].toLowerCase();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* This will extend an object with configuration values.
|
|
38
|
+
* What it practically does it take the keys from the configuration and set them on the object.
|
|
39
|
+
* If the configuration is a tree, it will traverse into the tree.
|
|
40
|
+
* @param object the object to extend
|
|
41
|
+
* @param config the configuration object that will extend the object
|
|
42
|
+
*/
|
|
43
|
+
export function extendClassWithConfig(object, config) {
|
|
44
|
+
if (!config || typeof config !== "object") {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
Object.keys(config).forEach(function (key) {
|
|
48
|
+
if (key in object && typeof object[key] !== "function") {
|
|
49
|
+
// if (typeof object[key] === 'function') return;
|
|
50
|
+
// if it is an object, iterate internally until reaching basic types
|
|
51
|
+
// but null is an object so if its null and config[key] is not an object eg. number, the number should be set
|
|
52
|
+
if (typeof object[key] === "object" && (object[key] !== null || typeof config[key] === "object")) {
|
|
53
|
+
extendClassWithConfig(object[key], config[key]);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
if (config[key] !== undefined) {
|
|
57
|
+
object[key] = config[key];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
57
63
|
//# sourceMappingURL=index.js.map
|
package/helper/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../tools/viewer/src/helper/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AAEvC,IAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;AACnC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,CAAC;AAE9B;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,UAAkB;IACpC,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QACxI,OAAO,IAAI,CAAC;KACf;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,CAAS;IAClC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC;QAClC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;AACP,CAAC;AAED,uDAAuD;AACvD;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACpC,OAAO,CAAC,GAAG;QACP,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC;YAC/B,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACpC,CAAC,CAAC,CAAC;AACb,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAW,EAAE,MAAW;IAC1D,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QACvC,OAAO;KACV;IACD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,UAAU,GAAG;QACrC,IAAI,GAAG,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,UAAU,EAAE;YACpD,iDAAiD;YACjD,oEAAoE;YACpE,6GAA6G;YAC7G,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,EAAE;gBAC9F,qBAAqB,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;aACnD;iBAAM;gBACH,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE;oBAC3B,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;iBAC7B;aACJ;SACJ;IACL,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import * as deepmerge from \"deepmerge\";\r\n\r\nconst expDm = deepmerge[\"default\"];\r\nexport { expDm as deepmerge };\r\n\r\n/**\r\n * Is the provided string a URL?\r\n *\r\n * @param urlToCheck the url to inspect\r\n */\r\nexport function isUrl(urlToCheck: string): boolean {\r\n if (urlToCheck.indexOf(\"http\") === 0 || urlToCheck.indexOf(\"/\") === 0 || urlToCheck.indexOf(\"./\") === 0 || urlToCheck.indexOf(\"../\") === 0) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Convert a string from kebab-case to camelCase\r\n * @param s string to convert\r\n */\r\nexport function kebabToCamel(s: string) {\r\n return s.replace(/(-\\w)/g, function (m) {\r\n return m[1].toUpperCase();\r\n });\r\n}\r\n\r\n//https://gist.github.com/youssman/745578062609e8acac9f\r\n/**\r\n * Convert a string from camelCase to kebab-case\r\n * @param str string to convert\r\n */\r\nexport function camelToKebab(str: string) {\r\n return !str\r\n ? null\r\n : str.replace(/([A-Z])/g, function (g) {\r\n return \"-\" + g[0].toLowerCase();\r\n });\r\n}\r\n\r\n/**\r\n * This will extend an object with configuration values.\r\n * What it practically does it take the keys from the configuration and set them on the object.\r\n * If the configuration is a tree, it will traverse into the tree.\r\n * @param object the object to extend\r\n * @param config the configuration object that will extend the object\r\n */\r\nexport function extendClassWithConfig(object: any, config: any) {\r\n if (!config || typeof config !== \"object\") {\r\n return;\r\n }\r\n Object.keys(config).forEach(function (key) {\r\n if (key in object && typeof object[key] !== \"function\") {\r\n // if (typeof object[key] === 'function') return;\r\n // if it is an object, iterate internally until reaching basic types\r\n // but null is an object so if its null and config[key] is not an object eg. number, the number should be set\r\n if (typeof object[key] === \"object\" && (object[key] !== null || typeof config[key] === \"object\")) {\r\n extendClassWithConfig(object[key], config[key]);\r\n } else {\r\n if (config[key] !== undefined) {\r\n object[key] = config[key];\r\n }\r\n }\r\n }\r\n });\r\n}\r\n"]}
|
package/index.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { mapperManager } from
|
|
2
|
-
import { viewerGlobals } from
|
|
3
|
-
import { viewerManager } from
|
|
4
|
-
import { DefaultViewer } from
|
|
5
|
-
import { AbstractViewer } from
|
|
6
|
-
import { telemetryManager } from
|
|
7
|
-
import { ModelLoader } from
|
|
8
|
-
import { ViewerModel, ModelState } from
|
|
9
|
-
import { AnimationPlayMode, AnimationState } from
|
|
10
|
-
import { ILoaderPlugin } from
|
|
11
|
-
import { AbstractViewerNavbarButton } from
|
|
12
|
-
import { registerCustomOptimizer } from
|
|
13
|
-
/**
|
|
14
|
-
* BabylonJS Viewer
|
|
15
|
-
*
|
|
16
|
-
* An HTML-Based viewer for 3D models, based on BabylonJS and its extensions.
|
|
17
|
-
*/
|
|
18
|
-
import * as BABYLON from
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { InitTags } from
|
|
22
|
-
declare
|
|
23
|
-
/**
|
|
24
|
-
* Dispose all viewers currently registered
|
|
25
|
-
*/
|
|
26
|
-
declare function disposeAll(): void;
|
|
27
|
-
declare const Version: string;
|
|
28
|
-
export { BABYLON, Version, InitTags, DefaultViewer, AbstractViewer, viewerGlobals, telemetryManager, disableInit, viewerManager, mapperManager, disposeAll, ModelLoader, ViewerModel, AnimationPlayMode, AnimationState, ModelState, ILoaderPlugin, AbstractViewerNavbarButton, registerCustomOptimizer };
|
|
29
|
-
export { GLTF2 } from
|
|
30
|
-
export * from
|
|
1
|
+
import { mapperManager } from "./configuration/mappers";
|
|
2
|
+
import { viewerGlobals } from "./configuration/globals";
|
|
3
|
+
import { viewerManager } from "./viewer/viewerManager";
|
|
4
|
+
import { DefaultViewer } from "./viewer/defaultViewer";
|
|
5
|
+
import { AbstractViewer } from "./viewer/viewer";
|
|
6
|
+
import { telemetryManager } from "./managers/telemetryManager";
|
|
7
|
+
import { ModelLoader } from "./loader/modelLoader";
|
|
8
|
+
import { ViewerModel, ModelState } from "./model/viewerModel";
|
|
9
|
+
import { AnimationPlayMode, AnimationState } from "./model/modelAnimation";
|
|
10
|
+
import { ILoaderPlugin } from "./loader/plugins/loaderPlugin";
|
|
11
|
+
import { AbstractViewerNavbarButton } from "./templating/viewerTemplatePlugin";
|
|
12
|
+
import { registerCustomOptimizer } from "./optimizer/custom/index";
|
|
13
|
+
/**
|
|
14
|
+
* BabylonJS Viewer
|
|
15
|
+
*
|
|
16
|
+
* An HTML-Based viewer for 3D models, based on BabylonJS and its extensions.
|
|
17
|
+
*/
|
|
18
|
+
import * as BABYLON from "@babylonjs/core/index.js";
|
|
19
|
+
import "@babylonjs/loaders/.js";
|
|
20
|
+
import "pepjs";
|
|
21
|
+
import { InitTags } from "./initializer";
|
|
22
|
+
declare const disableInit: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Dispose all viewers currently registered
|
|
25
|
+
*/
|
|
26
|
+
declare function disposeAll(): void;
|
|
27
|
+
declare const Version: string;
|
|
28
|
+
export { BABYLON, Version, InitTags, DefaultViewer, AbstractViewer, viewerGlobals, telemetryManager, disableInit, viewerManager, mapperManager, disposeAll, ModelLoader, ViewerModel, AnimationPlayMode, AnimationState, ModelState, ILoaderPlugin, AbstractViewerNavbarButton, registerCustomOptimizer, };
|
|
29
|
+
export { GLTF2 } from "@babylonjs/loaders/glTF/index.js";
|
|
30
|
+
export * from "./configuration/index";
|
package/index.js
CHANGED
|
@@ -1,42 +1,46 @@
|
|
|
1
|
-
import { mapperManager } from
|
|
2
|
-
import { viewerGlobals } from
|
|
3
|
-
import { viewerManager } from
|
|
4
|
-
import { DefaultViewer } from
|
|
5
|
-
import { AbstractViewer } from
|
|
6
|
-
import { telemetryManager } from
|
|
7
|
-
import { ModelLoader } from
|
|
8
|
-
import { ViewerModel, ModelState } from
|
|
9
|
-
import { AnimationPlayMode, AnimationState } from
|
|
10
|
-
import { AbstractViewerNavbarButton } from
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
import { mapperManager } from "./configuration/mappers.js";
|
|
2
|
+
import { viewerGlobals } from "./configuration/globals.js";
|
|
3
|
+
import { viewerManager } from "./viewer/viewerManager.js";
|
|
4
|
+
import { DefaultViewer } from "./viewer/defaultViewer.js";
|
|
5
|
+
import { AbstractViewer } from "./viewer/viewer.js";
|
|
6
|
+
import { telemetryManager } from "./managers/telemetryManager.js";
|
|
7
|
+
import { ModelLoader } from "./loader/modelLoader.js";
|
|
8
|
+
import { ViewerModel, ModelState } from "./model/viewerModel.js";
|
|
9
|
+
import { AnimationPlayMode, AnimationState } from "./model/modelAnimation.js";
|
|
10
|
+
import { AbstractViewerNavbarButton } from "./templating/viewerTemplatePlugin.js";
|
|
11
|
+
// eslint-disable-next-line import/no-internal-modules
|
|
12
|
+
import { registerCustomOptimizer } from "./optimizer/custom/index.js";
|
|
13
|
+
/**
|
|
14
|
+
* BabylonJS Viewer
|
|
15
|
+
*
|
|
16
|
+
* An HTML-Based viewer for 3D models, based on BabylonJS and its extensions.
|
|
17
|
+
*/
|
|
18
|
+
// eslint-disable-next-line import/no-internal-modules
|
|
19
|
+
import * as BABYLON from "@babylonjs/core/index.js";
|
|
20
|
+
// load needed modules.
|
|
21
|
+
import "@babylonjs/loaders/.js";
|
|
22
|
+
import "pepjs";
|
|
23
|
+
import { initListeners, InitTags } from "./initializer.js";
|
|
24
|
+
// promise polyfill, if needed!
|
|
25
|
+
BABYLON.PromisePolyfill.Apply();
|
|
26
|
+
initListeners();
|
|
27
|
+
//deprectaed, here for backwards compatibility
|
|
28
|
+
var disableInit = viewerGlobals.disableInit;
|
|
29
|
+
/**
|
|
30
|
+
* Dispose all viewers currently registered
|
|
31
|
+
*/
|
|
32
|
+
function disposeAll() {
|
|
33
|
+
viewerManager.dispose();
|
|
34
|
+
mapperManager.dispose();
|
|
35
|
+
telemetryManager.dispose();
|
|
36
|
+
}
|
|
37
|
+
var Version = viewerGlobals.version;
|
|
38
|
+
console.log("Babylon.js viewer (v" + Version + ")");
|
|
39
|
+
// public API for initialization
|
|
40
|
+
export { BABYLON, Version, InitTags, DefaultViewer, AbstractViewer, viewerGlobals, telemetryManager, disableInit, viewerManager, mapperManager, disposeAll, ModelLoader, ViewerModel, AnimationPlayMode, AnimationState, ModelState, AbstractViewerNavbarButton, registerCustomOptimizer, };
|
|
41
|
+
// eslint-disable-next-line import/no-internal-modules
|
|
42
|
+
export { GLTF2 } from "@babylonjs/loaders/glTF/index.js";
|
|
43
|
+
// export publicliy all configuration interfaces
|
|
44
|
+
// eslint-disable-next-line import/no-internal-modules
|
|
45
|
+
export * from "./configuration/index.js";
|
|
42
46
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../tools/viewer/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,sDAAsD;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE;;;;GAIG;AAEH,sDAAsD;AACtD,OAAO,KAAK,OAAO,iCAAmB;AAEtC,uBAAuB;AACvB,gCAAiB;AACjB,OAAO,OAAO,CAAC;AAEf,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAExD,+BAA+B;AAC/B,OAAO,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;AAChC,aAAa,EAAE,CAAC;AAEhB,8CAA8C;AAC9C,IAAM,WAAW,GAAY,aAAa,CAAC,WAAW,CAAC;AAEvD;;GAEG;AACH,SAAS,UAAU;IACf,aAAa,CAAC,OAAO,EAAE,CAAC;IACxB,aAAa,CAAC,OAAO,EAAE,CAAC;IACxB,gBAAgB,CAAC,OAAO,EAAE,CAAC;AAC/B,CAAC;AAED,IAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;AAEtC,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,OAAO,GAAG,GAAG,CAAC,CAAC;AAEpD,gCAAgC;AAChC,OAAO,EACH,OAAO,EACP,OAAO,EACP,QAAQ,EACR,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,UAAU,EAEV,0BAA0B,EAC1B,uBAAuB,GAC1B,CAAC;AACF,sDAAsD;AACtD,OAAO,EAAE,KAAK,EAAE,yCAA2B;AAC3C,gDAAgD;AAChD,sDAAsD;AACtD,cAAc,uBAAuB,CAAC","sourcesContent":["import { mapperManager } from \"./configuration/mappers\";\r\nimport { viewerGlobals } from \"./configuration/globals\";\r\nimport { viewerManager } from \"./viewer/viewerManager\";\r\nimport { DefaultViewer } from \"./viewer/defaultViewer\";\r\nimport { AbstractViewer } from \"./viewer/viewer\";\r\nimport { telemetryManager } from \"./managers/telemetryManager\";\r\nimport { ModelLoader } from \"./loader/modelLoader\";\r\nimport { ViewerModel, ModelState } from \"./model/viewerModel\";\r\nimport { AnimationPlayMode, AnimationState } from \"./model/modelAnimation\";\r\nimport { ILoaderPlugin } from \"./loader/plugins/loaderPlugin\";\r\nimport { AbstractViewerNavbarButton } from \"./templating/viewerTemplatePlugin\";\r\n// eslint-disable-next-line import/no-internal-modules\r\nimport { registerCustomOptimizer } from \"./optimizer/custom/index\";\r\n\r\n/**\r\n * BabylonJS Viewer\r\n *\r\n * An HTML-Based viewer for 3D models, based on BabylonJS and its extensions.\r\n */\r\n\r\n// eslint-disable-next-line import/no-internal-modules\r\nimport * as BABYLON from \"core/index\";\r\n\r\n// load needed modules.\r\nimport \"loaders\";\r\nimport \"pepjs\";\r\n\r\nimport { initListeners, InitTags } from \"./initializer\";\r\n\r\n// promise polyfill, if needed!\r\nBABYLON.PromisePolyfill.Apply();\r\ninitListeners();\r\n\r\n//deprectaed, here for backwards compatibility\r\nconst disableInit: boolean = viewerGlobals.disableInit;\r\n\r\n/**\r\n * Dispose all viewers currently registered\r\n */\r\nfunction disposeAll() {\r\n viewerManager.dispose();\r\n mapperManager.dispose();\r\n telemetryManager.dispose();\r\n}\r\n\r\nconst Version = viewerGlobals.version;\r\n\r\nconsole.log(\"Babylon.js viewer (v\" + Version + \")\");\r\n\r\n// public API for initialization\r\nexport {\r\n BABYLON,\r\n Version,\r\n InitTags,\r\n DefaultViewer,\r\n AbstractViewer,\r\n viewerGlobals,\r\n telemetryManager,\r\n disableInit,\r\n viewerManager,\r\n mapperManager,\r\n disposeAll,\r\n ModelLoader,\r\n ViewerModel,\r\n AnimationPlayMode,\r\n AnimationState,\r\n ModelState,\r\n ILoaderPlugin,\r\n AbstractViewerNavbarButton,\r\n registerCustomOptimizer,\r\n};\r\n// eslint-disable-next-line import/no-internal-modules\r\nexport { GLTF2 } from \"loaders/glTF/index\";\r\n// export publicliy all configuration interfaces\r\n// eslint-disable-next-line import/no-internal-modules\r\nexport * from \"./configuration/index\";\r\n"]}
|
package/initializer.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Will attach an init function the the DOMContentLoaded event.
|
|
3
|
-
* The init function will be removed automatically after the event was triggered.
|
|
4
|
-
*/
|
|
5
|
-
export declare function initListeners(): void;
|
|
6
|
-
/**
|
|
7
|
-
* Select all HTML tags on the page that match the selector and initialize a viewer
|
|
8
|
-
*
|
|
9
|
-
* @param selector the selector to initialize the viewer on (default is 'babylon')
|
|
10
|
-
*/
|
|
11
|
-
export declare function InitTags(selector?: string): void;
|
|
1
|
+
/**
|
|
2
|
+
* Will attach an init function the the DOMContentLoaded event.
|
|
3
|
+
* The init function will be removed automatically after the event was triggered.
|
|
4
|
+
*/
|
|
5
|
+
export declare function initListeners(): void;
|
|
6
|
+
/**
|
|
7
|
+
* Select all HTML tags on the page that match the selector and initialize a viewer
|
|
8
|
+
*
|
|
9
|
+
* @param selector the selector to initialize the viewer on (default is 'babylon')
|
|
10
|
+
*/
|
|
11
|
+
export declare function InitTags(selector?: string): void;
|
package/initializer.js
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { DefaultViewer } from
|
|
2
|
-
import { mapperManager } from
|
|
3
|
-
import { viewerGlobals } from
|
|
4
|
-
/**
|
|
5
|
-
* Will attach an init function the the DOMContentLoaded event.
|
|
6
|
-
* The init function will be removed automatically after the event was triggered.
|
|
7
|
-
*/
|
|
8
|
-
export function initListeners() {
|
|
9
|
-
document.addEventListener("DOMContentLoaded", init);
|
|
10
|
-
function init(
|
|
11
|
-
document.removeEventListener("DOMContentLoaded", init);
|
|
12
|
-
if (viewerGlobals.disableInit) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
InitTags();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Select all HTML tags on the page that match the selector and initialize a viewer
|
|
20
|
-
*
|
|
21
|
-
* @param selector the selector to initialize the viewer on (default is 'babylon')
|
|
22
|
-
*/
|
|
23
|
-
export function InitTags(selector) {
|
|
24
|
-
if (selector === void 0) { selector =
|
|
25
|
-
var elements = document.querySelectorAll(selector);
|
|
26
|
-
for (var i = 0; i < elements.length; ++i) {
|
|
27
|
-
var element = elements.item(i);
|
|
28
|
-
// get the html configuration
|
|
29
|
-
var configMapper = mapperManager.getMapper(
|
|
30
|
-
var config = configMapper.map(element);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
1
|
+
import { DefaultViewer } from "./viewer/defaultViewer.js";
|
|
2
|
+
import { mapperManager } from "./configuration/mappers.js";
|
|
3
|
+
import { viewerGlobals } from "./configuration/globals.js";
|
|
4
|
+
/**
|
|
5
|
+
* Will attach an init function the the DOMContentLoaded event.
|
|
6
|
+
* The init function will be removed automatically after the event was triggered.
|
|
7
|
+
*/
|
|
8
|
+
export function initListeners() {
|
|
9
|
+
document.addEventListener("DOMContentLoaded", init);
|
|
10
|
+
function init() {
|
|
11
|
+
document.removeEventListener("DOMContentLoaded", init);
|
|
12
|
+
if (viewerGlobals.disableInit) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
InitTags();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Select all HTML tags on the page that match the selector and initialize a viewer
|
|
20
|
+
*
|
|
21
|
+
* @param selector the selector to initialize the viewer on (default is 'babylon')
|
|
22
|
+
*/
|
|
23
|
+
export function InitTags(selector) {
|
|
24
|
+
if (selector === void 0) { selector = "babylon"; }
|
|
25
|
+
var elements = document.querySelectorAll(selector);
|
|
26
|
+
for (var i = 0; i < elements.length; ++i) {
|
|
27
|
+
var element = elements.item(i);
|
|
28
|
+
// get the html configuration
|
|
29
|
+
var configMapper = mapperManager.getMapper("dom");
|
|
30
|
+
var config = configMapper.map(element);
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
32
|
+
new DefaultViewer(element, config);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
34
35
|
//# sourceMappingURL=initializer.js.map
|
package/initializer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializer.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"initializer.js","sourceRoot":"","sources":["../../../../tools/viewer/src/initializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;;GAGG;AACH,MAAM,UAAU,aAAa;IACzB,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;IACpD,SAAS,IAAI;QACT,QAAQ,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;QACvD,IAAI,aAAa,CAAC,WAAW,EAAE;YAC3B,OAAO;SACV;QACD,QAAQ,EAAE,CAAC;IACf,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,QAA4B;IAA5B,yBAAA,EAAA,oBAA4B;IACjD,IAAM,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACrD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QACtC,IAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAEjC,6BAA6B;QAC7B,IAAM,YAAY,GAAG,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACpD,IAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAEzC,6DAA6D;QAC7D,IAAI,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACtC;AACL,CAAC","sourcesContent":["import { DefaultViewer } from \"./viewer/defaultViewer\";\r\nimport { mapperManager } from \"./configuration/mappers\";\r\nimport { viewerGlobals } from \"./configuration/globals\";\r\n\r\n/**\r\n * Will attach an init function the the DOMContentLoaded event.\r\n * The init function will be removed automatically after the event was triggered.\r\n */\r\nexport function initListeners() {\r\n document.addEventListener(\"DOMContentLoaded\", init);\r\n function init() {\r\n document.removeEventListener(\"DOMContentLoaded\", init);\r\n if (viewerGlobals.disableInit) {\r\n return;\r\n }\r\n InitTags();\r\n }\r\n}\r\n\r\n/**\r\n * Select all HTML tags on the page that match the selector and initialize a viewer\r\n *\r\n * @param selector the selector to initialize the viewer on (default is 'babylon')\r\n */\r\nexport function InitTags(selector: string = \"babylon\") {\r\n const elements = document.querySelectorAll(selector);\r\n for (let i = 0; i < elements.length; ++i) {\r\n const element = elements.item(i);\r\n\r\n // get the html configuration\r\n const configMapper = mapperManager.getMapper(\"dom\");\r\n const config = configMapper.map(element);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n new DefaultViewer(element, config);\r\n }\r\n}\r\n"]}
|
package/interfaces.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const enum CameraBehavior {
|
|
2
|
-
AUTOROTATION = 0,
|
|
3
|
-
BOUNCING = 1,
|
|
4
|
-
FRAMING = 2
|
|
5
|
-
}
|
|
1
|
+
export declare const enum CameraBehavior {
|
|
2
|
+
AUTOROTATION = 0,
|
|
3
|
+
BOUNCING = 1,
|
|
4
|
+
FRAMING = 2
|
|
5
|
+
}
|
package/interfaces.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=interfaces.js.map
|
package/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../tools/viewer/src/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["export const enum CameraBehavior {\r\n AUTOROTATION,\r\n BOUNCING,\r\n FRAMING,\r\n}\r\n"]}
|