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

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 (65) 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 +62 -62
  5. package/dist/lib-cjs/index.js +94 -94
  6. package/dist/lib-cjs/internal/cbn-custom-babylon-loader-plugin.d.ts +10 -10
  7. package/dist/lib-cjs/internal/cbn-custom-babylon-loader-plugin.js +131 -131
  8. package/dist/lib-cjs/internal/cloning-helper.d.ts +19 -19
  9. package/dist/lib-cjs/internal/cloning-helper.js +163 -163
  10. package/dist/lib-cjs/internal/device-helper.d.ts +9 -9
  11. package/dist/lib-cjs/internal/device-helper.js +24 -24
  12. package/dist/lib-cjs/internal/geometry-helper.d.ts +21 -21
  13. package/dist/lib-cjs/internal/geometry-helper.js +145 -145
  14. package/dist/lib-cjs/internal/metadata-helper.d.ts +26 -26
  15. package/dist/lib-cjs/internal/metadata-helper.js +50 -50
  16. package/dist/lib-cjs/internal/paintable-helper.d.ts +40 -40
  17. package/dist/lib-cjs/internal/paintable-helper.js +286 -286
  18. package/dist/lib-cjs/internal/tags-helper.d.ts +12 -12
  19. package/dist/lib-cjs/internal/tags-helper.js +37 -37
  20. package/dist/lib-cjs/manager/camera-manager.d.ts +110 -110
  21. package/dist/lib-cjs/manager/camera-manager.js +206 -206
  22. package/dist/lib-cjs/manager/debug-manager.d.ts +60 -60
  23. package/dist/lib-cjs/manager/debug-manager.js +217 -217
  24. package/dist/lib-cjs/manager/event-manager.d.ts +52 -52
  25. package/dist/lib-cjs/manager/event-manager.js +71 -71
  26. package/dist/lib-cjs/manager/gltf-export-manager.d.ts +84 -75
  27. package/dist/lib-cjs/manager/gltf-export-manager.js +290 -278
  28. package/dist/lib-cjs/manager/gltf-export-manager.js.map +1 -1
  29. package/dist/lib-cjs/manager/material-manager.d.ts +35 -35
  30. package/dist/lib-cjs/manager/material-manager.js +125 -125
  31. package/dist/lib-cjs/manager/model-manager.d.ts +145 -145
  32. package/dist/lib-cjs/manager/model-manager.js +382 -382
  33. package/dist/lib-cjs/manager/parameter-manager.d.ts +210 -210
  34. package/dist/lib-cjs/manager/parameter-manager.js +514 -514
  35. package/dist/lib-cjs/manager/scene-manager.d.ts +45 -45
  36. package/dist/lib-cjs/manager/scene-manager.js +64 -64
  37. package/dist/lib-cjs/manager/texture-manager.d.ts +12 -12
  38. package/dist/lib-cjs/manager/texture-manager.js +43 -43
  39. package/dist/lib-cjs/viewer-error.d.ts +48 -48
  40. package/dist/lib-cjs/viewer-error.js +60 -60
  41. package/dist/lib-cjs/viewer.d.ts +115 -115
  42. package/dist/lib-cjs/viewer.js +217 -217
  43. package/package.json +91 -91
  44. package/src/buildinfo.json +3 -3
  45. package/src/dev.ts +47 -47
  46. package/src/global-types.d.ts +39 -39
  47. package/src/index.ts +81 -81
  48. package/src/internal/cbn-custom-babylon-loader-plugin.ts +159 -159
  49. package/src/internal/cloning-helper.ts +225 -225
  50. package/src/internal/device-helper.ts +25 -25
  51. package/src/internal/geometry-helper.ts +181 -181
  52. package/src/internal/metadata-helper.ts +63 -63
  53. package/src/internal/paintable-helper.ts +310 -310
  54. package/src/internal/tags-helper.ts +41 -41
  55. package/src/manager/camera-manager.ts +365 -365
  56. package/src/manager/debug-manager.ts +245 -245
  57. package/src/manager/event-manager.ts +72 -72
  58. package/src/manager/gltf-export-manager.ts +357 -341
  59. package/src/manager/material-manager.ts +135 -135
  60. package/src/manager/model-manager.ts +458 -458
  61. package/src/manager/parameter-manager.ts +652 -652
  62. package/src/manager/scene-manager.ts +101 -101
  63. package/src/manager/texture-manager.ts +32 -32
  64. package/src/viewer-error.ts +68 -68
  65. package/src/viewer.ts +290 -290
@@ -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
+ }