@babylonjs/viewer 5.0.0 → 5.0.3

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.
Files changed (127) hide show
  1. package/configuration/configuration.d.ts +107 -107
  2. package/configuration/configuration.js +15 -15
  3. package/configuration/configurationCompatibility.d.ts +8 -8
  4. package/configuration/configurationCompatibility.js +65 -65
  5. package/configuration/configurationContainer.d.ts +10 -10
  6. package/configuration/configurationContainer.js +9 -9
  7. package/configuration/globals.d.ts +6 -6
  8. package/configuration/globals.js +17 -17
  9. package/configuration/index.d.ts +2 -2
  10. package/configuration/index.js +3 -3
  11. package/configuration/interfaces/cameraConfiguration.d.ts +31 -31
  12. package/configuration/interfaces/cameraConfiguration.js +1 -1
  13. package/configuration/interfaces/colorGradingConfiguration.d.ts +81 -81
  14. package/configuration/interfaces/colorGradingConfiguration.js +1 -1
  15. package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +20 -20
  16. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +1 -1
  17. package/configuration/interfaces/environmentMapConfiguration.d.ts +22 -22
  18. package/configuration/interfaces/environmentMapConfiguration.js +1 -1
  19. package/configuration/interfaces/groundConfiguration.d.ts +24 -24
  20. package/configuration/interfaces/groundConfiguration.js +1 -1
  21. package/configuration/interfaces/imageProcessingConfiguration.d.ts +43 -43
  22. package/configuration/interfaces/imageProcessingConfiguration.js +1 -1
  23. package/configuration/interfaces/index.d.ts +15 -15
  24. package/configuration/interfaces/index.js +15 -15
  25. package/configuration/interfaces/lightConfiguration.d.ts +60 -60
  26. package/configuration/interfaces/lightConfiguration.js +1 -1
  27. package/configuration/interfaces/modelAnimationConfiguration.d.ts +26 -26
  28. package/configuration/interfaces/modelAnimationConfiguration.js +1 -1
  29. package/configuration/interfaces/modelConfiguration.d.ts +65 -65
  30. package/configuration/interfaces/modelConfiguration.js +1 -1
  31. package/configuration/interfaces/observersConfiguration.d.ts +5 -5
  32. package/configuration/interfaces/observersConfiguration.js +1 -1
  33. package/configuration/interfaces/sceneConfiguration.d.ts +48 -48
  34. package/configuration/interfaces/sceneConfiguration.js +1 -1
  35. package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +23 -23
  36. package/configuration/interfaces/sceneOptimizerConfiguration.js +1 -1
  37. package/configuration/interfaces/skyboxConfiguration.d.ts +21 -21
  38. package/configuration/interfaces/skyboxConfiguration.js +1 -1
  39. package/configuration/interfaces/templateConfiguration.d.ts +67 -67
  40. package/configuration/interfaces/templateConfiguration.js +1 -1
  41. package/configuration/interfaces/vrConfiguration.d.ts +16 -16
  42. package/configuration/interfaces/vrConfiguration.js +1 -1
  43. package/configuration/loader.d.ts +4 -4
  44. package/configuration/loader.js +16 -16
  45. package/configuration/mappers.d.ts +42 -42
  46. package/configuration/mappers.js +190 -190
  47. package/configuration/renderOnlyLoader.d.ts +33 -33
  48. package/configuration/renderOnlyLoader.js +161 -161
  49. package/configuration/types/default.d.ts +6 -6
  50. package/configuration/types/default.js +120 -120
  51. package/configuration/types/environmentMap.d.ts +5 -5
  52. package/configuration/types/environmentMap.js +13 -13
  53. package/configuration/types/extended.d.ts +6 -6
  54. package/configuration/types/extended.js +316 -316
  55. package/configuration/types/index.d.ts +13 -13
  56. package/configuration/types/index.js +49 -49
  57. package/configuration/types/minimal.d.ts +6 -6
  58. package/configuration/types/minimal.js +42 -42
  59. package/configuration/types/renderOnlyDefault.d.ts +30 -30
  60. package/configuration/types/renderOnlyDefault.js +30 -30
  61. package/configuration/types/shadowLight.d.ts +9 -9
  62. package/configuration/types/shadowLight.js +63 -63
  63. package/helper/index.d.ts +26 -26
  64. package/helper/index.js +62 -62
  65. package/index.d.ts +30 -30
  66. package/index.js +45 -45
  67. package/initializer.d.ts +11 -11
  68. package/initializer.js +34 -34
  69. package/interfaces.d.ts +5 -5
  70. package/interfaces.js +1 -1
  71. package/labs/environmentSerializer.d.ts +126 -126
  72. package/labs/environmentSerializer.js +190 -190
  73. package/labs/texture.d.ts +183 -183
  74. package/labs/texture.js +300 -300
  75. package/labs/viewerLabs.d.ts +51 -51
  76. package/labs/viewerLabs.js +133 -133
  77. package/loader/modelLoader.d.ts +47 -47
  78. package/loader/modelLoader.js +189 -189
  79. package/loader/plugins/applyMaterialConfig.d.ts +12 -12
  80. package/loader/plugins/applyMaterialConfig.js +15 -15
  81. package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +9 -9
  82. package/loader/plugins/extendedMaterialLoaderPlugin.js +15 -15
  83. package/loader/plugins/index.d.ts +18 -18
  84. package/loader/plugins/index.js +42 -42
  85. package/loader/plugins/loaderPlugin.d.ts +24 -24
  86. package/loader/plugins/loaderPlugin.js +1 -1
  87. package/loader/plugins/msftLodLoaderPlugin.d.ts +12 -12
  88. package/loader/plugins/msftLodLoaderPlugin.js +20 -20
  89. package/loader/plugins/telemetryLoaderPlugin.d.ts +12 -12
  90. package/loader/plugins/telemetryLoaderPlugin.js +35 -35
  91. package/managers/observablesManager.d.ts +66 -66
  92. package/managers/observablesManager.js +34 -34
  93. package/managers/sceneManager.d.ts +243 -243
  94. package/managers/sceneManager.js +1388 -1388
  95. package/managers/telemetryManager.d.ts +57 -57
  96. package/managers/telemetryManager.js +113 -113
  97. package/model/modelAnimation.d.ts +215 -215
  98. package/model/modelAnimation.js +232 -232
  99. package/model/viewerModel.d.ts +228 -228
  100. package/model/viewerModel.js +669 -669
  101. package/optimizer/custom/extended.d.ts +11 -11
  102. package/optimizer/custom/extended.js +98 -98
  103. package/optimizer/custom/index.d.ts +8 -8
  104. package/optimizer/custom/index.js +24 -24
  105. package/package.json +5 -5
  106. package/renderOnlyIndex.d.ts +11 -11
  107. package/renderOnlyIndex.js +17 -17
  108. package/templating/eventManager.d.ts +35 -35
  109. package/templating/eventManager.js +65 -65
  110. package/templating/plugins/hdButtonPlugin.d.ts +9 -9
  111. package/templating/plugins/hdButtonPlugin.js +21 -21
  112. package/templating/plugins/printButton.d.ts +9 -9
  113. package/templating/plugins/printButton.js +40 -40
  114. package/templating/templateManager.d.ts +190 -190
  115. package/templating/templateManager.js +553 -553
  116. package/templating/viewerTemplatePlugin.d.ts +21 -21
  117. package/templating/viewerTemplatePlugin.js +68 -68
  118. package/viewer/defaultViewer.d.ts +122 -122
  119. package/viewer/defaultViewer.js +665 -665
  120. package/viewer/renderOnlyViewer.d.ts +8 -8
  121. package/viewer/renderOnlyViewer.js +43 -43
  122. package/viewer/viewer.d.ts +254 -254
  123. package/viewer/viewer.js +777 -777
  124. package/viewer/viewerManager.d.ts +55 -55
  125. package/viewer/viewerManager.js +87 -87
  126. package/viewer/viewerWithTemplate.d.ts +9 -9
  127. package/viewer/viewerWithTemplate.js +19 -19
