@combeenation/3d-viewer 5.1.2 → 5.2.0-alpha4

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 (221) hide show
  1. package/README.md +111 -111
  2. package/dist/lib-cjs/api/classes/animationInterface.d.ts +8 -8
  3. package/dist/lib-cjs/api/classes/animationInterface.js +2 -1
  4. package/dist/lib-cjs/api/classes/dottedPath.d.ts +79 -79
  5. package/dist/lib-cjs/api/classes/dottedPath.js +166 -187
  6. package/dist/lib-cjs/api/classes/dottedPath.js.map +1 -1
  7. package/dist/lib-cjs/api/classes/element.d.ts +149 -149
  8. package/dist/lib-cjs/api/classes/element.js +668 -823
  9. package/dist/lib-cjs/api/classes/element.js.map +1 -1
  10. package/dist/lib-cjs/api/classes/event.d.ts +326 -326
  11. package/dist/lib-cjs/api/classes/event.js +349 -371
  12. package/dist/lib-cjs/api/classes/event.js.map +1 -1
  13. package/dist/lib-cjs/api/classes/eventBroadcaster.d.ts +26 -26
  14. package/dist/lib-cjs/api/classes/eventBroadcaster.js +49 -53
  15. package/dist/lib-cjs/api/classes/eventBroadcaster.js.map +1 -1
  16. package/dist/lib-cjs/api/classes/parameter.d.ts +336 -336
  17. package/dist/lib-cjs/api/classes/parameter.js +461 -471
  18. package/dist/lib-cjs/api/classes/parameter.js.map +1 -1
  19. package/dist/lib-cjs/api/classes/parameterObservable.d.ts +36 -36
  20. package/dist/lib-cjs/api/classes/parameterObservable.js +97 -101
  21. package/dist/lib-cjs/api/classes/parameterObservable.js.map +1 -1
  22. package/dist/lib-cjs/api/classes/parameterizable.d.ts +15 -15
  23. package/dist/lib-cjs/api/classes/parameterizable.js +102 -149
  24. package/dist/lib-cjs/api/classes/parameterizable.js.map +1 -1
  25. package/dist/lib-cjs/api/classes/placementAnimation.d.ts +45 -44
  26. package/dist/lib-cjs/api/classes/placementAnimation.js +175 -163
  27. package/dist/lib-cjs/api/classes/placementAnimation.js.map +1 -1
  28. package/dist/lib-cjs/api/classes/variant.d.ts +234 -234
  29. package/dist/lib-cjs/api/classes/variant.js +836 -1203
  30. package/dist/lib-cjs/api/classes/variant.js.map +1 -1
  31. package/dist/lib-cjs/api/classes/variantInstance.d.ts +45 -45
  32. package/dist/lib-cjs/api/classes/variantInstance.js +101 -108
  33. package/dist/lib-cjs/api/classes/variantInstance.js.map +1 -1
  34. package/dist/lib-cjs/api/classes/variantParameterizable.d.ts +17 -17
  35. package/dist/lib-cjs/api/classes/variantParameterizable.js +88 -99
  36. package/dist/lib-cjs/api/classes/variantParameterizable.js.map +1 -1
  37. package/dist/lib-cjs/api/classes/viewer.d.ts +187 -184
  38. package/dist/lib-cjs/api/classes/viewer.js +593 -731
  39. package/dist/lib-cjs/api/classes/viewer.js.map +1 -1
  40. package/dist/lib-cjs/api/classes/viewerLight.d.ts +66 -66
  41. package/dist/lib-cjs/api/classes/viewerLight.js +343 -392
  42. package/dist/lib-cjs/api/classes/viewerLight.js.map +1 -1
  43. package/dist/lib-cjs/api/internal/lensRendering.d.ts +8 -8
  44. package/dist/lib-cjs/api/internal/lensRendering.js +11 -11
  45. package/dist/lib-cjs/api/internal/lensRendering.js.map +1 -1
  46. package/dist/lib-cjs/api/internal/sceneSetup.d.ts +13 -13
  47. package/dist/lib-cjs/api/internal/sceneSetup.js +225 -238
  48. package/dist/lib-cjs/api/internal/sceneSetup.js.map +1 -1
  49. package/dist/lib-cjs/api/manager/animationManager.d.ts +30 -29
  50. package/dist/lib-cjs/api/manager/animationManager.js +126 -130
  51. package/dist/lib-cjs/api/manager/animationManager.js.map +1 -1
  52. package/dist/lib-cjs/api/manager/gltfExportManager.d.ts +65 -65
  53. package/dist/lib-cjs/api/manager/gltfExportManager.js +196 -223
  54. package/dist/lib-cjs/api/manager/gltfExportManager.js.map +1 -1
  55. package/dist/lib-cjs/api/manager/sceneManager.d.ts +31 -31
  56. package/dist/lib-cjs/api/manager/sceneManager.js +127 -152
  57. package/dist/lib-cjs/api/manager/sceneManager.js.map +1 -1
  58. package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +92 -92
  59. package/dist/lib-cjs/api/manager/variantInstanceManager.js +260 -335
  60. package/dist/lib-cjs/api/manager/variantInstanceManager.js.map +1 -1
  61. package/dist/lib-cjs/api/store/specStorage.d.ts +24 -24
  62. package/dist/lib-cjs/api/store/specStorage.js +50 -51
  63. package/dist/lib-cjs/api/store/specStorage.js.map +1 -1
  64. package/dist/lib-cjs/api/util/babylonHelper.d.ts +174 -174
  65. package/dist/lib-cjs/api/util/babylonHelper.js +591 -611
  66. package/dist/lib-cjs/api/util/babylonHelper.js.map +1 -1
  67. package/dist/lib-cjs/api/util/globalTypes.d.ts +366 -366
  68. package/dist/lib-cjs/api/util/globalTypes.js +1 -1
  69. package/dist/lib-cjs/api/util/resourceHelper.d.ts +58 -58
  70. package/dist/lib-cjs/api/util/resourceHelper.js +201 -257
  71. package/dist/lib-cjs/api/util/resourceHelper.js.map +1 -1
  72. package/dist/lib-cjs/api/util/sceneLoaderHelper.d.ts +35 -35
  73. package/dist/lib-cjs/api/util/sceneLoaderHelper.js +141 -140
  74. package/dist/lib-cjs/api/util/sceneLoaderHelper.js.map +1 -1
  75. package/dist/lib-cjs/api/util/stringHelper.d.ts +9 -9
  76. package/dist/lib-cjs/api/util/stringHelper.js +23 -25
  77. package/dist/lib-cjs/api/util/stringHelper.js.map +1 -1
  78. package/dist/lib-cjs/api/util/structureHelper.d.ts +9 -9
  79. package/dist/lib-cjs/api/util/structureHelper.js +48 -48
  80. package/dist/lib-cjs/api/util/structureHelper.js.map +1 -1
  81. package/dist/lib-cjs/buildinfo.json +3 -3
  82. package/dist/lib-cjs/index.d.ts +51 -49
  83. package/dist/lib-cjs/index.js +110 -89
  84. package/dist/lib-cjs/index.js.map +1 -1
  85. package/dist/lib-es6/api/classes/animationInterface.d.ts +8 -8
  86. package/dist/lib-es6/api/classes/animationInterface.js +1 -1
  87. package/dist/lib-es6/api/classes/dottedPath.d.ts +79 -79
  88. package/dist/lib-es6/api/classes/dottedPath.js +162 -184
  89. package/dist/lib-es6/api/classes/dottedPath.js.map +1 -1
  90. package/dist/lib-es6/api/classes/element.d.ts +149 -149
  91. package/dist/lib-es6/api/classes/element.js +664 -820
  92. package/dist/lib-es6/api/classes/element.js.map +1 -1
  93. package/dist/lib-es6/api/classes/event.d.ts +326 -326
  94. package/dist/lib-es6/api/classes/event.js +345 -368
  95. package/dist/lib-es6/api/classes/event.js.map +1 -1
  96. package/dist/lib-es6/api/classes/eventBroadcaster.d.ts +26 -26
  97. package/dist/lib-es6/api/classes/eventBroadcaster.js +42 -50
  98. package/dist/lib-es6/api/classes/eventBroadcaster.js.map +1 -1
  99. package/dist/lib-es6/api/classes/parameter.d.ts +336 -336
  100. package/dist/lib-es6/api/classes/parameter.js +457 -468
  101. package/dist/lib-es6/api/classes/parameter.js.map +1 -1
  102. package/dist/lib-es6/api/classes/parameterObservable.d.ts +36 -36
  103. package/dist/lib-es6/api/classes/parameterObservable.js +93 -98
  104. package/dist/lib-es6/api/classes/parameterObservable.js.map +1 -1
  105. package/dist/lib-es6/api/classes/parameterizable.d.ts +15 -15
  106. package/dist/lib-es6/api/classes/parameterizable.js +98 -146
  107. package/dist/lib-es6/api/classes/parameterizable.js.map +1 -1
  108. package/dist/lib-es6/api/classes/placementAnimation.d.ts +45 -44
  109. package/dist/lib-es6/api/classes/placementAnimation.js +171 -160
  110. package/dist/lib-es6/api/classes/placementAnimation.js.map +1 -1
  111. package/dist/lib-es6/api/classes/variant.d.ts +234 -234
  112. package/dist/lib-es6/api/classes/variant.js +832 -1198
  113. package/dist/lib-es6/api/classes/variant.js.map +1 -1
  114. package/dist/lib-es6/api/classes/variantInstance.d.ts +45 -45
  115. package/dist/lib-es6/api/classes/variantInstance.js +97 -105
  116. package/dist/lib-es6/api/classes/variantInstance.js.map +1 -1
  117. package/dist/lib-es6/api/classes/variantParameterizable.d.ts +17 -17
  118. package/dist/lib-es6/api/classes/variantParameterizable.js +84 -96
  119. package/dist/lib-es6/api/classes/variantParameterizable.js.map +1 -1
  120. package/dist/lib-es6/api/classes/viewer.d.ts +187 -184
  121. package/dist/lib-es6/api/classes/viewer.js +586 -728
  122. package/dist/lib-es6/api/classes/viewer.js.map +1 -1
  123. package/dist/lib-es6/api/classes/viewerLight.d.ts +66 -66
  124. package/dist/lib-es6/api/classes/viewerLight.js +316 -389
  125. package/dist/lib-es6/api/classes/viewerLight.js.map +1 -1
  126. package/dist/lib-es6/api/internal/lensRendering.d.ts +8 -8
  127. package/dist/lib-es6/api/internal/lensRendering.js +8 -8
  128. package/dist/lib-es6/api/internal/lensRendering.js.map +1 -1
  129. package/dist/lib-es6/api/internal/sceneSetup.d.ts +13 -13
  130. package/dist/lib-es6/api/internal/sceneSetup.js +197 -233
  131. package/dist/lib-es6/api/internal/sceneSetup.js.map +1 -1
  132. package/dist/lib-es6/api/manager/animationManager.d.ts +30 -29
  133. package/dist/lib-es6/api/manager/animationManager.js +122 -127
  134. package/dist/lib-es6/api/manager/animationManager.js.map +1 -1
  135. package/dist/lib-es6/api/manager/gltfExportManager.d.ts +65 -65
  136. package/dist/lib-es6/api/manager/gltfExportManager.js +192 -220
  137. package/dist/lib-es6/api/manager/gltfExportManager.js.map +1 -1
  138. package/dist/lib-es6/api/manager/sceneManager.d.ts +31 -31
  139. package/dist/lib-es6/api/manager/sceneManager.js +123 -149
  140. package/dist/lib-es6/api/manager/sceneManager.js.map +1 -1
  141. package/dist/lib-es6/api/manager/variantInstanceManager.d.ts +92 -92
  142. package/dist/lib-es6/api/manager/variantInstanceManager.js +256 -332
  143. package/dist/lib-es6/api/manager/variantInstanceManager.js.map +1 -1
  144. package/dist/lib-es6/api/store/specStorage.d.ts +24 -24
  145. package/dist/lib-es6/api/store/specStorage.js +46 -48
  146. package/dist/lib-es6/api/store/specStorage.js.map +1 -1
  147. package/dist/lib-es6/api/util/babylonHelper.d.ts +174 -174
  148. package/dist/lib-es6/api/util/babylonHelper.js +561 -581
  149. package/dist/lib-es6/api/util/babylonHelper.js.map +1 -1
  150. package/dist/lib-es6/api/util/globalTypes.d.ts +366 -366
  151. package/dist/lib-es6/api/util/globalTypes.js +1 -1
  152. package/dist/lib-es6/api/util/resourceHelper.d.ts +58 -58
  153. package/dist/lib-es6/api/util/resourceHelper.js +191 -247
  154. package/dist/lib-es6/api/util/resourceHelper.js.map +1 -1
  155. package/dist/lib-es6/api/util/sceneLoaderHelper.d.ts +35 -35
  156. package/dist/lib-es6/api/util/sceneLoaderHelper.js +131 -133
  157. package/dist/lib-es6/api/util/sceneLoaderHelper.js.map +1 -1
  158. package/dist/lib-es6/api/util/stringHelper.d.ts +9 -9
  159. package/dist/lib-es6/api/util/stringHelper.js +19 -21
  160. package/dist/lib-es6/api/util/stringHelper.js.map +1 -1
  161. package/dist/lib-es6/api/util/structureHelper.d.ts +9 -9
  162. package/dist/lib-es6/api/util/structureHelper.js +45 -45
  163. package/dist/lib-es6/api/util/structureHelper.js.map +1 -1
  164. package/dist/lib-es6/buildinfo.json +3 -3
  165. package/dist/lib-es6/index.d.ts +51 -49
  166. package/dist/lib-es6/index.js +48 -50
  167. package/dist/lib-es6/index.js.map +1 -1
  168. package/dist/lib-full/lens-rendering.js +2 -0
  169. package/dist/lib-full/lens-rendering.js.map +1 -0
  170. package/dist/lib-full/main.js +3 -0
  171. package/dist/lib-full/main.js.LICENSE.txt +9 -0
  172. package/dist/lib-full/main.js.map +1 -0
  173. package/package.json +76 -88
  174. package/src/api/classes/animationInterface.ts +10 -10
  175. package/src/api/classes/dottedPath.ts +181 -181
  176. package/src/api/classes/element.ts +716 -716
  177. package/src/api/classes/event.ts +367 -367
  178. package/src/api/classes/eventBroadcaster.ts +52 -52
  179. package/src/api/classes/parameter.ts +494 -494
  180. package/src/api/classes/parameterObservable.ts +100 -100
  181. package/src/api/classes/parameterizable.ts +87 -87
  182. package/src/api/classes/placementAnimation.ts +161 -160
  183. package/src/api/classes/variant.ts +904 -905
  184. package/src/api/classes/variantInstance.ts +97 -97
  185. package/src/api/classes/variantParameterizable.ts +85 -85
  186. package/src/api/classes/viewer.ts +669 -668
  187. package/src/api/classes/viewerLight.ts +334 -334
  188. package/src/api/internal/debugViewer.ts +90 -90
  189. package/src/api/internal/lensRendering.ts +9 -10
  190. package/src/api/internal/sceneSetup.ts +204 -204
  191. package/src/api/manager/animationManager.ts +143 -142
  192. package/src/api/manager/gltfExportManager.ts +191 -191
  193. package/src/api/manager/sceneManager.ts +127 -127
  194. package/src/api/manager/variantInstanceManager.ts +265 -265
  195. package/src/api/store/specStorage.ts +51 -51
  196. package/src/api/util/babylonHelper.ts +663 -663
  197. package/src/api/util/globalTypes.ts +413 -413
  198. package/src/api/util/resourceHelper.ts +189 -189
  199. package/src/api/util/sceneLoaderHelper.ts +148 -147
  200. package/src/api/util/stringHelper.ts +23 -23
  201. package/src/api/util/structureHelper.ts +49 -49
  202. package/src/buildinfo.json +3 -3
  203. package/src/dev.ts +61 -64
  204. package/src/index.ts +96 -94
  205. package/src/types.d.ts +28 -28
  206. package/dist/lib-cjs/api/classes/elementParameterizable.d.ts +0 -14
  207. package/dist/lib-cjs/api/classes/elementParameterizable.js +0 -135
  208. package/dist/lib-cjs/api/classes/elementParameterizable.js.map +0 -1
  209. package/dist/lib-cjs/api/internal/debugViewer.d.ts +0 -13
  210. package/dist/lib-cjs/api/internal/debugViewer.js +0 -87
  211. package/dist/lib-cjs/api/internal/debugViewer.js.map +0 -1
  212. package/dist/lib-es6/api/internal/debugViewer.d.ts +0 -13
  213. package/dist/lib-es6/api/internal/debugViewer.js +0 -84
  214. package/dist/lib-es6/api/internal/debugViewer.js.map +0 -1
  215. package/dist/webpack-stats.json +0 -0
  216. package/src/commonjs.tsconfig.json +0 -10
  217. package/src/declaration.tsconfig.json +0 -8
  218. package/src/es6.tsconfig.json +0 -10
  219. package/src/pagesconfig.json +0 -81
  220. package/src/tsconfig.json +0 -33
  221. package/src/tsconfig.types.json +0 -9
