@combeenation/3d-viewer 14.0.1-rc1 → 14.1.0

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 (67) hide show
  1. package/README.md +9 -9
  2. package/dist/lib-cjs/buildinfo.json +3 -3
  3. package/dist/lib-cjs/commonjs.tsconfig.tsbuildinfo +1 -1
  4. package/dist/lib-cjs/index.d.ts +51 -62
  5. package/dist/lib-cjs/index.js +84 -94
  6. package/dist/lib-cjs/index.js.map +1 -1
  7. package/dist/lib-cjs/internal/cbn-custom-babylon-loader-plugin.d.ts +10 -10
  8. package/dist/lib-cjs/internal/cbn-custom-babylon-loader-plugin.js +131 -131
  9. package/dist/lib-cjs/internal/cloning-helper.d.ts +19 -19
  10. package/dist/lib-cjs/internal/cloning-helper.js +163 -163
  11. package/dist/lib-cjs/internal/device-helper.d.ts +9 -9
  12. package/dist/lib-cjs/internal/device-helper.js +24 -24
  13. package/dist/lib-cjs/internal/geometry-helper.d.ts +21 -21
  14. package/dist/lib-cjs/internal/geometry-helper.js +145 -145
  15. package/dist/lib-cjs/internal/metadata-helper.d.ts +26 -26
  16. package/dist/lib-cjs/internal/metadata-helper.js +50 -50
  17. package/dist/lib-cjs/internal/paintable-helper.d.ts +40 -40
  18. package/dist/lib-cjs/internal/paintable-helper.js +286 -286
  19. package/dist/lib-cjs/internal/tags-helper.d.ts +12 -12
  20. package/dist/lib-cjs/internal/tags-helper.js +37 -37
  21. package/dist/lib-cjs/manager/camera-manager.d.ts +110 -110
  22. package/dist/lib-cjs/manager/camera-manager.js +209 -206
  23. package/dist/lib-cjs/manager/camera-manager.js.map +1 -1
  24. package/dist/lib-cjs/manager/debug-manager.d.ts +60 -60
  25. package/dist/lib-cjs/manager/debug-manager.js +217 -217
  26. package/dist/lib-cjs/manager/event-manager.d.ts +52 -52
  27. package/dist/lib-cjs/manager/event-manager.js +71 -71
  28. package/dist/lib-cjs/manager/gltf-export-manager.d.ts +75 -84
  29. package/dist/lib-cjs/manager/gltf-export-manager.js +286 -290
  30. package/dist/lib-cjs/manager/gltf-export-manager.js.map +1 -1
  31. package/dist/lib-cjs/manager/material-manager.d.ts +35 -35
  32. package/dist/lib-cjs/manager/material-manager.js +125 -125
  33. package/dist/lib-cjs/manager/model-manager.d.ts +145 -145
  34. package/dist/lib-cjs/manager/model-manager.js +382 -382
  35. package/dist/lib-cjs/manager/parameter-manager.d.ts +210 -210
  36. package/dist/lib-cjs/manager/parameter-manager.js +514 -514
  37. package/dist/lib-cjs/manager/scene-manager.d.ts +45 -45
  38. package/dist/lib-cjs/manager/scene-manager.js +64 -64
  39. package/dist/lib-cjs/manager/texture-manager.d.ts +12 -12
  40. package/dist/lib-cjs/manager/texture-manager.js +43 -43
  41. package/dist/lib-cjs/viewer-error.d.ts +48 -48
  42. package/dist/lib-cjs/viewer-error.js +60 -60
  43. package/dist/lib-cjs/viewer.d.ts +115 -115
  44. package/dist/lib-cjs/viewer.js +217 -217
  45. package/package.json +91 -91
  46. package/src/buildinfo.json +3 -3
  47. package/src/dev.ts +47 -47
  48. package/src/global-types.d.ts +39 -39
  49. package/src/index.ts +71 -81
  50. package/src/internal/cbn-custom-babylon-loader-plugin.ts +159 -159
  51. package/src/internal/cloning-helper.ts +225 -225
  52. package/src/internal/device-helper.ts +25 -25
  53. package/src/internal/geometry-helper.ts +181 -181
  54. package/src/internal/metadata-helper.ts +63 -63
  55. package/src/internal/paintable-helper.ts +310 -310
  56. package/src/internal/tags-helper.ts +41 -41
  57. package/src/manager/camera-manager.ts +368 -365
  58. package/src/manager/debug-manager.ts +245 -245
  59. package/src/manager/event-manager.ts +72 -72
  60. package/src/manager/gltf-export-manager.ts +356 -357
  61. package/src/manager/material-manager.ts +135 -135
  62. package/src/manager/model-manager.ts +458 -458
  63. package/src/manager/parameter-manager.ts +652 -652
  64. package/src/manager/scene-manager.ts +101 -101
  65. package/src/manager/texture-manager.ts +32 -32
  66. package/src/viewer-error.ts +68 -68
  67. package/src/viewer.ts +290 -290
