@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.
- package/configuration/configuration.d.ts +107 -107
- package/configuration/configuration.js +15 -15
- package/configuration/configurationCompatibility.d.ts +8 -8
- package/configuration/configurationCompatibility.js +65 -65
- package/configuration/configurationContainer.d.ts +10 -10
- package/configuration/configurationContainer.js +9 -9
- package/configuration/globals.d.ts +6 -6
- package/configuration/globals.js +17 -17
- package/configuration/index.d.ts +2 -2
- package/configuration/index.js +3 -3
- package/configuration/interfaces/cameraConfiguration.d.ts +31 -31
- package/configuration/interfaces/cameraConfiguration.js +1 -1
- package/configuration/interfaces/colorGradingConfiguration.d.ts +81 -81
- package/configuration/interfaces/colorGradingConfiguration.js +1 -1
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +20 -20
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +1 -1
- package/configuration/interfaces/environmentMapConfiguration.d.ts +22 -22
- package/configuration/interfaces/environmentMapConfiguration.js +1 -1
- package/configuration/interfaces/groundConfiguration.d.ts +24 -24
- package/configuration/interfaces/groundConfiguration.js +1 -1
- package/configuration/interfaces/imageProcessingConfiguration.d.ts +43 -43
- package/configuration/interfaces/imageProcessingConfiguration.js +1 -1
- package/configuration/interfaces/index.d.ts +15 -15
- package/configuration/interfaces/index.js +15 -15
- package/configuration/interfaces/lightConfiguration.d.ts +60 -60
- package/configuration/interfaces/lightConfiguration.js +1 -1
- package/configuration/interfaces/modelAnimationConfiguration.d.ts +26 -26
- package/configuration/interfaces/modelAnimationConfiguration.js +1 -1
- package/configuration/interfaces/modelConfiguration.d.ts +65 -65
- package/configuration/interfaces/modelConfiguration.js +1 -1
- package/configuration/interfaces/observersConfiguration.d.ts +5 -5
- package/configuration/interfaces/observersConfiguration.js +1 -1
- package/configuration/interfaces/sceneConfiguration.d.ts +48 -48
- package/configuration/interfaces/sceneConfiguration.js +1 -1
- package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +23 -23
- package/configuration/interfaces/sceneOptimizerConfiguration.js +1 -1
- package/configuration/interfaces/skyboxConfiguration.d.ts +21 -21
- package/configuration/interfaces/skyboxConfiguration.js +1 -1
- package/configuration/interfaces/templateConfiguration.d.ts +67 -67
- package/configuration/interfaces/templateConfiguration.js +1 -1
- package/configuration/interfaces/vrConfiguration.d.ts +16 -16
- package/configuration/interfaces/vrConfiguration.js +1 -1
- package/configuration/loader.d.ts +4 -4
- package/configuration/loader.js +16 -16
- package/configuration/mappers.d.ts +42 -42
- package/configuration/mappers.js +190 -190
- package/configuration/renderOnlyLoader.d.ts +33 -33
- package/configuration/renderOnlyLoader.js +161 -161
- package/configuration/types/default.d.ts +6 -6
- package/configuration/types/default.js +120 -120
- package/configuration/types/environmentMap.d.ts +5 -5
- package/configuration/types/environmentMap.js +13 -13
- package/configuration/types/extended.d.ts +6 -6
- package/configuration/types/extended.js +316 -316
- package/configuration/types/index.d.ts +13 -13
- package/configuration/types/index.js +49 -49
- package/configuration/types/minimal.d.ts +6 -6
- package/configuration/types/minimal.js +42 -42
- package/configuration/types/renderOnlyDefault.d.ts +30 -30
- package/configuration/types/renderOnlyDefault.js +30 -30
- package/configuration/types/shadowLight.d.ts +9 -9
- package/configuration/types/shadowLight.js +63 -63
- package/helper/index.d.ts +26 -26
- package/helper/index.js +62 -62
- package/index.d.ts +30 -30
- package/index.js +45 -45
- package/initializer.d.ts +11 -11
- package/initializer.js +34 -34
- package/interfaces.d.ts +5 -5
- package/interfaces.js +1 -1
- package/labs/environmentSerializer.d.ts +126 -126
- package/labs/environmentSerializer.js +190 -190
- package/labs/texture.d.ts +183 -183
- package/labs/texture.js +300 -300
- package/labs/viewerLabs.d.ts +51 -51
- package/labs/viewerLabs.js +133 -133
- package/loader/modelLoader.d.ts +47 -47
- package/loader/modelLoader.js +189 -189
- package/loader/plugins/applyMaterialConfig.d.ts +12 -12
- package/loader/plugins/applyMaterialConfig.js +15 -15
- package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +9 -9
- package/loader/plugins/extendedMaterialLoaderPlugin.js +15 -15
- package/loader/plugins/index.d.ts +18 -18
- package/loader/plugins/index.js +42 -42
- package/loader/plugins/loaderPlugin.d.ts +24 -24
- package/loader/plugins/loaderPlugin.js +1 -1
- package/loader/plugins/msftLodLoaderPlugin.d.ts +12 -12
- package/loader/plugins/msftLodLoaderPlugin.js +20 -20
- package/loader/plugins/telemetryLoaderPlugin.d.ts +12 -12
- package/loader/plugins/telemetryLoaderPlugin.js +35 -35
- package/managers/observablesManager.d.ts +66 -66
- package/managers/observablesManager.js +34 -34
- package/managers/sceneManager.d.ts +243 -243
- package/managers/sceneManager.js +1388 -1388
- package/managers/telemetryManager.d.ts +57 -57
- package/managers/telemetryManager.js +113 -113
- package/model/modelAnimation.d.ts +215 -215
- package/model/modelAnimation.js +232 -232
- package/model/viewerModel.d.ts +228 -228
- package/model/viewerModel.js +669 -669
- package/optimizer/custom/extended.d.ts +11 -11
- package/optimizer/custom/extended.js +98 -98
- package/optimizer/custom/index.d.ts +8 -8
- package/optimizer/custom/index.js +24 -24
- package/package.json +5 -5
- package/renderOnlyIndex.d.ts +11 -11
- package/renderOnlyIndex.js +17 -17
- package/templating/eventManager.d.ts +35 -35
- package/templating/eventManager.js +65 -65
- package/templating/plugins/hdButtonPlugin.d.ts +9 -9
- package/templating/plugins/hdButtonPlugin.js +21 -21
- package/templating/plugins/printButton.d.ts +9 -9
- package/templating/plugins/printButton.js +40 -40
- package/templating/templateManager.d.ts +190 -190
- package/templating/templateManager.js +553 -553
- package/templating/viewerTemplatePlugin.d.ts +21 -21
- package/templating/viewerTemplatePlugin.js +68 -68
- package/viewer/defaultViewer.d.ts +122 -122
- package/viewer/defaultViewer.js +665 -665
- package/viewer/renderOnlyViewer.d.ts +8 -8
- package/viewer/renderOnlyViewer.js +43 -43
- package/viewer/viewer.d.ts +254 -254
- package/viewer/viewer.js +777 -777
- package/viewer/viewerManager.d.ts +55 -55
- package/viewer/viewerManager.js +87 -87
- package/viewer/viewerWithTemplate.d.ts +9 -9
- package/viewer/viewerWithTemplate.js +19 -19
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
import { mapperManager } from "./mappers.js";
|
|
2
|
-
import { processConfigurationCompatibility } from "./configurationCompatibility.js";
|
|
3
|
-
// eslint-disable-next-line import/no-internal-modules
|
|
4
|
-
import { deepmerge } from "../helper/index.js";
|
|
5
|
-
import { Tools } from "@babylonjs/core/Misc/tools.js";
|
|
6
|
-
import { extendedConfiguration } from "./types/extended.js";
|
|
7
|
-
import { renderOnlyDefaultConfiguration } from "./types/renderOnlyDefault.js";
|
|
8
|
-
/**
|
|
9
|
-
* The configuration loader will load the configuration object from any source and will use the defined mapper to
|
|
10
|
-
* parse the object and return a conform ViewerConfiguration.
|
|
11
|
-
* It is a private member of the scene.
|
|
12
|
-
*/
|
|
13
|
-
var RenderOnlyConfigurationLoader = /** @class */ (function () {
|
|
14
|
-
function RenderOnlyConfigurationLoader(_enableCache) {
|
|
15
|
-
if (_enableCache === void 0) { _enableCache = false; }
|
|
16
|
-
this._enableCache = _enableCache;
|
|
17
|
-
this._configurationCache = {};
|
|
18
|
-
this._loadRequests = [];
|
|
19
|
-
}
|
|
20
|
-
RenderOnlyConfigurationLoader.prototype._getConfigurationTypeExcludeTemplate = function (types) {
|
|
21
|
-
var _this = this;
|
|
22
|
-
var config = {};
|
|
23
|
-
var typesSeparated = types.split(",");
|
|
24
|
-
typesSeparated.forEach(function (type) {
|
|
25
|
-
switch (type.trim()) {
|
|
26
|
-
case "default":
|
|
27
|
-
config = deepmerge(config, renderOnlyDefaultConfiguration);
|
|
28
|
-
break;
|
|
29
|
-
case "none":
|
|
30
|
-
break;
|
|
31
|
-
case "extended":
|
|
32
|
-
default:
|
|
33
|
-
config = deepmerge(config, extendedConfiguration);
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
if (config.extends) {
|
|
37
|
-
config = deepmerge(config, _this._getConfigurationTypeExcludeTemplate(config.extends));
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
return config;
|
|
41
|
-
};
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
43
|
-
RenderOnlyConfigurationLoader.prototype.getExtendedConfig = function (type) {
|
|
44
|
-
return this._getConfigurationTypeExcludeTemplate(type || "extended");
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* load a configuration object that is defined in the initial configuration provided.
|
|
48
|
-
* The viewer configuration can extend different types of configuration objects and have an extra configuration defined.
|
|
49
|
-
*
|
|
50
|
-
* @param initConfig the initial configuration that has the definitions of further configuration to load.
|
|
51
|
-
* @param callback an optional callback that will be called sync, if noconfiguration needs to be loaded or configuration is payload-only
|
|
52
|
-
* @returns A promise that delivers the extended viewer configuration, when done.
|
|
53
|
-
*/
|
|
54
|
-
RenderOnlyConfigurationLoader.prototype.loadConfiguration = function (initConfig, callback) {
|
|
55
|
-
var _this = this;
|
|
56
|
-
if (initConfig === void 0) { initConfig = {}; }
|
|
57
|
-
var loadedConfig = deepmerge({}, initConfig);
|
|
58
|
-
this._processInitialConfiguration(loadedConfig);
|
|
59
|
-
var extendedConfiguration = this.getExtendedConfig(loadedConfig.extends);
|
|
60
|
-
if (loadedConfig.configuration) {
|
|
61
|
-
var mapperType_1 = "json";
|
|
62
|
-
return Promise.resolve()
|
|
63
|
-
.then(function () {
|
|
64
|
-
if (typeof loadedConfig.configuration === "string" || (loadedConfig.configuration && loadedConfig.configuration.url)) {
|
|
65
|
-
// a file to load
|
|
66
|
-
var url = "";
|
|
67
|
-
if (typeof loadedConfig.configuration === "string") {
|
|
68
|
-
url = loadedConfig.configuration;
|
|
69
|
-
}
|
|
70
|
-
// if configuration is an object
|
|
71
|
-
if (typeof loadedConfig.configuration === "object" && loadedConfig.configuration.url) {
|
|
72
|
-
url = loadedConfig.configuration.url;
|
|
73
|
-
var type = loadedConfig.configuration.mapper;
|
|
74
|
-
// empty string?
|
|
75
|
-
if (!type) {
|
|
76
|
-
// load mapper type from filename / url
|
|
77
|
-
type = loadedConfig.configuration.url.split(".").pop();
|
|
78
|
-
}
|
|
79
|
-
mapperType_1 = type || mapperType_1;
|
|
80
|
-
}
|
|
81
|
-
return _this._loadFile(url);
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
if (typeof loadedConfig.configuration === "object") {
|
|
85
|
-
mapperType_1 = loadedConfig.configuration.mapper || mapperType_1;
|
|
86
|
-
return loadedConfig.configuration.payload || {};
|
|
87
|
-
}
|
|
88
|
-
return {};
|
|
89
|
-
}
|
|
90
|
-
})
|
|
91
|
-
.then(function (data) {
|
|
92
|
-
var mapper = mapperManager.getMapper(mapperType_1);
|
|
93
|
-
var parsed = deepmerge(mapper.map(data), loadedConfig);
|
|
94
|
-
var merged = deepmerge(extendedConfiguration, parsed);
|
|
95
|
-
processConfigurationCompatibility(merged);
|
|
96
|
-
if (callback) {
|
|
97
|
-
callback(merged);
|
|
98
|
-
}
|
|
99
|
-
return merged;
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
loadedConfig = deepmerge(extendedConfiguration, loadedConfig);
|
|
104
|
-
processConfigurationCompatibility(loadedConfig);
|
|
105
|
-
if (callback) {
|
|
106
|
-
callback(loadedConfig);
|
|
107
|
-
}
|
|
108
|
-
return Promise.resolve(loadedConfig);
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* Dispose the configuration loader. This will cancel file requests, if active.
|
|
113
|
-
*/
|
|
114
|
-
RenderOnlyConfigurationLoader.prototype.dispose = function () {
|
|
115
|
-
this._loadRequests.forEach(function (request) {
|
|
116
|
-
request.abort();
|
|
117
|
-
});
|
|
118
|
-
this._loadRequests.length = 0;
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* This function will process the initial configuration and make needed changes for the viewer to work.
|
|
122
|
-
* @param config the mutable(!) initial configuration to process
|
|
123
|
-
*/
|
|
124
|
-
RenderOnlyConfigurationLoader.prototype._processInitialConfiguration = function (config) {
|
|
125
|
-
if (config.model) {
|
|
126
|
-
if (typeof config.model === "string") {
|
|
127
|
-
config.model = {
|
|
128
|
-
url: config.model,
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
RenderOnlyConfigurationLoader.prototype._loadFile = function (url) {
|
|
134
|
-
var _this = this;
|
|
135
|
-
var cacheReference = this._configurationCache;
|
|
136
|
-
if (this._enableCache && cacheReference[url]) {
|
|
137
|
-
return Promise.resolve(cacheReference[url]);
|
|
138
|
-
}
|
|
139
|
-
return new Promise(function (resolve, reject) {
|
|
140
|
-
var fileRequest = Tools.LoadFile(url, function (result) {
|
|
141
|
-
var idx = _this._loadRequests.indexOf(fileRequest);
|
|
142
|
-
if (idx !== -1) {
|
|
143
|
-
_this._loadRequests.splice(idx, 1);
|
|
144
|
-
}
|
|
145
|
-
if (_this._enableCache) {
|
|
146
|
-
cacheReference[url] = result;
|
|
147
|
-
}
|
|
148
|
-
resolve(result);
|
|
149
|
-
}, undefined, undefined, false, function (request, error) {
|
|
150
|
-
var idx = _this._loadRequests.indexOf(fileRequest);
|
|
151
|
-
if (idx !== -1) {
|
|
152
|
-
_this._loadRequests.splice(idx, 1);
|
|
153
|
-
}
|
|
154
|
-
reject(error);
|
|
155
|
-
});
|
|
156
|
-
_this._loadRequests.push(fileRequest);
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
return RenderOnlyConfigurationLoader;
|
|
160
|
-
}());
|
|
161
|
-
export { RenderOnlyConfigurationLoader };
|
|
1
|
+
import { mapperManager } from "./mappers.js";
|
|
2
|
+
import { processConfigurationCompatibility } from "./configurationCompatibility.js";
|
|
3
|
+
// eslint-disable-next-line import/no-internal-modules
|
|
4
|
+
import { deepmerge } from "../helper/index.js";
|
|
5
|
+
import { Tools } from "@babylonjs/core/Misc/tools.js";
|
|
6
|
+
import { extendedConfiguration } from "./types/extended.js";
|
|
7
|
+
import { renderOnlyDefaultConfiguration } from "./types/renderOnlyDefault.js";
|
|
8
|
+
/**
|
|
9
|
+
* The configuration loader will load the configuration object from any source and will use the defined mapper to
|
|
10
|
+
* parse the object and return a conform ViewerConfiguration.
|
|
11
|
+
* It is a private member of the scene.
|
|
12
|
+
*/
|
|
13
|
+
var RenderOnlyConfigurationLoader = /** @class */ (function () {
|
|
14
|
+
function RenderOnlyConfigurationLoader(_enableCache) {
|
|
15
|
+
if (_enableCache === void 0) { _enableCache = false; }
|
|
16
|
+
this._enableCache = _enableCache;
|
|
17
|
+
this._configurationCache = {};
|
|
18
|
+
this._loadRequests = [];
|
|
19
|
+
}
|
|
20
|
+
RenderOnlyConfigurationLoader.prototype._getConfigurationTypeExcludeTemplate = function (types) {
|
|
21
|
+
var _this = this;
|
|
22
|
+
var config = {};
|
|
23
|
+
var typesSeparated = types.split(",");
|
|
24
|
+
typesSeparated.forEach(function (type) {
|
|
25
|
+
switch (type.trim()) {
|
|
26
|
+
case "default":
|
|
27
|
+
config = deepmerge(config, renderOnlyDefaultConfiguration);
|
|
28
|
+
break;
|
|
29
|
+
case "none":
|
|
30
|
+
break;
|
|
31
|
+
case "extended":
|
|
32
|
+
default:
|
|
33
|
+
config = deepmerge(config, extendedConfiguration);
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
if (config.extends) {
|
|
37
|
+
config = deepmerge(config, _this._getConfigurationTypeExcludeTemplate(config.extends));
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
return config;
|
|
41
|
+
};
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
43
|
+
RenderOnlyConfigurationLoader.prototype.getExtendedConfig = function (type) {
|
|
44
|
+
return this._getConfigurationTypeExcludeTemplate(type || "extended");
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* load a configuration object that is defined in the initial configuration provided.
|
|
48
|
+
* The viewer configuration can extend different types of configuration objects and have an extra configuration defined.
|
|
49
|
+
*
|
|
50
|
+
* @param initConfig the initial configuration that has the definitions of further configuration to load.
|
|
51
|
+
* @param callback an optional callback that will be called sync, if noconfiguration needs to be loaded or configuration is payload-only
|
|
52
|
+
* @returns A promise that delivers the extended viewer configuration, when done.
|
|
53
|
+
*/
|
|
54
|
+
RenderOnlyConfigurationLoader.prototype.loadConfiguration = function (initConfig, callback) {
|
|
55
|
+
var _this = this;
|
|
56
|
+
if (initConfig === void 0) { initConfig = {}; }
|
|
57
|
+
var loadedConfig = deepmerge({}, initConfig);
|
|
58
|
+
this._processInitialConfiguration(loadedConfig);
|
|
59
|
+
var extendedConfiguration = this.getExtendedConfig(loadedConfig.extends);
|
|
60
|
+
if (loadedConfig.configuration) {
|
|
61
|
+
var mapperType_1 = "json";
|
|
62
|
+
return Promise.resolve()
|
|
63
|
+
.then(function () {
|
|
64
|
+
if (typeof loadedConfig.configuration === "string" || (loadedConfig.configuration && loadedConfig.configuration.url)) {
|
|
65
|
+
// a file to load
|
|
66
|
+
var url = "";
|
|
67
|
+
if (typeof loadedConfig.configuration === "string") {
|
|
68
|
+
url = loadedConfig.configuration;
|
|
69
|
+
}
|
|
70
|
+
// if configuration is an object
|
|
71
|
+
if (typeof loadedConfig.configuration === "object" && loadedConfig.configuration.url) {
|
|
72
|
+
url = loadedConfig.configuration.url;
|
|
73
|
+
var type = loadedConfig.configuration.mapper;
|
|
74
|
+
// empty string?
|
|
75
|
+
if (!type) {
|
|
76
|
+
// load mapper type from filename / url
|
|
77
|
+
type = loadedConfig.configuration.url.split(".").pop();
|
|
78
|
+
}
|
|
79
|
+
mapperType_1 = type || mapperType_1;
|
|
80
|
+
}
|
|
81
|
+
return _this._loadFile(url);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
if (typeof loadedConfig.configuration === "object") {
|
|
85
|
+
mapperType_1 = loadedConfig.configuration.mapper || mapperType_1;
|
|
86
|
+
return loadedConfig.configuration.payload || {};
|
|
87
|
+
}
|
|
88
|
+
return {};
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
.then(function (data) {
|
|
92
|
+
var mapper = mapperManager.getMapper(mapperType_1);
|
|
93
|
+
var parsed = deepmerge(mapper.map(data), loadedConfig);
|
|
94
|
+
var merged = deepmerge(extendedConfiguration, parsed);
|
|
95
|
+
processConfigurationCompatibility(merged);
|
|
96
|
+
if (callback) {
|
|
97
|
+
callback(merged);
|
|
98
|
+
}
|
|
99
|
+
return merged;
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
loadedConfig = deepmerge(extendedConfiguration, loadedConfig);
|
|
104
|
+
processConfigurationCompatibility(loadedConfig);
|
|
105
|
+
if (callback) {
|
|
106
|
+
callback(loadedConfig);
|
|
107
|
+
}
|
|
108
|
+
return Promise.resolve(loadedConfig);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Dispose the configuration loader. This will cancel file requests, if active.
|
|
113
|
+
*/
|
|
114
|
+
RenderOnlyConfigurationLoader.prototype.dispose = function () {
|
|
115
|
+
this._loadRequests.forEach(function (request) {
|
|
116
|
+
request.abort();
|
|
117
|
+
});
|
|
118
|
+
this._loadRequests.length = 0;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* This function will process the initial configuration and make needed changes for the viewer to work.
|
|
122
|
+
* @param config the mutable(!) initial configuration to process
|
|
123
|
+
*/
|
|
124
|
+
RenderOnlyConfigurationLoader.prototype._processInitialConfiguration = function (config) {
|
|
125
|
+
if (config.model) {
|
|
126
|
+
if (typeof config.model === "string") {
|
|
127
|
+
config.model = {
|
|
128
|
+
url: config.model,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
RenderOnlyConfigurationLoader.prototype._loadFile = function (url) {
|
|
134
|
+
var _this = this;
|
|
135
|
+
var cacheReference = this._configurationCache;
|
|
136
|
+
if (this._enableCache && cacheReference[url]) {
|
|
137
|
+
return Promise.resolve(cacheReference[url]);
|
|
138
|
+
}
|
|
139
|
+
return new Promise(function (resolve, reject) {
|
|
140
|
+
var fileRequest = Tools.LoadFile(url, function (result) {
|
|
141
|
+
var idx = _this._loadRequests.indexOf(fileRequest);
|
|
142
|
+
if (idx !== -1) {
|
|
143
|
+
_this._loadRequests.splice(idx, 1);
|
|
144
|
+
}
|
|
145
|
+
if (_this._enableCache) {
|
|
146
|
+
cacheReference[url] = result;
|
|
147
|
+
}
|
|
148
|
+
resolve(result);
|
|
149
|
+
}, undefined, undefined, false, function (request, error) {
|
|
150
|
+
var idx = _this._loadRequests.indexOf(fileRequest);
|
|
151
|
+
if (idx !== -1) {
|
|
152
|
+
_this._loadRequests.splice(idx, 1);
|
|
153
|
+
}
|
|
154
|
+
reject(error);
|
|
155
|
+
});
|
|
156
|
+
_this._loadRequests.push(fileRequest);
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
return RenderOnlyConfigurationLoader;
|
|
160
|
+
}());
|
|
161
|
+
export { RenderOnlyConfigurationLoader };
|
|
162
162
|
//# sourceMappingURL=renderOnlyLoader.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ViewerConfiguration } from "../configuration";
|
|
2
|
-
/**
|
|
3
|
-
* The default configuration of the viewer, including templates (canvas, overly, loading screen)
|
|
4
|
-
* This configuration doesn't hold specific parameters, and only defines objects that are needed for the viewer to fully work correctly.
|
|
5
|
-
*/
|
|
6
|
-
export declare const defaultConfiguration: ViewerConfiguration;
|
|
1
|
+
import type { ViewerConfiguration } from "../configuration";
|
|
2
|
+
/**
|
|
3
|
+
* The default configuration of the viewer, including templates (canvas, overly, loading screen)
|
|
4
|
+
* This configuration doesn't hold specific parameters, and only defines objects that are needed for the viewer to fully work correctly.
|
|
5
|
+
*/
|
|
6
|
+
export declare const defaultConfiguration: ViewerConfiguration;
|
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
import { babylonFont, defaultTemplate, fillContainer, loadingScreen, defaultViewer, navbar, overlay, help, share, error } from "babylonjs-viewer-assets";
|
|
2
|
-
import * as images from "babylonjs-viewer-assets";
|
|
3
|
-
import { renderOnlyDefaultConfiguration } from "./renderOnlyDefault.js";
|
|
4
|
-
// eslint-disable-next-line import/no-internal-modules
|
|
5
|
-
import { deepmerge } from "../../helper/index.js";
|
|
6
|
-
/**
|
|
7
|
-
* The default configuration of the viewer, including templates (canvas, overly, loading screen)
|
|
8
|
-
* This configuration doesn't hold specific parameters, and only defines objects that are needed for the viewer to fully work correctly.
|
|
9
|
-
*/
|
|
10
|
-
export var defaultConfiguration = deepmerge(renderOnlyDefaultConfiguration, {
|
|
11
|
-
version: "3.2.0-alpha4",
|
|
12
|
-
templates: {
|
|
13
|
-
main: {
|
|
14
|
-
html: defaultTemplate,
|
|
15
|
-
params: {
|
|
16
|
-
babylonFont: babylonFont,
|
|
17
|
-
noEscape: true,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
fillContainer: {
|
|
21
|
-
html: fillContainer,
|
|
22
|
-
params: {
|
|
23
|
-
disable: false,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
loadingScreen: {
|
|
27
|
-
html: loadingScreen,
|
|
28
|
-
params: {
|
|
29
|
-
backgroundColor: "#000000",
|
|
30
|
-
loadingImage: images.loading,
|
|
31
|
-
staticLoadingImage: images.staticLoading,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
viewer: {
|
|
35
|
-
html: defaultViewer,
|
|
36
|
-
params: {
|
|
37
|
-
enableDragAndDrop: false,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
navBar: {
|
|
41
|
-
html: navbar,
|
|
42
|
-
params: {
|
|
43
|
-
speedList: {
|
|
44
|
-
"0.5x": "0.5",
|
|
45
|
-
"1.0x": "1.0",
|
|
46
|
-
"1.5x": "1.5",
|
|
47
|
-
"2.0x": "2.0",
|
|
48
|
-
},
|
|
49
|
-
logoImage: images.babylonLogo,
|
|
50
|
-
logoText: "BabylonJS",
|
|
51
|
-
logoLink: "https://babylonjs.com",
|
|
52
|
-
hideHelp: true,
|
|
53
|
-
hideHd: true,
|
|
54
|
-
hideVr: true,
|
|
55
|
-
hidePrint: true,
|
|
56
|
-
disableOnFullscreen: false,
|
|
57
|
-
text: {
|
|
58
|
-
hdButton: "Toggle HD",
|
|
59
|
-
fullscreenButton: "Toggle Fullscreen",
|
|
60
|
-
helpButton: "Help",
|
|
61
|
-
vrButton: "Toggle VR",
|
|
62
|
-
printButton: "3D Print Object",
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
events: {
|
|
66
|
-
click: {
|
|
67
|
-
".navbar-control": true,
|
|
68
|
-
},
|
|
69
|
-
pointerdown: {
|
|
70
|
-
".help-button": true,
|
|
71
|
-
},
|
|
72
|
-
input: {
|
|
73
|
-
".progress-wrapper": true,
|
|
74
|
-
},
|
|
75
|
-
pointerup: {
|
|
76
|
-
".progress-wrapper": true,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
overlay: {
|
|
81
|
-
html: overlay,
|
|
82
|
-
params: {
|
|
83
|
-
closeImage: images.close,
|
|
84
|
-
closeText: "Close",
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
help: {
|
|
88
|
-
html: help,
|
|
89
|
-
},
|
|
90
|
-
share: {
|
|
91
|
-
html: share,
|
|
92
|
-
},
|
|
93
|
-
error: {
|
|
94
|
-
html: error,
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
camera: {
|
|
98
|
-
behaviors: {
|
|
99
|
-
autoRotate: {
|
|
100
|
-
type: 0,
|
|
101
|
-
},
|
|
102
|
-
framing: {
|
|
103
|
-
type: 2,
|
|
104
|
-
zoomOnBoundingInfo: true,
|
|
105
|
-
zoomStopsAnimation: false,
|
|
106
|
-
},
|
|
107
|
-
bouncing: {
|
|
108
|
-
type: 1,
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
skybox: {},
|
|
113
|
-
ground: {
|
|
114
|
-
receiveShadows: true,
|
|
115
|
-
},
|
|
116
|
-
engine: {
|
|
117
|
-
antialiasing: true,
|
|
118
|
-
},
|
|
119
|
-
scene: {},
|
|
120
|
-
});
|
|
1
|
+
import { babylonFont, defaultTemplate, fillContainer, loadingScreen, defaultViewer, navbar, overlay, help, share, error } from "babylonjs-viewer-assets";
|
|
2
|
+
import * as images from "babylonjs-viewer-assets";
|
|
3
|
+
import { renderOnlyDefaultConfiguration } from "./renderOnlyDefault.js";
|
|
4
|
+
// eslint-disable-next-line import/no-internal-modules
|
|
5
|
+
import { deepmerge } from "../../helper/index.js";
|
|
6
|
+
/**
|
|
7
|
+
* The default configuration of the viewer, including templates (canvas, overly, loading screen)
|
|
8
|
+
* This configuration doesn't hold specific parameters, and only defines objects that are needed for the viewer to fully work correctly.
|
|
9
|
+
*/
|
|
10
|
+
export var defaultConfiguration = deepmerge(renderOnlyDefaultConfiguration, {
|
|
11
|
+
version: "3.2.0-alpha4",
|
|
12
|
+
templates: {
|
|
13
|
+
main: {
|
|
14
|
+
html: defaultTemplate,
|
|
15
|
+
params: {
|
|
16
|
+
babylonFont: babylonFont,
|
|
17
|
+
noEscape: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
fillContainer: {
|
|
21
|
+
html: fillContainer,
|
|
22
|
+
params: {
|
|
23
|
+
disable: false,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
loadingScreen: {
|
|
27
|
+
html: loadingScreen,
|
|
28
|
+
params: {
|
|
29
|
+
backgroundColor: "#000000",
|
|
30
|
+
loadingImage: images.loading,
|
|
31
|
+
staticLoadingImage: images.staticLoading,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
viewer: {
|
|
35
|
+
html: defaultViewer,
|
|
36
|
+
params: {
|
|
37
|
+
enableDragAndDrop: false,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
navBar: {
|
|
41
|
+
html: navbar,
|
|
42
|
+
params: {
|
|
43
|
+
speedList: {
|
|
44
|
+
"0.5x": "0.5",
|
|
45
|
+
"1.0x": "1.0",
|
|
46
|
+
"1.5x": "1.5",
|
|
47
|
+
"2.0x": "2.0",
|
|
48
|
+
},
|
|
49
|
+
logoImage: images.babylonLogo,
|
|
50
|
+
logoText: "BabylonJS",
|
|
51
|
+
logoLink: "https://babylonjs.com",
|
|
52
|
+
hideHelp: true,
|
|
53
|
+
hideHd: true,
|
|
54
|
+
hideVr: true,
|
|
55
|
+
hidePrint: true,
|
|
56
|
+
disableOnFullscreen: false,
|
|
57
|
+
text: {
|
|
58
|
+
hdButton: "Toggle HD",
|
|
59
|
+
fullscreenButton: "Toggle Fullscreen",
|
|
60
|
+
helpButton: "Help",
|
|
61
|
+
vrButton: "Toggle VR",
|
|
62
|
+
printButton: "3D Print Object",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
events: {
|
|
66
|
+
click: {
|
|
67
|
+
".navbar-control": true,
|
|
68
|
+
},
|
|
69
|
+
pointerdown: {
|
|
70
|
+
".help-button": true,
|
|
71
|
+
},
|
|
72
|
+
input: {
|
|
73
|
+
".progress-wrapper": true,
|
|
74
|
+
},
|
|
75
|
+
pointerup: {
|
|
76
|
+
".progress-wrapper": true,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
overlay: {
|
|
81
|
+
html: overlay,
|
|
82
|
+
params: {
|
|
83
|
+
closeImage: images.close,
|
|
84
|
+
closeText: "Close",
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
help: {
|
|
88
|
+
html: help,
|
|
89
|
+
},
|
|
90
|
+
share: {
|
|
91
|
+
html: share,
|
|
92
|
+
},
|
|
93
|
+
error: {
|
|
94
|
+
html: error,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
camera: {
|
|
98
|
+
behaviors: {
|
|
99
|
+
autoRotate: {
|
|
100
|
+
type: 0,
|
|
101
|
+
},
|
|
102
|
+
framing: {
|
|
103
|
+
type: 2,
|
|
104
|
+
zoomOnBoundingInfo: true,
|
|
105
|
+
zoomStopsAnimation: false,
|
|
106
|
+
},
|
|
107
|
+
bouncing: {
|
|
108
|
+
type: 1,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
skybox: {},
|
|
113
|
+
ground: {
|
|
114
|
+
receiveShadows: true,
|
|
115
|
+
},
|
|
116
|
+
engine: {
|
|
117
|
+
antialiasing: true,
|
|
118
|
+
},
|
|
119
|
+
scene: {},
|
|
120
|
+
});
|
|
121
121
|
//# sourceMappingURL=default.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ViewerConfiguration } from "./../configuration";
|
|
2
|
-
/**
|
|
3
|
-
* Lab-oriented default .env support
|
|
4
|
-
*/
|
|
5
|
-
export declare const environmentMapConfiguration: ViewerConfiguration;
|
|
1
|
+
import type { ViewerConfiguration } from "./../configuration";
|
|
2
|
+
/**
|
|
3
|
+
* Lab-oriented default .env support
|
|
4
|
+
*/
|
|
5
|
+
export declare const environmentMapConfiguration: ViewerConfiguration;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lab-oriented default .env support
|
|
3
|
-
*/
|
|
4
|
-
export var environmentMapConfiguration = {
|
|
5
|
-
lab: {
|
|
6
|
-
assetsRootURL: "/assets/environment/",
|
|
7
|
-
environmentMap: {
|
|
8
|
-
texture: "EnvMap_3.0-256.env",
|
|
9
|
-
rotationY: 0,
|
|
10
|
-
tintLevel: 0.4,
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Lab-oriented default .env support
|
|
3
|
+
*/
|
|
4
|
+
export var environmentMapConfiguration = {
|
|
5
|
+
lab: {
|
|
6
|
+
assetsRootURL: "/assets/environment/",
|
|
7
|
+
environmentMap: {
|
|
8
|
+
texture: "EnvMap_3.0-256.env",
|
|
9
|
+
rotationY: 0,
|
|
10
|
+
tintLevel: 0.4,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
14
|
//# sourceMappingURL=environmentMap.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ViewerConfiguration } from "./../configuration";
|
|
2
|
-
/**
|
|
3
|
-
* The viewer's "extended" configuration.
|
|
4
|
-
* This configuration defines specific objects and parameters that we think make any model look good.
|
|
5
|
-
*/
|
|
6
|
-
export declare const extendedConfiguration: ViewerConfiguration;
|
|
1
|
+
import type { ViewerConfiguration } from "./../configuration";
|
|
2
|
+
/**
|
|
3
|
+
* The viewer's "extended" configuration.
|
|
4
|
+
* This configuration defines specific objects and parameters that we think make any model look good.
|
|
5
|
+
*/
|
|
6
|
+
export declare const extendedConfiguration: ViewerConfiguration;
|