@combeenation/3d-viewer 14.0.1-rc1 → 15.0.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 (81) 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/cbn-custom-babylon-loader-plugin.js.map +1 -1
  10. package/dist/lib-cjs/internal/cloning-helper.d.ts +19 -19
  11. package/dist/lib-cjs/internal/cloning-helper.js +163 -163
  12. package/dist/lib-cjs/internal/device-helper.d.ts +9 -9
  13. package/dist/lib-cjs/internal/device-helper.js +24 -24
  14. package/dist/lib-cjs/internal/geometry-helper.d.ts +21 -21
  15. package/dist/lib-cjs/internal/geometry-helper.js +145 -145
  16. package/dist/lib-cjs/internal/metadata-helper.d.ts +26 -26
  17. package/dist/lib-cjs/internal/metadata-helper.js +50 -50
  18. package/dist/lib-cjs/internal/paintable-helper.d.ts +40 -40
  19. package/dist/lib-cjs/internal/paintable-helper.js +234 -286
  20. package/dist/lib-cjs/internal/paintable-helper.js.map +1 -1
  21. package/dist/lib-cjs/internal/svg-helper.d.ts +4 -0
  22. package/dist/lib-cjs/internal/svg-helper.js +67 -0
  23. package/dist/lib-cjs/internal/svg-helper.js.map +1 -0
  24. package/dist/lib-cjs/internal/tags-helper.d.ts +12 -12
  25. package/dist/lib-cjs/internal/tags-helper.js +39 -37
  26. package/dist/lib-cjs/internal/tags-helper.js.map +1 -1
  27. package/dist/lib-cjs/internal/texture-parameter-helper.d.ts +37 -0
  28. package/dist/lib-cjs/internal/texture-parameter-helper.js +287 -0
  29. package/dist/lib-cjs/internal/texture-parameter-helper.js.map +1 -0
  30. package/dist/lib-cjs/manager/camera-manager.d.ts +110 -110
  31. package/dist/lib-cjs/manager/camera-manager.js +209 -206
  32. package/dist/lib-cjs/manager/camera-manager.js.map +1 -1
  33. package/dist/lib-cjs/manager/debug-manager.d.ts +60 -60
  34. package/dist/lib-cjs/manager/debug-manager.js +217 -217
  35. package/dist/lib-cjs/manager/event-manager.d.ts +52 -52
  36. package/dist/lib-cjs/manager/event-manager.js +71 -71
  37. package/dist/lib-cjs/manager/gltf-export-manager.d.ts +75 -84
  38. package/dist/lib-cjs/manager/gltf-export-manager.js +286 -290
  39. package/dist/lib-cjs/manager/gltf-export-manager.js.map +1 -1
  40. package/dist/lib-cjs/manager/material-manager.d.ts +35 -35
  41. package/dist/lib-cjs/manager/material-manager.js +125 -125
  42. package/dist/lib-cjs/manager/model-manager.d.ts +145 -145
  43. package/dist/lib-cjs/manager/model-manager.js +382 -382
  44. package/dist/lib-cjs/manager/parameter-manager.d.ts +228 -210
  45. package/dist/lib-cjs/manager/parameter-manager.js +573 -514
  46. package/dist/lib-cjs/manager/parameter-manager.js.map +1 -1
  47. package/dist/lib-cjs/manager/scene-manager.d.ts +45 -45
  48. package/dist/lib-cjs/manager/scene-manager.js +64 -64
  49. package/dist/lib-cjs/manager/texture-manager.d.ts +12 -12
  50. package/dist/lib-cjs/manager/texture-manager.js +43 -43
  51. package/dist/lib-cjs/viewer-error.d.ts +49 -48
  52. package/dist/lib-cjs/viewer-error.js +61 -60
  53. package/dist/lib-cjs/viewer-error.js.map +1 -1
  54. package/dist/lib-cjs/viewer.d.ts +115 -115
  55. package/dist/lib-cjs/viewer.js +217 -217
  56. package/dist/lib-cjs/viewer.js.map +1 -1
  57. package/package.json +94 -91
  58. package/src/buildinfo.json +3 -3
  59. package/src/dev.ts +47 -47
  60. package/src/global-types.d.ts +39 -39
  61. package/src/index.ts +71 -81
  62. package/src/internal/cbn-custom-babylon-loader-plugin.ts +159 -159
  63. package/src/internal/cloning-helper.ts +225 -225
  64. package/src/internal/device-helper.ts +25 -25
  65. package/src/internal/geometry-helper.ts +181 -181
  66. package/src/internal/metadata-helper.ts +63 -63
  67. package/src/internal/paintable-helper.ts +258 -310
  68. package/src/internal/svg-helper.ts +52 -0
  69. package/src/internal/tags-helper.ts +43 -41
  70. package/src/internal/texture-parameter-helper.ts +353 -0
  71. package/src/manager/camera-manager.ts +368 -365
  72. package/src/manager/debug-manager.ts +245 -245
  73. package/src/manager/event-manager.ts +72 -72
  74. package/src/manager/gltf-export-manager.ts +356 -357
  75. package/src/manager/material-manager.ts +135 -135
  76. package/src/manager/model-manager.ts +458 -458
  77. package/src/manager/parameter-manager.ts +730 -652
  78. package/src/manager/scene-manager.ts +101 -101
  79. package/src/manager/texture-manager.ts +32 -32
  80. package/src/viewer-error.ts +69 -68
  81. package/src/viewer.ts +290 -290