@@ -1,218 +1,218 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.Viewer = void 0;
30
- const buildinfo_json_1 = __importDefault(require("./buildinfo.json"));
31
- const Index = __importStar(require("./index"));
32
- const index_1 = require("./index");
33
- const cbn_custom_babylon_loader_plugin_1 = require("./internal/cbn-custom-babylon-loader-plugin");
34
- const device_helper_1 = require("./internal/device-helper");
35
- const geometry_helper_1 = require("./internal/geometry-helper");
36
- const lodash_es_1 = require("lodash-es");
37
- /**
38
- * This is the entry point into the application.\
39
- * Create an instance to set up the viewer on your canvas.
40
- * ```js
41
- * const canvas = document.getElementById('babylon-canvas');
42
- * const viewer = Viewer(canvas, viewerSettings, defaultSceneSettings);
43
- * ```
44
- * Use "manager" sub classes for interacting with the Babylon.js engine.
45
- * (e.g. `modelManager` for loading models into the scene)
46
- */
47
- class Viewer {
48
- /**
49
- * @param viewerSettings Can be overwritten to tweak settings for the Babylon.js engine or viewer internal
50
- * functionalities like "texture downscaling mode"
51
- * @param defaultSceneSettings Can be overwritten to tweak settings for the automatically create Babylon.js scene.\
52
- * This scene contains a camera and an environment per default.
53
- */
54
- constructor(canvas, viewerSettings, defaultSceneSettings) {
55
- this.canvas = canvas;
56
- // default viewer settings
57
- // will be overwritten in the viewer constructor
58
- this._viewerSettings = {
59
- antialiasing: true,
60
- engineOptions: {
61
- preserveDrawingBuffer: true,
62
- stencil: true,
63
- xrCompatible: false,
64
- },
65
- adaptToDeviceRatio: true,
66
- limitTextureSize: {
67
- devices: 'iPhone',
68
- size: 1024,
69
- },
70
- useParallelShaderCompile: true,
71
- };
72
- this._isRenderLoopPaused = false;
73
- (0, lodash_es_1.merge)(this._viewerSettings, viewerSettings);
74
- this._init(defaultSceneSettings);
75
- }
76
- get scene() {
77
- return this._scene;
78
- }
79
- get engine() {
80
- return this.scene.getEngine();
81
- }
82
- get cameraManager() {
83
- return this._cameraManager;
84
- }
85
- get debugManager() {
86
- return this._debugManager;
87
- }
88
- get eventManager() {
89
- return this._eventManager;
90
- }
91
- get gltfExportManager() {
92
- return this._gltfExportManager;
93
- }
94
- get materialManager() {
95
- return this._materialManager;
96
- }
97
- get modelManager() {
98
- return this._modelManager;
99
- }
100
- get parameterManager() {
101
- return this._parameterManager;
102
- }
103
- /** @internal */
104
- get sceneManager() {
105
- return this._sceneManager;
106
- }
107
- /** @internal */
108
- get textureManager() {
109
- return this._textureManager;
110
- }
111
- get viewerSettings() {
112
- return this._viewerSettings;
113
- }
114
- /**
115
- * Returns all modules which are exported by the viewers index file.\
116
- * Needed by the [Combeenation viewer control](https://docs.combeenation.com/docs/3d-viewer-control) in situations where the viewer is injected from external code.\
117
- * See [Combeenation docs](https://docs.combeenation.com/docs/3d-viewer-control-with-custom-js) for more details.
118
- */
119
- static getAllViewerModules() {
120
- return Index;
121
- }
122
- /**
123
- * Pause rendering can be usefull when doing internal scene processings that should not be visible to the user,
124
- * e.g. cloning meshes for gltf export
125
- */
126
- pauseRendering() {
127
- this._isRenderLoopPaused = true;
128
- }
129
- /**
130
- * Resume render loop when paused by {@link pauseRendering} function
131
- */
132
- resumeRendering() {
133
- this._isRenderLoopPaused = false;
134
- }
135
- /**
136
- * Destroys this viewer instance and disposes Babylon.js engine and all scene content
137
- */
138
- destroy() {
139
- this.eventManager.removeAllListeners();
140
- this.engine.dispose();
141
- }
142
- /**
143
- * Calculates size of the current scene.\
144
- * Only takes meshes into considerations that:
145
- * - are visible
146
- * - are not excluded by "excludeGeometry" parameter
147
- * - do not have an infinite distance (like sky boxes)
148
- */
149
- calculateBoundingInfo(excludeGeometry) {
150
- // CB-6062: workaround for BoundingBox not respecting render loop
151
- this.scene.render();
152
- const { max, min } = this.scene.meshes
153
- .filter(mesh => {
154
- const isEnabled = mesh.isEnabled();
155
- // ignore meshes with invalid bounding infos
156
- const hasValidBBoxInfo = mesh.getBoundingInfo().boundingSphere.radius > 0;
157
- // ignore meshes with infinite distance, typically these are sky boxes
158
- const hasInfiniteDistance = mesh.infiniteDistance;
159
- // ignore excluded meshes
160
- const isExcluded = excludeGeometry ? (0, geometry_helper_1.isNodeExcluded)(mesh, excludeGeometry) : false;
161
- return isEnabled && hasValidBBoxInfo && !hasInfiniteDistance && !isExcluded;
162
- })
163
- .reduce((accBBoxMinMax, curMesh, idx) => {
164
- curMesh.refreshBoundingInfo(true, true);
165
- const bBox = curMesh.getBoundingInfo().boundingBox;
166
- // use the first entry in the array as default value and get the resulting maximum/minimum values
167
- const max = idx === 0 ? bBox.maximumWorld : index_1.Vector3.Maximize(accBBoxMinMax.max, bBox.maximumWorld);
168
- const min = idx === 0 ? bBox.minimumWorld : index_1.Vector3.Minimize(accBBoxMinMax.min, bBox.minimumWorld);
169
- return { max, min };
170
- }, { max: new index_1.Vector3(), min: new index_1.Vector3() });
171
- const boundingInfo = new index_1.BoundingInfo(min, max);
172
- return boundingInfo;
173
- }
174
- /**
175
- * Set up viewer (engine and scene) and initialize all managers
176
- */
177
- _init(defaultSceneSettings) {
178
- // we use a custom plugin for ".babylon" files to be able to lazy load materials that were cropped by the CBN
179
- // asset manager
180
- (0, cbn_custom_babylon_loader_plugin_1.registerCustomCbnBabylonLoaderPlugin)();
181
- const engine = new index_1.Engine(this.canvas, this._viewerSettings.antialiasing, (0, lodash_es_1.cloneDeep)(this._viewerSettings.engineOptions), this._viewerSettings.adaptToDeviceRatio);
182
- const isScaledDownDevice = (0, device_helper_1.getIsScaledDownDevice)(this._viewerSettings.limitTextureSize);
183
- if (this._viewerSettings.limitTextureSize && isScaledDownDevice) {
184
- engine.getCaps().maxTextureSize = this._viewerSettings.limitTextureSize.size;
185
- }
186
- if (this._viewerSettings.useParallelShaderCompile === false) {
187
- engine.getCaps().parallelShaderCompile = undefined;
188
- }
189
- this._scene = new index_1.Scene(engine);
190
- // NOTE: order of manage seems to be a bit counter intuitive as it's sorted alphabetically
191
- // semantically one would start with scene manager, etc...
192
- // still this is a good test as the order of manager constructors should not matter
193
- this._cameraManager = new index_1.CameraManager(this);
194
- this._debugManager = new index_1.DebugManager(this);
195
- this._eventManager = new index_1.EventManager(this);
196
- this._gltfExportManager = new index_1.GltfExportManager(this);
197
- this._materialManager = new index_1.MaterialManager(this);
198
- this._modelManager = new index_1.ModelManager(this);
199
- this._parameterManager = new index_1.ParameterManager(this);
200
- this._sceneManager = new index_1.SceneManager(this, defaultSceneSettings);
201
- this._textureManager = new index_1.TextureManager(this);
202
- // creates black cube
203
- // this model is not based on an URL and can be targeted by the Combeenation backend as fallback model
204
- this._modelManager.createFallbackModel();
205
- // NOTE: ATM creating the default scene required, as otherwise no camera would be available and the first render
206
- // call would already throw
207
- this._sceneManager.applyDefaultSettingsToScene();
208
- this._debugManager.registerAutofocusStartListener();
209
- engine.runRenderLoop(() => {
210
- if (!this._isRenderLoopPaused) {
211
- this.scene.render();
212
- }
213
- });
214
- }
215
- }
216
- exports.Viewer = Viewer;
217
- Viewer.version = buildinfo_json_1.default.version;
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Viewer = void 0;
30
+ const buildinfo_json_1 = __importDefault(require("./buildinfo.json"));
31
+ const Index = __importStar(require("./index"));
32
+ const index_1 = require("./index");
33
+ const cbn_custom_babylon_loader_plugin_1 = require("./internal/cbn-custom-babylon-loader-plugin");
34
+ const device_helper_1 = require("./internal/device-helper");
35
+ const geometry_helper_1 = require("./internal/geometry-helper");
36
+ const lodash_es_1 = require("lodash-es");
37
+ /**
38
+ * This is the entry point into the application.\
39
+ * Create an instance to set up the viewer on your canvas.
40
+ * ```js
41
+ * const canvas = document.getElementById('babylon-canvas');
42
+ * const viewer = Viewer(canvas, viewerSettings, defaultSceneSettings);
43
+ * ```
44
+ * Use "manager" sub classes for interacting with the Babylon.js engine.
45
+ * (e.g. `modelManager` for loading models into the scene)
46
+ */
47
+ class Viewer {
48
+ /**
49
+ * @param viewerSettings Can be overwritten to tweak settings for the Babylon.js engine or viewer internal
50
+ * functionalities like "texture downscaling mode"
51
+ * @param defaultSceneSettings Can be overwritten to tweak settings for the automatically create Babylon.js scene.\
52
+ * This scene contains a camera and an environment per default.
53
+ */
54
+ constructor(canvas, viewerSettings, defaultSceneSettings) {
55
+ this.canvas = canvas;
56
+ // default viewer settings
57
+ // will be overwritten in the viewer constructor
58
+ this._viewerSettings = {
59
+ antialiasing: true,
60
+ engineOptions: {
61
+ preserveDrawingBuffer: true,
62
+ stencil: true,
63
+ xrCompatible: false,
64
+ },
65
+ adaptToDeviceRatio: true,
66
+ limitTextureSize: {
67
+ devices: 'iPhone',
68
+ size: 1024,
69
+ },
70
+ useParallelShaderCompile: true,
71
+ };
72
+ this._isRenderLoopPaused = false;
73
+ (0, lodash_es_1.merge)(this._viewerSettings, viewerSettings);
74
+ this._init(defaultSceneSettings);
75
+ }
76
+ get scene() {
77
+ return this._scene;
78
+ }
79
+ get engine() {
80
+ return this.scene.getEngine();
81
+ }
82
+ get cameraManager() {
83
+ return this._cameraManager;
84
+ }
85
+ get debugManager() {
86
+ return this._debugManager;
87
+ }
88
+ get eventManager() {
89
+ return this._eventManager;
90
+ }
91
+ get gltfExportManager() {
92
+ return this._gltfExportManager;
93
+ }
94
+ get materialManager() {
95
+ return this._materialManager;
96
+ }
97
+ get modelManager() {
98
+ return this._modelManager;
99
+ }
100
+ get parameterManager() {
101
+ return this._parameterManager;
102
+ }
103
+ /** @internal */
104
+ get sceneManager() {
105
+ return this._sceneManager;
106
+ }
107
+ /** @internal */
108
+ get textureManager() {
109
+ return this._textureManager;
110
+ }
111
+ get viewerSettings() {
112
+ return this._viewerSettings;
113
+ }
114
+ /**
115
+ * Returns all modules which are exported by the viewers index file.\
116
+ * Needed by the [Combeenation viewer control](https://docs.combeenation.com/docs/3d-viewer-control) in situations where the viewer is injected from external code.\
117
+ * See [Combeenation docs](https://docs.combeenation.com/docs/3d-viewer-control-with-custom-js) for more details.
118
+ */
119
+ static getAllViewerModules() {
120
+ return Index;
121
+ }
122
+ /**
123
+ * Pause rendering can be usefull when doing internal scene processings that should not be visible to the user,
124
+ * e.g. cloning meshes for gltf export
125
+ */
126
+ pauseRendering() {
127
+ this._isRenderLoopPaused = true;
128
+ }
129
+ /**
130
+ * Resume render loop when paused by {@link pauseRendering} function
131
+ */
132
+ resumeRendering() {
133
+ this._isRenderLoopPaused = false;
134
+ }
135
+ /**
136
+ * Destroys this viewer instance and disposes Babylon.js engine and all scene content
137
+ */
138
+ destroy() {
139
+ this.eventManager.removeAllListeners();
140
+ this.engine.dispose();
141
+ }
142
+ /**
143
+ * Calculates size of the current scene.\
144
+ * Only takes meshes into considerations that:
145
+ * - are visible
146
+ * - are not excluded by "excludeGeometry" parameter
147
+ * - do not have an infinite distance (like sky boxes)
148
+ */
149
+ calculateBoundingInfo(excludeGeometry) {
150
+ // CB-6062: workaround for BoundingBox not respecting render loop
151
+ this.scene.render();
152
+ const { max, min } = this.scene.meshes
153
+ .filter(mesh => {
154
+ const isEnabled = mesh.isEnabled();
155
+ // ignore meshes with invalid bounding infos
156
+ const hasValidBBoxInfo = mesh.getBoundingInfo().boundingSphere.radius > 0;
157
+ // ignore meshes with infinite distance, typically these are sky boxes
158
+ const hasInfiniteDistance = mesh.infiniteDistance;
159
+ // ignore excluded meshes
160
+ const isExcluded = excludeGeometry ? (0, geometry_helper_1.isNodeExcluded)(mesh, excludeGeometry) : false;
161
+ return isEnabled && hasValidBBoxInfo && !hasInfiniteDistance && !isExcluded;
162
+ })
163
+ .reduce((accBBoxMinMax, curMesh, idx) => {
164
+ curMesh.refreshBoundingInfo(true, true);
165
+ const bBox = curMesh.getBoundingInfo().boundingBox;
166
+ // use the first entry in the array as default value and get the resulting maximum/minimum values
167
+ const max = idx === 0 ? bBox.maximumWorld : index_1.Vector3.Maximize(accBBoxMinMax.max, bBox.maximumWorld);
168
+ const min = idx === 0 ? bBox.minimumWorld : index_1.Vector3.Minimize(accBBoxMinMax.min, bBox.minimumWorld);
169
+ return { max, min };
170
+ }, { max: new index_1.Vector3(), min: new index_1.Vector3() });
171
+ const boundingInfo = new index_1.BoundingInfo(min, max);
172
+ return boundingInfo;
173
+ }
174
+ /**
175
+ * Set up viewer (engine and scene) and initialize all managers
176
+ */
177
+ _init(defaultSceneSettings) {
178
+ // we use a custom plugin for ".babylon" files to be able to lazy load materials that were cropped by the CBN
179
+ // asset manager
180
+ (0, cbn_custom_babylon_loader_plugin_1.registerCustomCbnBabylonLoaderPlugin)();
181
+ const engine = new index_1.Engine(this.canvas, this._viewerSettings.antialiasing, (0, lodash_es_1.cloneDeep)(this._viewerSettings.engineOptions), this._viewerSettings.adaptToDeviceRatio);
182
+ const isScaledDownDevice = (0, device_helper_1.getIsScaledDownDevice)(this._viewerSettings.limitTextureSize);
183
+ if (this._viewerSettings.limitTextureSize && isScaledDownDevice) {
184
+ engine.getCaps().maxTextureSize = this._viewerSettings.limitTextureSize.size;
185
+ }
186
+ if (this._viewerSettings.useParallelShaderCompile === false) {
187
+ engine.getCaps().parallelShaderCompile = undefined;
188
+ }
189
+ this._scene = new index_1.Scene(engine);
190
+ // NOTE: order of manage seems to be a bit counter intuitive as it's sorted alphabetically
191
+ // semantically one would start with scene manager, etc...
192
+ // still this is a good test as the order of manager constructors should not matter
193
+ this._cameraManager = new index_1.CameraManager(this);
194
+ this._debugManager = new index_1.DebugManager(this);
195
+ this._eventManager = new index_1.EventManager(this);
196
+ this._gltfExportManager = new index_1.GltfExportManager(this);
197
+ this._materialManager = new index_1.MaterialManager(this);
198
+ this._modelManager = new index_1.ModelManager(this);
199
+ this._parameterManager = new index_1.ParameterManager(this);
200
+ this._sceneManager = new index_1.SceneManager(this, defaultSceneSettings);
201
+ this._textureManager = new index_1.TextureManager(this);
202
+ // creates black cube
203
+ // this model is not based on an URL and can be targeted by the Combeenation backend as fallback model
204
+ this._modelManager.createFallbackModel();
205
+ // NOTE: ATM creating the default scene required, as otherwise no camera would be available and the first render
206
+ // call would already throw
207
+ this._sceneManager.applyDefaultSettingsToScene();
208
+ this._debugManager.registerAutofocusStartListener();
209
+ engine.runRenderLoop(() => {
210
+ if (!this._isRenderLoopPaused) {
211
+ this.scene.render();
212
+ }
213
+ });
214
+ }
215
+ }
216
+ exports.Viewer = Viewer;
217
+ Viewer.version = buildinfo_json_1.default.version;
218
218
  //# sourceMappingURL=viewer.js.map