@@ -1,390 +1,317 @@
1
- import { __awaiter, __extends, __generator } from "tslib";
2
- import { PointLight } from '@babylonjs/core/Lights/pointLight';
3
- import { HemisphericLight } from '@babylonjs/core/Lights/hemisphericLight';
4
- import { ShadowLight } from '@babylonjs/core/Lights/shadowLight';
5
- import { ShadowGenerator } from '@babylonjs/core/Lights/Shadows/shadowGenerator';
6
- import '@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent';
7
- import { Vector3 } from '@babylonjs/core/Maths/math.vector';
8
- import { TransformNode } from '@babylonjs/core/Meshes/transformNode';
9
- import '@babylonjs/loaders/glTF/2.0/Extensions/KHR_lights_punctual';
10
- import { get, isEmpty, isString, set } from 'lodash-es';
11
- import { cloneNodeWithParents, disableNodeWithParents, enableNodeWithParents, getRootNode, injectNodeMetadata, transformTransformNode, } from './../util/babylonHelper';
12
- import { DottedPath } from './dottedPath';
13
- import { Parameter } from './parameter';
14
- import { VariantParameterizable } from './variantParameterizable';
15
- /**
16
- * A {@link ViewerLight} of a {@link Variant}. Acts as a container for BabylonJS lights. Lives only in the context of a
17
- * {@link Variant}.
18
- */
19
- var ViewerLight = /** @class */ (function (_super) {
20
- __extends(ViewerLight, _super);
21
- /**
22
- * Constructor.
23
- */
24
- function ViewerLight(variant, name) {
25
- var _this = _super.call(this, variant, name) || this;
26
- _this.variant = variant;
27
- _this.name = name;
28
- _this.addParameterObservers();
29
- return _this;
30
- }
31
- /**
32
- * Creates a {@link ViewerLight} with given name.
33
- */
34
- ViewerLight.create = function (variant, name) {
35
- return __awaiter(this, void 0, void 0, function () {
36
- var viewerLight, _a;
37
- return __generator(this, function (_b) {
38
- switch (_b.label) {
39
- case 0:
40
- viewerLight = new ViewerLight(variant, name);
41
- _a = viewerLight;
42
- return [4 /*yield*/, viewerLight.createBabylonLightFromDefinition(viewerLight.definition)];
43
- case 1:
44
- _a._light = _b.sent();
45
- return [2 /*return*/, viewerLight];
46
- }
47
- });
48
- });
49
- };
50
- Object.defineProperty(ViewerLight.prototype, "light", {
51
- /**
52
- * The wrapped Light.
53
- */
54
- get: function () {
55
- if (!this._light) {
56
- throw new Error("Light for ViewerLight \"" + this.name + "\" has not been properly initialized.");
57
- }
58
- return this._light;
59
- },
60
- enumerable: false,
61
- configurable: true
62
- });
63
- Object.defineProperty(ViewerLight.prototype, "dottedPath", {
64
- /**
65
- * The {@link DottedPath} in the built tree of {@link ViewerLight}s.
66
- * E.g. "_.top-1.sub-2.sub-sub-3.el-1"
67
- */
68
- get: function () {
69
- return DottedPath.create(this.variant.dottedPath).addPart(this.name);
70
- },
71
- enumerable: false,
72
- configurable: true
73
- });
74
- Object.defineProperty(ViewerLight.prototype, "id", {
75
- /**
76
- * The id representing a {@link DottedPath}.
77
- */
78
- get: function () {
79
- var dottedPath = DottedPath.create(this.dottedPath);
80
- dottedPath.shiftPart(); // remove root
81
- return dottedPath.path;
82
- },
83
- enumerable: false,
84
- configurable: true
85
- });
86
- Object.defineProperty(ViewerLight.prototype, "definition", {
87
- /**
88
- * The {@link LightDefinition} of the {@link ViewerLight}.
89
- */
90
- get: function () {
91
- var definition = this.variant.structureJson.lights[this.name];
92
- if (isString(definition)) {
93
- return {
94
- type: 'baked',
95
- path: definition,
96
- };
97
- }
98
- return definition;
99
- },
100
- enumerable: false,
101
- configurable: true
102
- });
103
- Object.defineProperty(ViewerLight.prototype, "type", {
104
- /**
105
- * The type of the {@link ViewerLight}'s light.
106
- */
107
- get: function () {
108
- return this.light.constructor.name.replace(/light/i, '').toLowerCase();
109
- },
110
- enumerable: false,
111
- configurable: true
112
- });
113
- /**
114
- * @see {@link VariantParameterizable.commitParameters}
115
- * @emit {@link Event.VIEWER_LIGHT_PARAMETER_COMMITTED}
116
- */
117
- ViewerLight.prototype.commitParameters = function (parameters) {
118
- return __awaiter(this, void 0, void 0, function () {
119
- return __generator(this, function (_a) {
120
- return [2 /*return*/, _super.prototype.commitParameters.call(this, parameters)];
121
- });
122
- });
123
- };
124
- /**
125
- * Adds the default {@link ParameterObserver}s which are called every time {@link commitParameters} is called.
126
- */
127
- ViewerLight.prototype.addParameterObservers = function () {
128
- var _this = this;
129
- this._parameterObservers.set(Parameter.VISIBLE, [
130
- function (light, oldValue, newValue) { return __awaiter(_this, void 0, void 0, function () {
131
- var visible;
132
- return __generator(this, function (_a) {
133
- try {
134
- visible = Parameter.parseBoolean(newValue);
135
- }
136
- catch (e) {
137
- return [2 /*return*/];
138
- }
139
- if (visible === true) {
140
- enableNodeWithParents(light.light);
141
- }
142
- else if (visible === false) {
143
- disableNodeWithParents(light.light);
144
- }
145
- return [2 /*return*/];
146
- });
147
- }); },
148
- ]);
149
- this._parameterObservers.set(Parameter.INTENSITY, [
150
- function (light, oldValue, newValue) { return __awaiter(_this, void 0, void 0, function () {
151
- return __generator(this, function (_a) {
152
- set(light.light, 'intensity', Parameter.parseNumber(newValue));
153
- return [2 /*return*/];
154
- });
155
- }); },
156
- ]);
157
- this._parameterObservers.set(Parameter.SCALING, [
158
- function (light, oldValue, newValue) { return __awaiter(_this, void 0, void 0, function () {
159
- var rootNode;
160
- return __generator(this, function (_a) {
161
- rootNode = getRootNode(light.light);
162
- if (rootNode instanceof TransformNode) {
163
- transformTransformNode(rootNode, {
164
- scaling: Parameter.parseScaling(newValue),
165
- position: Parameter.parseVector(light.inheritedParameters[Parameter.POSITION] || '(0, 0, 0)'),
166
- rotation: Parameter.parseRotation(light.inheritedParameters[Parameter.ROTATION] || '(0, 0, 0)'),
167
- });
168
- }
169
- return [2 /*return*/];
170
- });
171
- }); },
172
- ]);
173
- this._parameterObservers.set(Parameter.POSITION, [
174
- function (light, oldValue, newValue) { return __awaiter(_this, void 0, void 0, function () {
175
- var rootNode;
176
- return __generator(this, function (_a) {
177
- rootNode = getRootNode(light.light);
178
- if (rootNode instanceof TransformNode) {
179
- transformTransformNode(rootNode, {
180
- scaling: Parameter.parseVector(light.inheritedParameters[Parameter.SCALING] || '(1, 1, 1)'),
181
- position: Parameter.parseVector(newValue),
182
- rotation: Parameter.parseRotation(light.inheritedParameters[Parameter.ROTATION] || '(0, 0, 0)'),
183
- });
184
- }
185
- return [2 /*return*/];
186
- });
187
- }); },
188
- ]);
189
- this._parameterObservers.set(Parameter.ROTATION, [
190
- function (light, oldValue, newValue) { return __awaiter(_this, void 0, void 0, function () {
191
- var rootNode;
192
- return __generator(this, function (_a) {
193
- rootNode = getRootNode(light.light);
194
- if (rootNode instanceof TransformNode) {
195
- transformTransformNode(rootNode, {
196
- scaling: Parameter.parseVector(light.inheritedParameters[Parameter.SCALING] || '(1, 1, 1)'),
197
- position: Parameter.parseVector(light.inheritedParameters[Parameter.POSITION] || '(0, 0, 0)'),
198
- rotation: Parameter.parseRotation(newValue),
199
- });
200
- }
201
- return [2 /*return*/];
202
- });
203
- }); },
204
- ]);
205
- this._parameterObservers.set(Parameter.DIRECTION, [
206
- function (light, oldValue, newValue) { return __awaiter(_this, void 0, void 0, function () {
207
- return __generator(this, function (_a) {
208
- if ((light.light instanceof ShadowLight && !(light.light instanceof PointLight)) ||
209
- light.light instanceof HemisphericLight) {
210
- set(light.light, 'direction', Parameter.parseVector(newValue));
211
- }
212
- return [2 /*return*/];
213
- });
214
- }); },
215
- ]);
216
- this._parameterObservers.set(Parameter.ANGLE, [
217
- function (light, oldValue, newValue) { return __awaiter(_this, void 0, void 0, function () {
218
- return __generator(this, function (_a) {
219
- if (light.light.getClassName() === 'SpotLight') {
220
- set(light.light, 'angle', Parameter.parseNumber(newValue));
221
- }
222
- return [2 /*return*/];
223
- });
224
- }); },
225
- ]);
226
- this._parameterObservers.set(Parameter.EXPONENT, [
227
- function (light, oldValue, newValue) { return __awaiter(_this, void 0, void 0, function () {
228
- return __generator(this, function (_a) {
229
- if (light.light.getClassName() === 'SpotLight') {
230
- set(light.light, 'exponent', Parameter.parseNumber(newValue));
231
- }
232
- return [2 /*return*/];
233
- });
234
- }); },
235
- ]);
236
- this._parameterObservers.set(Parameter.DIFFUSE, [
237
- function (light, oldValue, newValue) { return __awaiter(_this, void 0, void 0, function () {
238
- return __generator(this, function (_a) {
239
- set(light.light, 'diffuse', Parameter.parseColor(newValue));
240
- return [2 /*return*/];
241
- });
242
- }); },
243
- ]);
244
- this._parameterObservers.set(Parameter.SPECULAR, [
245
- function (light, oldValue, newValue) { return __awaiter(_this, void 0, void 0, function () {
246
- return __generator(this, function (_a) {
247
- set(light.light, 'specular', Parameter.parseColor(newValue));
248
- return [2 /*return*/];
249
- });
250
- }); },
251
- ]);
252
- return this;
253
- };
254
- /**
255
- * @param definition
256
- * @protected
257
- */
258
- ViewerLight.prototype.createBabylonLightFromDefinition = function (definition) {
259
- return __awaiter(this, void 0, void 0, function () {
260
- var parameters, scene, lightId, babylonLight, _a, bakedLight, hemisphericLightModule, pointLightModule, directionalLightModule, spotLightModule, shadowGeneratorDefinition;
261
- return __generator(this, function (_b) {
262
- switch (_b.label) {
263
- case 0:
264
- parameters = Parameter.parseFromDeclarations(Parameter.declarations, this.inheritedParameters);
265
- scene = this.variant.viewer.scene;
266
- lightId = this.id;
267
- _a = definition.type;
268
- switch (_a) {
269
- case 'baked': return [3 /*break*/, 1];
270
- case 'hemispheric': return [3 /*break*/, 2];
271
- case 'point': return [3 /*break*/, 4];
272
- case 'directional': return [3 /*break*/, 6];
273
- case 'spot': return [3 /*break*/, 8];
274
- }
275
- return [3 /*break*/, 10];
276
- case 1:
277
- if (!definition['path']) {
278
- throw new Error("The light \"" + lightId + "\" of type \"" + definition.type + "\" needs a \"path\".");
279
- }
280
- bakedLight = this.variant.inheritedLights.find(function (l) { return l.metadata.dottedPath.path === definition['path']; });
281
- if (bakedLight) {
282
- lightId = bakedLight.metadata.dottedPath.clone().unshiftPart(this.id).path;
283
- babylonLight = cloneNodeWithParents(bakedLight);
284
- babylonLight.name = lightId;
285
- babylonLight.id = lightId;
286
- }
287
- else {
288
- throw new Error("No light found for path \"" + definition['path'] + "\" in ViewerLight \"" + lightId + "\".");
289
- }
290
- return [3 /*break*/, 11];
291
- case 2:
292
- if (!parameters['direction']) {
293
- throw new Error("The ViewerLight \"" + lightId + "\" of type \"" + definition.type + "\" needs a \"direction\".");
294
- }
295
- return [4 /*yield*/, import(
296
- /* webpackChunkName: "hemispheric-light" */ '@babylonjs/core/Lights/hemisphericLight')];
297
- case 3:
298
- hemisphericLightModule = _b.sent();
299
- babylonLight = new hemisphericLightModule.HemisphericLight(lightId, parameters['direction'], scene);
300
- return [3 /*break*/, 11];
301
- case 4: return [4 /*yield*/, import(
302
- /* webpackChunkName: "point-light" */ '@babylonjs/core/Lights/pointLight')];
303
- case 5:
304
- pointLightModule = _b.sent();
305
- babylonLight = new pointLightModule.PointLight(lightId, Vector3.Zero(), // position is set via parent TransformNode
306
- scene);
307
- return [3 /*break*/, 11];
308
- case 6:
309
- if (!parameters['direction']) {
310
- throw new Error("The ViewerLight \"" + lightId + "\" of type \"" + definition.type + "\" needs a \"direction\".");
311
- }
312
- return [4 /*yield*/, import(
313
- /* webpackChunkName: "directional-light" */ '@babylonjs/core/Lights/directionalLight')];
314
- case 7:
315
- directionalLightModule = _b.sent();
316
- babylonLight = new directionalLightModule.DirectionalLight(lightId, parameters['direction'], scene);
317
- return [3 /*break*/, 11];
318
- case 8:
319
- if (!parameters['direction']) {
320
- throw new Error("The ViewerLight \"" + lightId + "\" of type \"" + definition.type + "\" needs a \"direction\".");
321
- }
322
- if (!parameters['angle']) {
323
- throw new Error("A ViewerLight of type \"" + definition.type + "\" needs an \"angle\".");
324
- }
325
- if (!parameters['exponent']) {
326
- throw new Error("The ViewerLight \"" + lightId + "\" of type \"" + definition.type + "\" needs an \"exponent\".");
327
- }
328
- return [4 /*yield*/, import(/* webpackChunkName: "spot-light" */ '@babylonjs/core/Lights/spotLight')];
329
- case 9:
330
- spotLightModule = _b.sent();
331
- babylonLight = new spotLightModule.SpotLight(lightId, Vector3.Zero(), // position is set via parent TransformNode
332
- parameters['direction'], parameters['angle'], parameters['exponent'], scene);
333
- return [3 /*break*/, 11];
334
- case 10: throw new Error("The type \"" + definition.type + "\" for ViewerLight \"" + lightId + "\" is not implemented (yet).");
335
- case 11:
336
- if (!babylonLight) {
337
- throw new Error("The Light for ViewerLight \"" + lightId + "\" of type \"" + definition.type + "\" could no be created " + "or found.");
338
- }
339
- if (!babylonLight.parent) {
340
- // Create pseudo parent since lights do not implement mutations like "rotation" by itself.
341
- babylonLight.parent = new TransformNode('__light__', this.variant.viewer.scene, true);
342
- }
343
- injectNodeMetadata(babylonLight.parent, {
344
- variant: this.variant,
345
- variantParameterizable: this,
346
- });
347
- // disable/hide by default
348
- disableNodeWithParents(babylonLight);
349
- shadowGeneratorDefinition = get(definition, 'shadowGenerator');
350
- if (!!isEmpty(shadowGeneratorDefinition)) return [3 /*break*/, 13];
351
- if (!(babylonLight instanceof ShadowLight)) {
352
- throw new Error("Using a ShadowGenerator with light type \"" + definition.type + "\" is not supported for " +
353
- ("\"" + lightId + "\". Use lights deriving from ShadowLight."));
354
- }
355
- return [4 /*yield*/, this.processShadowGenerator(babylonLight, shadowGeneratorDefinition)];
356
- case 12:
357
- _b.sent();
358
- _b.label = 13;
359
- case 13: return [2 /*return*/, babylonLight];
360
- }
361
- });
362
- });
363
- };
364
- /**
365
- * @param babylonLight
366
- * @param definition
367
- * @protected
368
- */
369
- ViewerLight.prototype.processShadowGenerator = function (babylonLight, definition) {
370
- return __awaiter(this, void 0, void 0, function () {
371
- var parameterDeclarations, parameterBag, parameters, shadowGenerator, parameter;
372
- return __generator(this, function (_a) {
373
- parameterDeclarations = {};
374
- parameterBag = definition;
375
- parameters = Parameter.parseFromDeclarations(parameterDeclarations, parameterBag);
376
- shadowGenerator = new ShadowGenerator(parameters['mapSize'], babylonLight);
377
- for (parameter in parameters) {
378
- if (parameter === 'mapSize') {
379
- continue;
380
- }
381
- set(shadowGenerator, parameter, get(parameters, parameter));
382
- }
383
- return [2 /*return*/, shadowGenerator];
384
- });
385
- });
386
- };
387
- return ViewerLight;
388
- }(VariantParameterizable));
389
- export { ViewerLight };
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { cloneNodeWithParents, disableNodeWithParents, enableNodeWithParents, getRootNode, injectNodeMetadata, transformTransformNode, } from './../util/babylonHelper';
11
+ import { DottedPath } from './dottedPath';
12
+ import { Parameter } from './parameter';
13
+ import { VariantParameterizable } from './variantParameterizable';
14
+ import { ShadowGenerator } from '@babylonjs/core/Lights/Shadows/shadowGenerator';
15
+ import '@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent';
16
+ import { HemisphericLight } from '@babylonjs/core/Lights/hemisphericLight';
17
+ import { PointLight } from '@babylonjs/core/Lights/pointLight';
18
+ import { ShadowLight } from '@babylonjs/core/Lights/shadowLight';
19
+ import { Vector3 } from '@babylonjs/core/Maths/math.vector';
20
+ import { TransformNode } from '@babylonjs/core/Meshes/transformNode';
21
+ import '@babylonjs/loaders/glTF/2.0/Extensions/KHR_lights_punctual';
22
+ import { get, isEmpty, isString, set } from 'lodash-es';
23
+ /**
24
+ * A {@link ViewerLight} of a {@link Variant}. Acts as a container for BabylonJS lights. Lives only in the context of a
25
+ * {@link Variant}.
26
+ */
27
+ export class ViewerLight extends VariantParameterizable {
28
+ /**
29
+ * Constructor.
30
+ */
31
+ constructor(variant, name) {
32
+ super(variant, name);
33
+ this.variant = variant;
34
+ this.name = name;
35
+ this.addParameterObservers();
36
+ }
37
+ /**
38
+ * Creates a {@link ViewerLight} with given name.
39
+ */
40
+ static create(variant, name) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ const viewerLight = new ViewerLight(variant, name);
43
+ viewerLight._light = yield viewerLight.createBabylonLightFromDefinition(viewerLight.definition);
44
+ return viewerLight;
45
+ });
46
+ }
47
+ /**
48
+ * The wrapped Light.
49
+ */
50
+ get light() {
51
+ if (!this._light) {
52
+ throw new Error(`Light for ViewerLight "${this.name}" has not been properly initialized.`);
53
+ }
54
+ return this._light;
55
+ }
56
+ /**
57
+ * The {@link DottedPath} in the built tree of {@link ViewerLight}s.
58
+ * E.g. "_.top-1.sub-2.sub-sub-3.el-1"
59
+ */
60
+ get dottedPath() {
61
+ return DottedPath.create(this.variant.dottedPath).addPart(this.name);
62
+ }
63
+ /**
64
+ * The id representing a {@link DottedPath}.
65
+ */
66
+ get id() {
67
+ const dottedPath = DottedPath.create(this.dottedPath);
68
+ dottedPath.shiftPart(); // remove root
69
+ return dottedPath.path;
70
+ }
71
+ /**
72
+ * The {@link LightDefinition} of the {@link ViewerLight}.
73
+ */
74
+ get definition() {
75
+ const definition = this.variant.structureJson.lights[this.name];
76
+ if (isString(definition)) {
77
+ return {
78
+ type: 'baked',
79
+ path: definition,
80
+ };
81
+ }
82
+ return definition;
83
+ }
84
+ /**
85
+ * The type of the {@link ViewerLight}'s light.
86
+ */
87
+ get type() {
88
+ return this.light.constructor.name.replace(/light/i, '').toLowerCase();
89
+ }
90
+ /**
91
+ * @see {@link VariantParameterizable.commitParameters}
92
+ * @emit {@link Event.VIEWER_LIGHT_PARAMETER_COMMITTED}
93
+ */
94
+ commitParameters(parameters) {
95
+ const _super = Object.create(null, {
96
+ commitParameters: { get: () => super.commitParameters }
97
+ });
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ return _super.commitParameters.call(this, parameters);
100
+ });
101
+ }
102
+ /**
103
+ * Adds the default {@link ParameterObserver}s which are called every time {@link commitParameters} is called.
104
+ */
105
+ addParameterObservers() {
106
+ this._parameterObservers.set(Parameter.VISIBLE, [
107
+ (light, oldValue, newValue) => __awaiter(this, void 0, void 0, function* () {
108
+ let visible;
109
+ try {
110
+ visible = Parameter.parseBoolean(newValue);
111
+ }
112
+ catch (e) {
113
+ return;
114
+ }
115
+ if (visible === true) {
116
+ enableNodeWithParents(light.light);
117
+ }
118
+ else if (visible === false) {
119
+ disableNodeWithParents(light.light);
120
+ }
121
+ }),
122
+ ]);
123
+ this._parameterObservers.set(Parameter.INTENSITY, [
124
+ (light, oldValue, newValue) => __awaiter(this, void 0, void 0, function* () {
125
+ set(light.light, 'intensity', Parameter.parseNumber(newValue));
126
+ }),
127
+ ]);
128
+ this._parameterObservers.set(Parameter.SCALING, [
129
+ (light, oldValue, newValue) => __awaiter(this, void 0, void 0, function* () {
130
+ // we have to deal just with root nodes here due to relative impacts in a node tree
131
+ const rootNode = getRootNode(light.light);
132
+ if (rootNode instanceof TransformNode) {
133
+ transformTransformNode(rootNode, {
134
+ scaling: Parameter.parseScaling(newValue),
135
+ position: Parameter.parseVector(light.inheritedParameters[Parameter.POSITION] || '(0, 0, 0)'),
136
+ rotation: Parameter.parseRotation(light.inheritedParameters[Parameter.ROTATION] || '(0, 0, 0)'),
137
+ });
138
+ }
139
+ }),
140
+ ]);
141
+ this._parameterObservers.set(Parameter.POSITION, [
142
+ (light, oldValue, newValue) => __awaiter(this, void 0, void 0, function* () {
143
+ // we have to deal just with root nodes here due to relative impacts in a node tree
144
+ const rootNode = getRootNode(light.light);
145
+ if (rootNode instanceof TransformNode) {
146
+ transformTransformNode(rootNode, {
147
+ scaling: Parameter.parseVector(light.inheritedParameters[Parameter.SCALING] || '(1, 1, 1)'),
148
+ position: Parameter.parseVector(newValue),
149
+ rotation: Parameter.parseRotation(light.inheritedParameters[Parameter.ROTATION] || '(0, 0, 0)'),
150
+ });
151
+ }
152
+ }),
153
+ ]);
154
+ this._parameterObservers.set(Parameter.ROTATION, [
155
+ (light, oldValue, newValue) => __awaiter(this, void 0, void 0, function* () {
156
+ // we have to deal just with root nodes here due to relative impacts in a node tree
157
+ const rootNode = getRootNode(light.light);
158
+ if (rootNode instanceof TransformNode) {
159
+ transformTransformNode(rootNode, {
160
+ scaling: Parameter.parseVector(light.inheritedParameters[Parameter.SCALING] || '(1, 1, 1)'),
161
+ position: Parameter.parseVector(light.inheritedParameters[Parameter.POSITION] || '(0, 0, 0)'),
162
+ rotation: Parameter.parseRotation(newValue),
163
+ });
164
+ }
165
+ }),
166
+ ]);
167
+ this._parameterObservers.set(Parameter.DIRECTION, [
168
+ (light, oldValue, newValue) => __awaiter(this, void 0, void 0, function* () {
169
+ if ((light.light instanceof ShadowLight && !(light.light instanceof PointLight)) ||
170
+ light.light instanceof HemisphericLight) {
171
+ set(light.light, 'direction', Parameter.parseVector(newValue));
172
+ }
173
+ }),
174
+ ]);
175
+ this._parameterObservers.set(Parameter.ANGLE, [
176
+ (light, oldValue, newValue) => __awaiter(this, void 0, void 0, function* () {
177
+ if (light.light.getClassName() === 'SpotLight') {
178
+ set(light.light, 'angle', Parameter.parseNumber(newValue));
179
+ }
180
+ }),
181
+ ]);
182
+ this._parameterObservers.set(Parameter.EXPONENT, [
183
+ (light, oldValue, newValue) => __awaiter(this, void 0, void 0, function* () {
184
+ if (light.light.getClassName() === 'SpotLight') {
185
+ set(light.light, 'exponent', Parameter.parseNumber(newValue));
186
+ }
187
+ }),
188
+ ]);
189
+ this._parameterObservers.set(Parameter.DIFFUSE, [
190
+ (light, oldValue, newValue) => __awaiter(this, void 0, void 0, function* () {
191
+ set(light.light, 'diffuse', Parameter.parseColor(newValue));
192
+ }),
193
+ ]);
194
+ this._parameterObservers.set(Parameter.SPECULAR, [
195
+ (light, oldValue, newValue) => __awaiter(this, void 0, void 0, function* () {
196
+ set(light.light, 'specular', Parameter.parseColor(newValue));
197
+ }),
198
+ ]);
199
+ return this;
200
+ }
201
+ /**
202
+ * @param definition
203
+ * @protected
204
+ */
205
+ createBabylonLightFromDefinition(definition) {
206
+ return __awaiter(this, void 0, void 0, function* () {
207
+ const parameters = Parameter.parseFromDeclarations(Parameter.declarations, this.inheritedParameters);
208
+ const scene = this.variant.viewer.scene;
209
+ let lightId = this.id;
210
+ let babylonLight;
211
+ switch (definition.type) {
212
+ case 'baked':
213
+ if (!definition['path']) {
214
+ throw new Error(`The light "${lightId}" of type "${definition.type}" needs a "path".`);
215
+ }
216
+ const bakedLight = this.variant.inheritedLights.find(l => l.metadata.dottedPath.path === definition['path']);
217
+ if (bakedLight) {
218
+ lightId = bakedLight.metadata.dottedPath.clone().unshiftPart(this.id).path;
219
+ babylonLight = cloneNodeWithParents(bakedLight);
220
+ babylonLight.name = lightId;
221
+ babylonLight.id = lightId;
222
+ }
223
+ else {
224
+ throw new Error(`No light found for path "${definition['path']}" in ViewerLight "${lightId}".`);
225
+ }
226
+ break;
227
+ case 'hemispheric':
228
+ if (!parameters['direction']) {
229
+ throw new Error(`The ViewerLight "${lightId}" of type "${definition.type}" needs a "direction".`);
230
+ }
231
+ // @ts-ignore
232
+ const hemisphericLightModule = yield import(
233
+ /* webpackChunkName: "hemispheric-light" */ '@babylonjs/core/Lights/hemisphericLight');
234
+ babylonLight = new hemisphericLightModule.HemisphericLight(lightId, parameters['direction'], scene);
235
+ break;
236
+ case 'point':
237
+ // @ts-ignore
238
+ const pointLightModule = yield import(
239
+ /* webpackChunkName: "point-light" */ '@babylonjs/core/Lights/pointLight');
240
+ babylonLight = new pointLightModule.PointLight(lightId, Vector3.Zero(), // position is set via parent TransformNode
241
+ scene);
242
+ break;
243
+ case 'directional':
244
+ if (!parameters['direction']) {
245
+ throw new Error(`The ViewerLight "${lightId}" of type "${definition.type}" needs a "direction".`);
246
+ }
247
+ // @ts-ignore
248
+ const directionalLightModule = yield import(
249
+ /* webpackChunkName: "directional-light" */ '@babylonjs/core/Lights/directionalLight');
250
+ babylonLight = new directionalLightModule.DirectionalLight(lightId, parameters['direction'], scene);
251
+ break;
252
+ case 'spot':
253
+ if (!parameters['direction']) {
254
+ throw new Error(`The ViewerLight "${lightId}" of type "${definition.type}" needs a "direction".`);
255
+ }
256
+ if (!parameters['angle']) {
257
+ throw new Error(`A ViewerLight of type "${definition.type}" needs an "angle".`);
258
+ }
259
+ if (!parameters['exponent']) {
260
+ throw new Error(`The ViewerLight "${lightId}" of type "${definition.type}" needs an "exponent".`);
261
+ }
262
+ // @ts-ignore
263
+ const spotLightModule = yield import(/* webpackChunkName: "spot-light" */ '@babylonjs/core/Lights/spotLight');
264
+ babylonLight = new spotLightModule.SpotLight(lightId, Vector3.Zero(), // position is set via parent TransformNode
265
+ parameters['direction'], parameters['angle'], parameters['exponent'], scene);
266
+ break;
267
+ default:
268
+ throw new Error(`The type "${definition.type}" for ViewerLight "${lightId}" is not implemented (yet).`);
269
+ }
270
+ if (!babylonLight) {
271
+ throw new Error(`The Light for ViewerLight "${lightId}" of type "${definition.type}" could no be created ` + `or found.`);
272
+ }
273
+ if (!babylonLight.parent) {
274
+ // Create pseudo parent since lights do not implement mutations like "rotation" by itself.
275
+ babylonLight.parent = new TransformNode('__light__', this.variant.viewer.scene, true);
276
+ }
277
+ injectNodeMetadata(babylonLight.parent, {
278
+ variant: this.variant,
279
+ variantParameterizable: this,
280
+ });
281
+ // disable/hide by default
282
+ disableNodeWithParents(babylonLight);
283
+ // process shadow generator
284
+ const shadowGeneratorDefinition = get(definition, 'shadowGenerator');
285
+ if (!isEmpty(shadowGeneratorDefinition)) {
286
+ if (!(babylonLight instanceof ShadowLight)) {
287
+ throw new Error(`Using a ShadowGenerator with light type "${definition.type}" is not supported for ` +
288
+ `"${lightId}". Use lights deriving from ShadowLight.`);
289
+ }
290
+ yield this.processShadowGenerator(babylonLight, shadowGeneratorDefinition);
291
+ }
292
+ return babylonLight;
293
+ });
294
+ }
295
+ /**
296
+ * @param babylonLight
297
+ * @param definition
298
+ * @protected
299
+ */
300
+ processShadowGenerator(babylonLight, definition) {
301
+ return __awaiter(this, void 0, void 0, function* () {
302
+ const parameterDeclarations = {};
303
+ // define declarations here if needed in future
304
+ const parameterBag = definition;
305
+ const parameters = Parameter.parseFromDeclarations(parameterDeclarations, parameterBag);
306
+ const shadowGenerator = new ShadowGenerator(parameters['mapSize'], babylonLight);
307
+ for (const parameter in parameters) {
308
+ if (parameter === 'mapSize') {
309
+ continue;
310
+ }
311
+ set(shadowGenerator, parameter, get(parameters, parameter));
312
+ }
313
+ return shadowGenerator;
314
+ });
315
+ }
316
+ }
390
317
  //# sourceMappingURL=viewerLight.js.map