@@ -1 +1 @@
1
- {"version":3,"file":"viewer-error.js","sourceRoot":"","sources":["../../src/viewer-error.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAQH;;;;;;;;GAQG;AACU,QAAA,cAAc,GAAG;IAC5B,qBAAqB,EAAE,uBAAuB;IAC9C,kBAAkB,EAAE,oBAAoB;IACxC,kBAAkB,EAAE,oBAAoB;IACxC,gBAAgB,EAAE,kBAAkB;IACpC,kBAAkB,EAAE,oBAAoB;IACxC,wBAAwB,EAAE,0BAA0B;CACrD,CAAC;AAEF,gBAAgB;AAChB,MAAa,WAAY,SAAQ,KAAK;IAGpC,YAAY,IAAqB;QAC/B,mHAAmH;QACnH,oDAAoD;QACpD,KAAK,CAAC,IAAI,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QACtC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,EAAE,CAAC;IAC/B,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,mBAAmB,CAAC,OAAe;;QACxC,MAAM,QAAQ,GAA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AM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,sBAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEzD,SAAS;QACT,2CAA2C;QAC3C,uCAAuC;QACvC,kGAAkG;QAClG,wCAAwC;QACxC,2GAA2G;QAC3G,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,YAAY,GAAG,QAAQ,GAAG,eAAe,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnF,MAAM,EAAE,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,EAAE,CAAC;QAC9B,MAAM,GAAG,GAAG,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,GAAG,KAAI,OAAO,CAAC;QAE3C,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC;IACrB,CAAC;CACF;AApCD,kCAoCC"}
@@ -1,115 +1,115 @@
1
- import * as Index from './index';
2
- import { BoundingInfo, CameraManager, DebugManager, DefaultSceneSettings, Engine, EngineOptions, EventManager, GltfExportManager, MaterialManager, ModelManager, ParameterManager, ParameterSubject, Scene, SceneManager, TextureManager, TransformNode } from './index';
3
- /**
4
- * Use this to define geometry to be excluded from autofocus, GLB export, etc.
5
- */
6
- export declare type ExcludedGeometry = TransformNode | ParameterSubject;
7
- export declare type ExcludedGeometryList = ExcludedGeometry[];
8
- export declare type LimitTextureSizeConfig = {
9
- size: 512 | 1024;
10
- devices: 'iPhone' | 'all';
11
- };
12
- export declare type ViewerSettings = {
13
- antialiasing: boolean;
14
- engineOptions: EngineOptions;
15
- /**
16
- * Important for visual quality on iOS devices, this setting will set the hardware scaling proportional to the devices
17
- * pixel ratio
18
- */
19
- adaptToDeviceRatio: boolean;
20
- /**
21
- * Possibility to limit the size of textures when getting loaded by the engine.\
22
- * Activating this feature potentially saves a lot of memory and can be used to avoid crashes when loading expensive
23
- * models on weaker devices.\
24
- * In praxis this has been an issue with iPhones a lot, therefore it's possible to activate this feature for iPhones
25
- * only as well.
26
- */
27
- limitTextureSize: LimitTextureSizeConfig | false;
28
- /**
29
- * See this forum entry for description of parallel shader compilition effect:
30
- * https://forum.babylonjs.com/t/scene-flickering-when-turning-off-light/48733.\
31
- * Parallel shading compilition generally improves the speed of material compilition and helps when switching
32
- * materials while objects are moving (eg: animations).\
33
- * Deactivating parallel shading compilition is benefitial when switching lights and materials in static scenarios.\
34
- * It's activated by default due to compatibility reasons but can be overwritten with this flag.
35
- */
36
- useParallelShaderCompile: boolean;
37
- };
38
- /**
39
- * This is the entry point into the application.\
40
- * Create an instance to set up the viewer on your canvas.
41
- * ```js
42
- * const canvas = document.getElementById('babylon-canvas');
43
- * const viewer = Viewer(canvas, viewerSettings, defaultSceneSettings);
44
- * ```
45
- * Use "manager" sub classes for interacting with the Babylon.js engine.
46
- * (e.g. `modelManager` for loading models into the scene)
47
- */
48
- export declare class Viewer {
49
- readonly canvas: HTMLCanvasElement;
50
- static readonly version: string;
51
- protected _scene: Scene;
52
- protected _cameraManager: CameraManager;
53
- protected _debugManager: DebugManager;
54
- protected _eventManager: EventManager;
55
- protected _gltfExportManager: GltfExportManager;
56
- protected _materialManager: MaterialManager;
57
- protected _modelManager: ModelManager;
58
- protected _parameterManager: ParameterManager;
59
- protected _sceneManager: SceneManager;
60
- protected _textureManager: TextureManager;
61
- protected _viewerSettings: ViewerSettings;
62
- protected _isRenderLoopPaused: boolean;
63
- get scene(): Scene;
64
- get engine(): Engine;
65
- get cameraManager(): CameraManager;
66
- get debugManager(): DebugManager;
67
- get eventManager(): EventManager;
68
- get gltfExportManager(): GltfExportManager;
69
- get materialManager(): MaterialManager;
70
- get modelManager(): ModelManager;
71
- get parameterManager(): ParameterManager;
72
- /** @internal */
73
- get sceneManager(): SceneManager;
74
- /** @internal */
75
- get textureManager(): TextureManager;
76
- get viewerSettings(): ViewerSettings;
77
- /**
78
- * Returns all modules which are exported by the viewers index file.\
79
- * Needed by the [Combeenation viewer control](https://docs.combeenation.com/docs/3d-viewer-control) in situations where the viewer is injected from external code.\
80
- * See [Combeenation docs](https://docs.combeenation.com/docs/3d-viewer-control-with-custom-js) for more details.
81
- */
82
- static getAllViewerModules(): typeof Index;
83
- /**
84
- * @param viewerSettings Can be overwritten to tweak settings for the Babylon.js engine or viewer internal
85
- * functionalities like "texture downscaling mode"
86
- * @param defaultSceneSettings Can be overwritten to tweak settings for the automatically create Babylon.js scene.\
87
- * This scene contains a camera and an environment per default.
88
- */
89
- constructor(canvas: HTMLCanvasElement, viewerSettings?: DeepPartial<ViewerSettings>, defaultSceneSettings?: DeepPartial<DefaultSceneSettings>);
90
- /**
91
- * Pause rendering can be usefull when doing internal scene processings that should not be visible to the user,
92
- * e.g. cloning meshes for gltf export
93
- */
94
- pauseRendering(): void;
95
- /**
96
- * Resume render loop when paused by {@link pauseRendering} function
97
- */
98
- resumeRendering(): void;
99
- /**
100
- * Destroys this viewer instance and disposes Babylon.js engine and all scene content
101
- */
102
- destroy(): void;
103
- /**
104
- * Calculates size of the current scene.\
105
- * Only takes meshes into considerations that:
106
- * - are visible
107
- * - are not excluded by "excludeGeometry" parameter
108
- * - do not have an infinite distance (like sky boxes)
109
- */
110
- calculateBoundingInfo(excludeGeometry?: ExcludedGeometryList): BoundingInfo;
111
- /**
112
- * Set up viewer (engine and scene) and initialize all managers
113
- */
114
- protected _init(defaultSceneSettings?: DeepPartial<DefaultSceneSettings>): void;
115
- }
1
+ import * as Index from './index';
2
+ import { BoundingInfo, CameraManager, DebugManager, DefaultSceneSettings, Engine, EngineOptions, EventManager, GltfExportManager, MaterialManager, ModelManager, ParameterManager, ParameterSubject, Scene, SceneManager, TextureManager, TransformNode } from './index';
3
+ /**
4
+ * Use this to define geometry to be excluded from autofocus, GLB export, etc.
5
+ */
6
+ export declare type ExcludedGeometry = TransformNode | ParameterSubject;
7
+ export declare type ExcludedGeometryList = ExcludedGeometry[];
8
+ export declare type LimitTextureSizeConfig = {
9
+ size: 512 | 1024;
10
+ devices: 'iPhone' | 'all';
11
+ };
12
+ export declare type ViewerSettings = {
13
+ antialiasing: boolean;
14
+ engineOptions: EngineOptions;
15
+ /**
16
+ * Important for visual quality on iOS devices, this setting will set the hardware scaling proportional to the devices
17
+ * pixel ratio
18
+ */
19
+ adaptToDeviceRatio: boolean;
20
+ /**
21
+ * Possibility to limit the size of textures when getting loaded by the engine.\
22
+ * Activating this feature potentially saves a lot of memory and can be used to avoid crashes when loading expensive
23
+ * models on weaker devices.\
24
+ * In praxis this has been an issue with iPhones a lot, therefore it's possible to activate this feature for iPhones
25
+ * only as well.
26
+ */
27
+ limitTextureSize: LimitTextureSizeConfig | false;
28
+ /**
29
+ * See this forum entry for description of parallel shader compilition effect:
30
+ * https://forum.babylonjs.com/t/scene-flickering-when-turning-off-light/48733.\
31
+ * Parallel shading compilition generally improves the speed of material compilition and helps when switching
32
+ * materials while objects are moving (eg: animations).\
33
+ * Deactivating parallel shading compilition is benefitial when switching lights and materials in static scenarios.\
34
+ * It's activated by default due to compatibility reasons but can be overwritten with this flag.
35
+ */
36
+ useParallelShaderCompile: boolean;
37
+ };
38
+ /**
39
+ * This is the entry point into the application.\
40
+ * Create an instance to set up the viewer on your canvas.
41
+ * ```js
42
+ * const canvas = document.getElementById('babylon-canvas');
43
+ * const viewer = Viewer(canvas, viewerSettings, defaultSceneSettings);
44
+ * ```
45
+ * Use "manager" sub classes for interacting with the Babylon.js engine.
46
+ * (e.g. `modelManager` for loading models into the scene)
47
+ */
48
+ export declare class Viewer {
49
+ readonly canvas: HTMLCanvasElement;
50
+ static readonly version: string;
51
+ protected _scene: Scene;
52
+ protected _cameraManager: CameraManager;
53
+ protected _debugManager: DebugManager;
54
+ protected _eventManager: EventManager;
55
+ protected _gltfExportManager: GltfExportManager;
56
+ protected _materialManager: MaterialManager;
57
+ protected _modelManager: ModelManager;
58
+ protected _parameterManager: ParameterManager;
59
+ protected _sceneManager: SceneManager;
60
+ protected _textureManager: TextureManager;
61
+ protected _viewerSettings: ViewerSettings;
62
+ protected _isRenderLoopPaused: boolean;
63
+ get scene(): Scene;
64
+ get engine(): Engine;
65
+ get cameraManager(): CameraManager;
66
+ get debugManager(): DebugManager;
67
+ get eventManager(): EventManager;
68
+ get gltfExportManager(): GltfExportManager;
69
+ get materialManager(): MaterialManager;
70
+ get modelManager(): ModelManager;
71
+ get parameterManager(): ParameterManager;
72
+ /** @internal */
73
+ get sceneManager(): SceneManager;
74
+ /** @internal */
75
+ get textureManager(): TextureManager;
76
+ get viewerSettings(): ViewerSettings;
77
+ /**
78
+ * Returns all modules which are exported by the viewers index file.\
79
+ * Needed by the [Combeenation viewer control](https://docs.combeenation.com/docs/3d-viewer-control) in situations where the viewer is injected from external code.\
80
+ * See [Combeenation docs](https://docs.combeenation.com/docs/3d-viewer-control-with-custom-js) for more details.
81
+ */
82
+ static getAllViewerModules(): typeof Index;
83
+ /**
84
+ * @param viewerSettings Can be overwritten to tweak settings for the Babylon.js engine or viewer internal
85
+ * functionalities like "texture downscaling mode"
86
+ * @param defaultSceneSettings Can be overwritten to tweak settings for the automatically create Babylon.js scene.\
87
+ * This scene contains a camera and an environment per default.
88
+ */
89
+ constructor(canvas: HTMLCanvasElement, viewerSettings?: DeepPartial<ViewerSettings>, defaultSceneSettings?: DeepPartial<DefaultSceneSettings>);
90
+ /**
91
+ * Pause rendering can be usefull when doing internal scene processings that should not be visible to the user,
92
+ * e.g. cloning meshes for gltf export
93
+ */
94
+ pauseRendering(): void;
95
+ /**
96
+ * Resume render loop when paused by {@link pauseRendering} function
97
+ */
98
+ resumeRendering(): void;
99
+ /**
100
+ * Destroys this viewer instance and disposes Babylon.js engine and all scene content
101
+ */
102
+ destroy(): void;
103
+ /**
104
+ * Calculates size of the current scene.\
105
+ * Only takes meshes into considerations that:
106
+ * - are visible
107
+ * - are not excluded by "excludeGeometry" parameter
108
+ * - do not have an infinite distance (like sky boxes)
109
+ */
110
+ calculateBoundingInfo(excludeGeometry?: ExcludedGeometryList): BoundingInfo;
111
+ /**
112
+ * Set up viewer (engine and scene) and initialize all managers
113
+ */
114
+ protected _init(defaultSceneSettings?: DeepPartial<DefaultSceneSettings>): void;
115
+ }