package/package.json CHANGED
@@ -1,91 +1,91 @@
1
- {
2
- "name": "@combeenation/3d-viewer",
3
- "version": "14.0.1-rc1",
4
- "description": "Combeenation 3D Viewer",
5
- "homepage": "https://github.com/Combeenation/3d-viewer#readme",
6
- "bugs": {
7
- "url": "https://github.com/Combeenation/3d-viewer/issues"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/Combeenation/3d-viewer.git"
12
- },
13
- "license": "Apache 2.0",
14
- "author": "",
15
- "contributors": [],
16
- "main": "dist/lib-cjs/index.js",
17
- "module": "dist/lib-cjs/index.js",
18
- "typings": "dist/lib-cjs/index.d.ts",
19
- "directories": {
20
- "doc": "docs"
21
- },
22
- "files": [
23
- "dist",
24
- "src"
25
- ],
26
- "scripts": {
27
- "bundle-analyzer": "npm run generate-profile && webpack-bundle-analyzer dist/webpack-stats.json dist/lib-full",
28
- "clean-dist": "rimraf dist",
29
- "dev": "cross-env NODE_ENV='development' webpack serve --config build/webpack.debug.conf.js --progress --hot",
30
- "dist-cjs": "npm run clean-dist && npm run lint && tsc --project commonjs.tsconfig.json && npm run replace-version",
31
- "dist-full-dev": "npm run clean-dist && npm run lint && cross-env NODE_ENV='development' webpack --config build/webpack.build.conf.js --progress && npm run replace-version",
32
- "dist-full-prod": "npm run clean-dist && npm run lint && cross-env NODE_ENV='production' webpack --config build/webpack.build.conf.js --progress && npm run replace-version",
33
- "docs-local": "typedoc --tsconfig tsconfig.json --media doc/assets --out docs-local",
34
- "docs-publish": "typedoc --tsconfig tsconfig.json --media doc/assets --out docs",
35
- "format": "prettier --write ./src",
36
- "generate-profile": "cross-env NODE_ENV='development' webpack --config build/webpack.build.conf.js --profile --json > dist/webpack-stats.json",
37
- "lint": "eslint src/**",
38
- "pack": "npm run dist-cjs && npm pack",
39
- "pack-to-cjs": "npm run dist-cjs && npm pack --pack-destination=\"/mnt/c/Data/dev/custom-js/MichaelTest/TextureLoadEventsTest/\"",
40
- "pub-alpha": "npm run dist-cjs && npm publish --tag alpha",
41
- "pub-beta": "npm run dist-cjs && npm publish --tag beta",
42
- "pub-final": "npm run dist-cjs && npm publish",
43
- "pub-rc": "npm run dist-cjs && npm publish --tag rc",
44
- "replace-version": "cross-env-shell replace \"@VERSION@\" $npm_package_version dist -r",
45
- "types": "tsc --project declaration.tsconfig.json"
46
- },
47
- "prettier": "@combeenation/prettier-config",
48
- "dependencies": {
49
- "@babylonjs/core": "7.0.0",
50
- "@babylonjs/loaders": "7.0.0",
51
- "@babylonjs/serializers": "7.0.0",
52
- "eventemitter3": "4.0.7",
53
- "is-svg": "^5.0.0",
54
- "lodash-es": "4.17.21"
55
- },
56
- "devDependencies": {
57
- "@combeenation/eslint-config": "0.0.5",
58
- "@combeenation/prettier-config": "0.0.3",
59
- "@combeenation/ts-config": "0.0.2",
60
- "@knodes/typedoc-plugin-pages": "0.23.1",
61
- "@types/lodash-es": "4.17.6",
62
- "clean-webpack-plugin": "4.0.0",
63
- "cross-env": "7.0.3",
64
- "eslint": "8.25.0",
65
- "html-webpack-plugin": "5.5.0",
66
- "prettier": "2.7.1",
67
- "replace": "1.2.1",
68
- "rimraf": "3.0.2",
69
- "terser-webpack-plugin": "5.3.6",
70
- "ts-loader": "9.4.1",
71
- "typedoc": "0.23.15",
72
- "typedoc-plugin-merge-modules": "4.0.1",
73
- "typescript": "4.8.4",
74
- "webpack": "5.74.0",
75
- "webpack-bundle-analyzer": "4.6.1",
76
- "webpack-cli": "4.10.0",
77
- "webpack-dev-server": "4.11.1",
78
- "webpack-merge": "5.8.0"
79
- },
80
- "optionalDependencies": {
81
- "@babylonjs/gui": "7.0.0",
82
- "@babylonjs/gui-editor": "7.0.0",
83
- "@babylonjs/inspector": "7.0.0",
84
- "@babylonjs/materials": "7.0.0",
85
- "@babylonjs/node-editor": "7.0.0",
86
- "@babylonjs/node-geometry-editor": "7.0.0"
87
- },
88
- "optionalDependenciesComments": {
89
- "@babylonjs": "Defining the inspector package (and it's dependencies) as optional is required to omit these packages in the production build of the CBN react-app (see CB-9269)"
90
- }
91
- }
1
+ {
2
+ "name": "@combeenation/3d-viewer",
3
+ "version": "14.1.0",
4
+ "description": "Combeenation 3D Viewer",
5
+ "homepage": "https://github.com/Combeenation/3d-viewer#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/Combeenation/3d-viewer/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/Combeenation/3d-viewer.git"
12
+ },
13
+ "license": "Apache 2.0",
14
+ "author": "",
15
+ "contributors": [],
16
+ "main": "dist/lib-cjs/index.js",
17
+ "module": "dist/lib-cjs/index.js",
18
+ "typings": "dist/lib-cjs/index.d.ts",
19
+ "directories": {
20
+ "doc": "docs"
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "src"
25
+ ],
26
+ "scripts": {
27
+ "bundle-analyzer": "npm run generate-profile && webpack-bundle-analyzer dist/webpack-stats.json dist/lib-full",
28
+ "clean-dist": "rimraf dist",
29
+ "dev": "cross-env NODE_ENV='development' webpack serve --config build/webpack.debug.conf.js --progress --hot",
30
+ "dist-cjs": "npm run clean-dist && npm run lint && tsc --project commonjs.tsconfig.json && npm run replace-version",
31
+ "dist-full-dev": "npm run clean-dist && npm run lint && cross-env NODE_ENV='development' webpack --config build/webpack.build.conf.js --progress && npm run replace-version",
32
+ "dist-full-prod": "npm run clean-dist && npm run lint && cross-env NODE_ENV='production' webpack --config build/webpack.build.conf.js --progress && npm run replace-version",
33
+ "docs-local": "typedoc --tsconfig tsconfig.json --media doc/assets --out docs-local",
34
+ "docs-publish": "typedoc --tsconfig tsconfig.json --media doc/assets --out docs",
35
+ "format": "prettier --write ./src",
36
+ "generate-profile": "cross-env NODE_ENV='development' webpack --config build/webpack.build.conf.js --profile --json > dist/webpack-stats.json",
37
+ "lint": "eslint src/**",
38
+ "pack": "npm run dist-cjs && npm pack",
39
+ "pack-to-cjs": "npm run dist-cjs && npm pack --pack-destination=\"/mnt/c/Data/dev/custom-js/MichaelTest/TextureLoadEventsTest/\"",
40
+ "pub-alpha": "npm run dist-cjs && npm publish --tag alpha",
41
+ "pub-beta": "npm run dist-cjs && npm publish --tag beta",
42
+ "pub-final": "npm run dist-cjs && npm publish",
43
+ "pub-rc": "npm run dist-cjs && npm publish --tag rc",
44
+ "replace-version": "cross-env-shell replace \"@VERSION@\" $npm_package_version dist -r",
45
+ "types": "tsc --project declaration.tsconfig.json"
46
+ },
47
+ "prettier": "@combeenation/prettier-config",
48
+ "dependencies": {
49
+ "@babylonjs/core": "7.0.0",
50
+ "@babylonjs/loaders": "7.0.0",
51
+ "@babylonjs/serializers": "7.0.0",
52
+ "eventemitter3": "4.0.7",
53
+ "is-svg": "^5.0.0",
54
+ "lodash-es": "4.17.21"
55
+ },
56
+ "devDependencies": {
57
+ "@combeenation/eslint-config": "0.0.5",
58
+ "@combeenation/prettier-config": "0.0.3",
59
+ "@combeenation/ts-config": "0.0.2",
60
+ "@knodes/typedoc-plugin-pages": "0.23.1",
61
+ "@types/lodash-es": "4.17.6",
62
+ "clean-webpack-plugin": "4.0.0",
63
+ "cross-env": "7.0.3",
64
+ "eslint": "8.25.0",
65
+ "html-webpack-plugin": "5.5.0",
66
+ "prettier": "2.7.1",
67
+ "replace": "1.2.1",
68
+ "rimraf": "3.0.2",
69
+ "terser-webpack-plugin": "5.3.6",
70
+ "ts-loader": "9.4.1",
71
+ "typedoc": "0.23.15",
72
+ "typedoc-plugin-merge-modules": "4.0.1",
73
+ "typescript": "4.8.4",
74
+ "webpack": "5.74.0",
75
+ "webpack-bundle-analyzer": "4.6.1",
76
+ "webpack-cli": "4.10.0",
77
+ "webpack-dev-server": "4.11.1",
78
+ "webpack-merge": "5.8.0"
79
+ },
80
+ "optionalDependencies": {
81
+ "@babylonjs/gui": "7.0.0",
82
+ "@babylonjs/gui-editor": "7.0.0",
83
+ "@babylonjs/inspector": "7.0.0",
84
+ "@babylonjs/materials": "7.0.0",
85
+ "@babylonjs/node-editor": "7.0.0",
86
+ "@babylonjs/node-geometry-editor": "7.0.0"
87
+ },
88
+ "optionalDependenciesComments": {
89
+ "@babylonjs": "Defining the inspector package (and it's dependencies) as optional is required to omit these packages in the production build of the CBN react-app (see CB-9269)"
90
+ }
91
+ }
@@ -1,3 +1,3 @@
1
- {
2
- "version": "@VERSION@"
3
- }
1
+ {
2
+ "version": "@VERSION@"
3
+ }