@@ -1,57 +1,57 @@
1
- import { Observable } from "@babylonjs/core/Misc/observable.js";
2
- import type { Engine } from "@babylonjs/core/Engines/engine.js";
3
- /**
4
- * The data structure of a telemetry event.
5
- */
6
- export interface TelemetryData {
7
- event: string;
8
- session: string;
9
- date: Date;
10
- now: number;
11
- viewerId?: string;
12
- detail: any;
13
- }
14
- /**
15
- * Receives Telemetry events and raises events to the API
16
- */
17
- export declare class TelemetryManager {
18
- onEventBroadcastedObservable: Observable<TelemetryData>;
19
- private _currentSessionId;
20
- private _event;
21
- /**
22
- * Receives a telemetry event
23
- */
24
- get broadcast(): (event: string, viewerId?: string | undefined, details?: any) => void;
25
- /**
26
- * Log a Telemetry event for errors raised on the WebGL context.
27
- * @param engine The Babylon engine with the WebGL context.
28
- * @param viewerId
29
- */
30
- flushWebGLErrors(engine: Engine, viewerId?: string): void;
31
- /**
32
- * Enable or disable telemetry events
33
- * @param enabled Boolean, true if events are enabled
34
- */
35
- set enable(enabled: boolean);
36
- /**
37
- * Called on event when disabled, typically do nothing here
38
- */
39
- private _eventDisabled;
40
- /**
41
- * Called on event when enabled
42
- * @param event - The name of the Telemetry event
43
- * @param viewerId
44
- * @param details An additional value, or an object containing a list of property/value pairs
45
- */
46
- private _eventEnabled;
47
- /**
48
- * Returns the current session ID or creates one if it doesn't exist
49
- * @return The current session ID
50
- */
51
- get session(): string;
52
- /**
53
- * Disposes the telemetry manager
54
- */
55
- dispose(): void;
56
- }
57
- export declare const telemetryManager: TelemetryManager;
1
+ import { Observable } from "@babylonjs/core/Misc/observable.js";
2
+ import type { Engine } from "@babylonjs/core/Engines/engine.js";
3
+ /**
4
+ * The data structure of a telemetry event.
5
+ */
6
+ export interface TelemetryData {
7
+ event: string;
8
+ session: string;
9
+ date: Date;
10
+ now: number;
11
+ viewerId?: string;
12
+ detail: any;
13
+ }
14
+ /**
15
+ * Receives Telemetry events and raises events to the API
16
+ */
17
+ export declare class TelemetryManager {
18
+ onEventBroadcastedObservable: Observable<TelemetryData>;
19
+ private _currentSessionId;
20
+ private _event;
21
+ /**
22
+ * Receives a telemetry event
23
+ */
24
+ get broadcast(): (event: string, viewerId?: string | undefined, details?: any) => void;
25
+ /**
26
+ * Log a Telemetry event for errors raised on the WebGL context.
27
+ * @param engine The Babylon engine with the WebGL context.
28
+ * @param viewerId
29
+ */
30
+ flushWebGLErrors(engine: Engine, viewerId?: string): void;
31
+ /**
32
+ * Enable or disable telemetry events
33
+ * @param enabled Boolean, true if events are enabled
34
+ */
35
+ set enable(enabled: boolean);
36
+ /**
37
+ * Called on event when disabled, typically do nothing here
38
+ */
39
+ private _eventDisabled;
40
+ /**
41
+ * Called on event when enabled
42
+ * @param event - The name of the Telemetry event
43
+ * @param viewerId
44
+ * @param details An additional value, or an object containing a list of property/value pairs
45
+ */
46
+ private _eventEnabled;
47
+ /**
48
+ * Returns the current session ID or creates one if it doesn't exist
49
+ * @return The current session ID
50
+ */
51
+ get session(): string;
52
+ /**
53
+ * Disposes the telemetry manager
54
+ */
55
+ dispose(): void;
56
+ }
57
+ export declare const telemetryManager: TelemetryManager;
@@ -1,114 +1,114 @@
1
- import { Observable } from "@babylonjs/core/Misc/observable.js";
2
- /**
3
- * Receives Telemetry events and raises events to the API
4
- */
5
- var TelemetryManager = /** @class */ (function () {
6
- function TelemetryManager() {
7
- this.onEventBroadcastedObservable = new Observable();
8
- this._event = this._eventEnabled;
9
- }
10
- Object.defineProperty(TelemetryManager.prototype, "broadcast", {
11
- /**
12
- * Receives a telemetry event
13
- */
14
- get: function () {
15
- return this._event;
16
- },
17
- enumerable: false,
18
- configurable: true
19
- });
20
- /**
21
- * Log a Telemetry event for errors raised on the WebGL context.
22
- * @param engine The Babylon engine with the WebGL context.
23
- * @param viewerId
24
- */
25
- TelemetryManager.prototype.flushWebGLErrors = function (engine, viewerId) {
26
- if (!engine) {
27
- return;
28
- }
29
- var logErrors = true;
30
- while (logErrors) {
31
- var error = engine.getError();
32
- if (error === 0) {
33
- logErrors = false;
34
- }
35
- else {
36
- this.broadcast("WebGL Error", viewerId, { error: error });
37
- }
38
- }
39
- };
40
- Object.defineProperty(TelemetryManager.prototype, "enable", {
41
- /**
42
- * Enable or disable telemetry events
43
- * @param enabled Boolean, true if events are enabled
44
- */
45
- set: function (enabled) {
46
- if (enabled) {
47
- this._event = this._eventEnabled;
48
- }
49
- else {
50
- this._event = this._eventDisabled;
51
- }
52
- },
53
- enumerable: false,
54
- configurable: true
55
- });
56
- /**
57
- * Called on event when disabled, typically do nothing here
58
- */
59
- TelemetryManager.prototype._eventDisabled = function () {
60
- // nothing to do
61
- };
62
- /**
63
- * Called on event when enabled
64
- * @param event - The name of the Telemetry event
65
- * @param viewerId
66
- * @param details An additional value, or an object containing a list of property/value pairs
67
- */
68
- TelemetryManager.prototype._eventEnabled = function (event, viewerId, details) {
69
- var telemetryData = {
70
- viewerId: viewerId,
71
- event: event,
72
- session: this.session,
73
- date: new Date(),
74
- now: window.performance ? window.performance.now() : Date.now(),
75
- detail: null,
76
- };
77
- if (typeof details === "object") {
78
- for (var attr in details) {
79
- if (Object.prototype.hasOwnProperty.call(details, attr)) {
80
- telemetryData[attr] = details[attr];
81
- }
82
- }
83
- }
84
- else if (details) {
85
- telemetryData.detail = details;
86
- }
87
- this.onEventBroadcastedObservable.notifyObservers(telemetryData);
88
- };
89
- Object.defineProperty(TelemetryManager.prototype, "session", {
90
- /**
91
- * Returns the current session ID or creates one if it doesn't exist
92
- * @return The current session ID
93
- */
94
- get: function () {
95
- if (!this._currentSessionId) {
96
- //String + Timestamp + Random Integer
97
- this._currentSessionId = "SESSION_" + Date.now() + Math.floor(Math.random() * 0x10000);
98
- }
99
- return this._currentSessionId;
100
- },
101
- enumerable: false,
102
- configurable: true
103
- });
104
- /**
105
- * Disposes the telemetry manager
106
- */
107
- TelemetryManager.prototype.dispose = function () {
108
- this.onEventBroadcastedObservable.clear();
109
- };
110
- return TelemetryManager;
111
- }());
112
- export { TelemetryManager };
113
- export var telemetryManager = new TelemetryManager();
1
+ import { Observable } from "@babylonjs/core/Misc/observable.js";
2
+ /**
3
+ * Receives Telemetry events and raises events to the API
4
+ */
5
+ var TelemetryManager = /** @class */ (function () {
6
+ function TelemetryManager() {
7
+ this.onEventBroadcastedObservable = new Observable();
8
+ this._event = this._eventEnabled;
9
+ }
10
+ Object.defineProperty(TelemetryManager.prototype, "broadcast", {
11
+ /**
12
+ * Receives a telemetry event
13
+ */
14
+ get: function () {
15
+ return this._event;
16
+ },
17
+ enumerable: false,
18
+ configurable: true
19
+ });
20
+ /**
21
+ * Log a Telemetry event for errors raised on the WebGL context.
22
+ * @param engine The Babylon engine with the WebGL context.
23
+ * @param viewerId
24
+ */
25
+ TelemetryManager.prototype.flushWebGLErrors = function (engine, viewerId) {
26
+ if (!engine) {
27
+ return;
28
+ }
29
+ var logErrors = true;
30
+ while (logErrors) {
31
+ var error = engine.getError();
32
+ if (error === 0) {
33
+ logErrors = false;
34
+ }
35
+ else {
36
+ this.broadcast("WebGL Error", viewerId, { error: error });
37
+ }
38
+ }
39
+ };
40
+ Object.defineProperty(TelemetryManager.prototype, "enable", {
41
+ /**
42
+ * Enable or disable telemetry events
43
+ * @param enabled Boolean, true if events are enabled
44
+ */
45
+ set: function (enabled) {
46
+ if (enabled) {
47
+ this._event = this._eventEnabled;
48
+ }
49
+ else {
50
+ this._event = this._eventDisabled;
51
+ }
52
+ },
53
+ enumerable: false,
54
+ configurable: true
55
+ });
56
+ /**
57
+ * Called on event when disabled, typically do nothing here
58
+ */
59
+ TelemetryManager.prototype._eventDisabled = function () {
60
+ // nothing to do
61
+ };
62
+ /**
63
+ * Called on event when enabled
64
+ * @param event - The name of the Telemetry event
65
+ * @param viewerId
66
+ * @param details An additional value, or an object containing a list of property/value pairs
67
+ */
68
+ TelemetryManager.prototype._eventEnabled = function (event, viewerId, details) {
69
+ var telemetryData = {
70
+ viewerId: viewerId,
71
+ event: event,
72
+ session: this.session,
73
+ date: new Date(),
74
+ now: window.performance ? window.performance.now() : Date.now(),
75
+ detail: null,
76
+ };
77
+ if (typeof details === "object") {
78
+ for (var attr in details) {
79
+ if (Object.prototype.hasOwnProperty.call(details, attr)) {
80
+ telemetryData[attr] = details[attr];
81
+ }
82
+ }
83
+ }
84
+ else if (details) {
85
+ telemetryData.detail = details;
86
+ }
87
+ this.onEventBroadcastedObservable.notifyObservers(telemetryData);
88
+ };
89
+ Object.defineProperty(TelemetryManager.prototype, "session", {
90
+ /**
91
+ * Returns the current session ID or creates one if it doesn't exist
92
+ * @return The current session ID
93
+ */
94
+ get: function () {
95
+ if (!this._currentSessionId) {
96
+ //String + Timestamp + Random Integer
97
+ this._currentSessionId = "SESSION_" + Date.now() + Math.floor(Math.random() * 0x10000);
98
+ }
99
+ return this._currentSessionId;
100
+ },
101
+ enumerable: false,
102
+ configurable: true
103
+ });
104
+ /**
105
+ * Disposes the telemetry manager
106
+ */
107
+ TelemetryManager.prototype.dispose = function () {
108
+ this.onEventBroadcastedObservable.clear();
109
+ };
110
+ return TelemetryManager;
111
+ }());
112
+ export { TelemetryManager };
113
+ export var telemetryManager = new TelemetryManager();
114
114
  //# sourceMappingURL=telemetryManager.js.map