@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,469 +1,458 @@
1
- import { Color3 } from '@babylonjs/core/Maths/math.color';
2
- import { Vector3 } from '@babylonjs/core/Maths/math.vector';
3
- import { get, isEmpty, isNumber, isString } from 'lodash-es';
4
- /**
5
- * This `Parameter` class defines all parameters that can be consumed and committed by a {@link ParameterObservable}.
6
- * Use {@link ParameterObservable.addParameterObserver} or {@link ParameterObservable.commitParameters} to either add or
7
- * commit parameters on your observable objects.
8
- */
9
- var Parameter = /** @class */ (function () {
10
- /**
11
- * Constructor.
12
- */
13
- function Parameter() {
14
- }
15
- Object.defineProperty(Parameter, "declarations", {
16
- /**
17
- * The {@link ParameterDeclarations} for all parameters in this class.
18
- */
19
- get: function () {
20
- var declarations = {};
21
- declarations[Parameter.VISIBLE] = { type: 'boolean', parser: Parameter.parseBoolean };
22
- declarations[Parameter.SCALING] = { type: 'number', parser: Parameter.parseNumber };
23
- declarations[Parameter.POSITION] = { type: 'vector', parser: Parameter.parseVector };
24
- declarations[Parameter.ROTATION] = { type: 'vector', parser: Parameter.parseVector };
25
- declarations[Parameter.HIGHLIGHTED] = { type: 'boolean', parser: Parameter.parseBoolean };
26
- declarations[Parameter.MATERIAL] = { type: 'string' };
27
- declarations[Parameter.MATERIAL_COLOR] = { type: 'color', parser: Parameter.parseColor };
28
- declarations[Parameter.MATERIAL_METALLNESS] = { type: 'number', parser: Parameter.parseNumber };
29
- declarations[Parameter.MATERIAL_ROUGHNESS] = { type: 'number', parser: Parameter.parseNumber };
30
- declarations[Parameter.HIGHLIGHT_ENABLED] = { type: 'boolean', parser: Parameter.parseBoolean };
31
- declarations[Parameter.HIGHLIGHT_COLOR] = { type: 'color', parser: Parameter.parseColor };
32
- declarations[Parameter.HIGHLIGHTED] = { type: 'boolean', parser: Parameter.parseBoolean };
33
- declarations[Parameter.CAST_SHADOW] = { type: 'boolean', parser: Parameter.parseBoolean };
34
- declarations[Parameter.CAST_SHADOW_FROM_LIGHTS] = { type: 'csl', parser: Parameter.parseCommaSeparatedList };
35
- declarations[Parameter.RECEIVE_SHADOWS] = { type: 'boolean', parser: Parameter.parseBoolean };
36
- declarations[Parameter.INTENSITY] = { type: 'number', parser: Parameter.parseNumber };
37
- declarations[Parameter.DIRECTION] = { type: 'vector', parser: Parameter.parseVector };
38
- declarations[Parameter.ANGLE] = { type: 'number', parser: Parameter.parseNumber };
39
- declarations[Parameter.EXPONENT] = { type: 'number', parser: Parameter.parseNumber };
40
- declarations[Parameter.DIFFUSE] = { type: 'color', parser: Parameter.parseColor };
41
- declarations[Parameter.SPECULAR] = { type: 'color', parser: Parameter.parseColor };
42
- declarations[Parameter.ENVIRONMENT] = { type: 'string' };
43
- declarations[Parameter.ENVIRONMENT_COLOR] = { type: 'color', parser: Parameter.parseColor };
44
- declarations[Parameter.ENVIRONMENT_ROTATION] = { type: 'number', parser: Parameter.parseNumber };
45
- declarations[Parameter.ENVIRONMENT_INTENSITY] = { type: 'number', parser: Parameter.parseNumber };
46
- declarations[Parameter.ENVIRONMENT_BACKGROUND] = { type: 'string' };
47
- declarations[Parameter.ENVIRONMENT_USEDEFAULT] = { type: 'boolean', parser: Parameter.parseBoolean };
48
- return declarations;
49
- },
50
- enumerable: false,
51
- configurable: true
52
- });
53
- /**
54
- * Gets the {@link ParameterDeclaration} for a given {@link Parameter} declared in this class.
55
- */
56
- Parameter.getDeclaration = function (parameter) {
57
- return Parameter.declarations[parameter];
58
- };
59
- Object.defineProperty(Parameter, "all", {
60
- /**
61
- * All parameters defined in this class.
62
- */
63
- get: function () {
64
- var all = [];
65
- for (var parameter in Parameter) {
66
- var property = Object.getOwnPropertyDescriptor(Parameter, parameter);
67
- if (parameter.toUpperCase() === parameter && property && isString(property.value)) {
68
- all.push(property.value);
69
- }
70
- }
71
- return all;
72
- },
73
- enumerable: false,
74
- configurable: true
75
- });
76
- /**
77
- * Parses given {@link ParameterBag} with given {@link ParameterDeclarations}.
78
- */
79
- Parameter.parseFromDeclarations = function (declarations, parameterBag) {
80
- var parameters = {};
81
- for (var parameter in parameterBag) {
82
- var value = get(parameterBag, parameter);
83
- parameters[parameter] = value;
84
- var declaration = declarations[parameter];
85
- if (declaration) {
86
- if (!isEmpty(value) && declaration.parser) {
87
- parameters[parameter] = declaration.parser(value);
88
- }
89
- }
90
- }
91
- return parameters;
92
- };
93
- /**
94
- * Parses a string of format `'(x,y,z)'` to a `Vector3`.
95
- */
96
- Parameter.parseVector = function (value) {
97
- if (!isString(value)) {
98
- throw new Error("Unable to convert \"" + value + "\" into a Vector: not a string.");
99
- }
100
- var cleanedValue = value.split(' ').join('');
101
- if (cleanedValue.startsWith('(') && cleanedValue.endsWith(')')) {
102
- cleanedValue = cleanedValue.substring(1, cleanedValue.length - 1);
103
- var _a = cleanedValue.split(',').map(function (value) { return parseFloat(value); }), x = _a[0], y = _a[1], z = _a[2];
104
- return new Vector3(x, y, z);
105
- }
106
- else {
107
- throw new Error("Unable to parse \"" + value + "\" to a Vector: expected \"(x,y,z)\".");
108
- }
109
- };
110
- /**
111
- * Stringifies a Vector3 to format `(x,y,z)`.
112
- */
113
- Parameter.stringifyVector = function (value) {
114
- return "(" + value.x + "," + value.y + "," + value.z + ")";
115
- };
116
- /**
117
- * Parses a string of format `'(x,y,z)'` with angular degrees to a `Vector3` with rotation information in radians.
118
- */
119
- Parameter.parseRotation = function (value) {
120
- var rotation = Parameter.parseVector(value);
121
- var deg2rad = function (deg) {
122
- return (deg * Math.PI) / 180;
123
- };
124
- return rotation.set(deg2rad(rotation.x), deg2rad(rotation.y), deg2rad(rotation.z));
125
- };
126
- /**
127
- * Parses a string of format `'(x,y,z)'` or a simple `number` to a `Vector3` for scaling.
128
- */
129
- Parameter.parseScaling = function (value) {
130
- var scaling = new Vector3();
131
- if (isString(value)) {
132
- var cleanedFactor = value.split(' ').join('');
133
- if (cleanedFactor.startsWith('(') && cleanedFactor.endsWith(')')) {
134
- scaling = Parameter.parseVector(cleanedFactor);
135
- }
136
- else {
137
- var _factor = parseFloat(value);
138
- scaling = new Vector3(_factor, _factor, _factor);
139
- }
140
- }
141
- else if (isNumber(value)) {
142
- scaling = new Vector3(value, value, value);
143
- }
144
- else {
145
- throw new Error("Unable to convert \"" + value + "\" to a Vector: expected \"(x,y,z)\".");
146
- }
147
- return scaling;
148
- };
149
- /**
150
- * Parses a string of format `'#rrggbb'` or `'(r,g,b)'` to a `Color3`.
151
- */
152
- Parameter.parseColor = function (value) {
153
- var cleanedValue = value.toString().split(' ').join('');
154
- if (cleanedValue.startsWith('#')) {
155
- return Color3.FromHexString(value.toString());
156
- }
157
- if (cleanedValue.startsWith('(') && cleanedValue.endsWith(')')) {
158
- cleanedValue = cleanedValue.substring(1, cleanedValue.length - 1);
159
- var _a = cleanedValue.split(',').map(function (value) { return parseFloat(value); }), r = _a[0], g = _a[1], b = _a[2];
160
- return Color3.FromInts(r, g, b);
161
- }
162
- throw new Error("Unable to parse \"" + value + "\" to a Color: expected \"#rrggbb\" or \"(r,g,b)\".");
163
- };
164
- /**
165
- * Parses a `boolean` string (`'true'`/`'1'` or `'false'`/`'0'`) or `number` (`1` or `0`) to a `boolean` or `undefined`.
166
- */
167
- Parameter.parseBoolean = function (value) {
168
- if (value.toString() === 'true' || value.toString() === '1') {
169
- return true;
170
- }
171
- else if (value.toString() === 'false' || value.toString() === '0') {
172
- return false;
173
- }
174
- throw new Error("Unable to parse \"" + value + "\" to a boolean.");
175
- };
176
- /**
177
- * Parses a number `string` to a `number`.
178
- */
179
- Parameter.parseNumber = function (value) {
180
- return parseFloat(value.toString());
181
- };
182
- /**
183
- * Parses a string with comma separated values to a list of strings.
184
- */
185
- Parameter.parseCommaSeparatedList = function (value) {
186
- return value
187
- .toString()
188
- .split(',')
189
- .map(function (s) { return s.trim(); });
190
- };
191
- /**
192
- * Mutates the visibility. Helper methods are {@link VariantParameterizable.show} and
193
- * {@link VariantParameterizable.hide}. Getter and setter is {@link VariantParameterizable.visible}.
194
- *
195
- * Scopes:
196
- * * {@link Element}
197
- * * {@link Variant}
198
- * * {@link ViewerLight} Available for all light types
199
- *
200
- * @parser {@link parseBoolean}
201
- */
202
- Parameter.VISIBLE = 'visible';
203
- /**
204
- * Stretches or compresses some meshes. Getter and setter is {@link VariantParameterizable.scaling}.
205
- *
206
- * Scopes:
207
- * * {@link Element}
208
- * * {@link Variant}
209
- *
210
- * @parser {@link parseScaling}
211
- */
212
- Parameter.SCALING = 'scaling';
213
- /**
214
- * Mutates the material. Getter and setter is {@link VariantParameterizable.material}. The value of this parameter
215
- * represents the ID of a baked-in glTF or custom created material in the {@link Variant} tree.
216
- *
217
- * Scopes:
218
- * * {@link Element}
219
- * * {@link Variant}
220
- *
221
- * @parser string
222
- */
223
- Parameter.MATERIAL = 'material';
224
- /**
225
- * Mutates the material color.
226
- *
227
- * Scopes:
228
- * * {@link Element}
229
- * * {@link Variant}
230
- *
231
- * @parser {@link parseColor}
232
- */
233
- Parameter.MATERIAL_COLOR = 'material.color';
234
- /**
235
- * Mutates the material metallness.
236
- *
237
- * Scopes:
238
- * * {@link Element}
239
- * * {@link Variant}
240
- *
241
- * @parser {@link parseNumber}
242
- */
243
- Parameter.MATERIAL_METALLNESS = 'material.metallness';
244
- /**
245
- * Mutates the material roughness.
246
- *
247
- * Scopes:
248
- * * {@link Element}
249
- * * {@link Variant}
250
- *
251
- * @parser {@link parseNumber}
252
- */
253
- Parameter.MATERIAL_ROUGHNESS = 'material.roughness';
254
- /**
255
- * Mutates whether a highlight layer should be enabled.
256
- *
257
- * Scopes:
258
- * * {@link Element}
259
- * * {@link Variant}
260
- *
261
- * @parser {@link parseBoolean}
262
- */
263
- Parameter.HIGHLIGHT_ENABLED = 'highlight.enabled';
264
- /**
265
- * Changes the highlight color.
266
- *
267
- * Scopes:
268
- * * {@link Element}
269
- * * {@link Variant}
270
- *
271
- * @parser {@link parseColor}
272
- */
273
- Parameter.HIGHLIGHT_COLOR = 'highlight.color';
274
- /**
275
- * Mutates the highlighted state. Getter and setter is {@link VariantParameterizable.highlighted}.
276
- *
277
- * Scopes:
278
- * * {@link Element}
279
- * * {@link Variant}
280
- *
281
- * @parser {@link parseBoolean}
282
- */
283
- Parameter.HIGHLIGHTED = 'highlighted';
284
- /**
285
- * Mutates the position relative to its origin position. Getter and setter is {@link VariantParameterizable.position}.
286
- *
287
- * Scopes:
288
- * * {@link Element}
289
- * * {@link Variant}
290
- * * {@link ViewerLight} Available for [PointLight](https://doc.babylonjs.com/typedoc/classes/babylon.pointlight#position), [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#position), [DirectionalLight](https://doc.babylonjs.com/typedoc/classes/babylon.directionallight#position)
291
- *
292
- * @parser {@link parseVector}
293
- */
294
- Parameter.POSITION = 'position';
295
- /**
296
- * Mutates the rotation relative to its origin rotation. Getter and setter is {@link VariantParameterizable.rotation}.
297
- *
298
- * Scopes:
299
- * * {@link Element}
300
- * * {@link Variant}
301
- *
302
- * @parser {@link parseRotation}
303
- */
304
- Parameter.ROTATION = 'rotation';
305
- /**
306
- * Mutates whether a shadow should be casted or not.
307
- *
308
- * Scopes:
309
- * * {@link Element}
310
- * * {@link Variant}
311
- *
312
- * @parser {@link parseBoolean}
313
- */
314
- Parameter.CAST_SHADOW = 'castShadow';
315
- /**
316
- * Mutates from which lights a shadow should be casted.
317
- *
318
- * Scopes:
319
- * * {@link Element}
320
- * * {@link Variant}
321
- *
322
- * @parser {@link parseCommaSeparatedList}
323
- */
324
- Parameter.CAST_SHADOW_FROM_LIGHTS = 'castShadow.fromLights';
325
- /**
326
- * Mutates whether to receive shadows or not.
327
- *
328
- * Scopes:
329
- * * {@link Element}
330
- * * {@link Variant}
331
- *
332
- * @parser {@link parseBoolean}
333
- */
334
- Parameter.RECEIVE_SHADOWS = 'receiveShadows';
335
- /**
336
- * Mutates the intensity of Lights.
337
- *
338
- * Scopes:
339
- * * {@link ViewerLight} Available for [PointLight](https://doc.babylonjs.com/typedoc/classes/babylon.pointlight#intensity), [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#intensity), [DirectionalLight](https://doc.babylonjs.com/typedoc/classes/babylon.directionallight#intensity), [HemisphericLight](https://doc.babylonjs.com/typedoc/classes/babylon.hemisphericlight#intensity)
340
- *
341
- * @parser {@link parseNumber}
342
- */
343
- Parameter.INTENSITY = 'intensity';
344
- /**
345
- * Mutates the direction of Lights.
346
- *
347
- * Scopes:
348
- * * {@link ViewerLight} Available for [PointLight](https://doc.babylonjs.com/typedoc/classes/babylon.pointlight#direction), [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#direction), [DirectionalLight](https://doc.babylonjs.com/typedoc/classes/babylon.directionallight#direction), [HemisphericLight](https://doc.babylonjs.com/typedoc/classes/babylon.hemisphericlight#direction)
349
- *
350
- * @parser {@link parseNumber}
351
- */
352
- Parameter.DIRECTION = 'direction';
353
- /**
354
- * Mutates the angle of Lights.
355
- *
356
- * Scopes:
357
- * * {@link ViewerLight} Available for [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#angle)
358
- *
359
- * @parser {@link parseNumber}
360
- */
361
- Parameter.ANGLE = 'angle';
362
- /**
363
- * Mutates the exponent of Lights.
364
- *
365
- * Scopes:
366
- * * {@link ViewerLight} Available for [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#exponent)
367
- *
368
- * @parser {@link parseNumber}
369
- */
370
- Parameter.EXPONENT = 'exponent';
371
- /**
372
- * Mutates the diffuse color of Lights.
373
- *
374
- * Scopes:
375
- * * {@link ViewerLight} Available for [PointLight](https://doc.babylonjs.com/typedoc/classes/babylon.pointlight#diffuse), [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#diffuse), [DirectionalLight](https://doc.babylonjs.com/typedoc/classes/babylon.directionallight#diffuse), [HemisphericLight](https://doc.babylonjs.com/typedoc/classes/babylon.hemisphericlight#diffuse)
376
- *
377
- * @parser {@link parseNumber}
378
- */
379
- Parameter.DIFFUSE = 'diffuse';
380
- /**
381
- * Mutates the specular color of Lights.
382
- *
383
- * Scopes:
384
- * * {@link ViewerLight} Available for [PointLight](https://doc.babylonjs.com/typedoc/classes/babylon.pointlight#specular), [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#specular), [DirectionalLight](https://doc.babylonjs.com/typedoc/classes/babylon.directionallight#specular), [HemisphericLight](https://doc.babylonjs.com/typedoc/classes/babylon.hemisphericlight#specular)
385
- *
386
- * @parser {@link parseNumber}
387
- */
388
- Parameter.SPECULAR = 'specular';
389
- /**
390
- * Sets the environment. See [BABYLON.Scene.environmentTexture](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#environmentTexture).
391
- *
392
- * Usually the URL to an `*.env` file.
393
- *
394
- * See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
395
- *
396
- * Scopes:
397
- * * {@link SceneManager}
398
- *
399
- * @parser string
400
- */
401
- Parameter.ENVIRONMENT = 'environment';
402
- /**
403
- * Sets [BABYLON.Scene.clearColor](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#clearColor)
404
- *
405
- * See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
406
- *
407
- * Scopes:
408
- * * {@link SceneManager}
409
- *
410
- * @parser {@link parseColor}
411
- */
412
- Parameter.ENVIRONMENT_COLOR = 'environment.color';
413
- /**
414
- * Rotates connected textures, i.e. IBL, reflection, background, ...
415
- * Rotation angle in degree.
416
- *
417
- * See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
418
- *
419
- * Scopes:
420
- * * {@link SceneManager}
421
- *
422
- * @parser {@link parseNumber}
423
- */
424
- Parameter.ENVIRONMENT_ROTATION = 'environment.rotation';
425
- /**
426
- * Intensity of IBL. Defaults to 1, usually between 0 & 2.
427
- *
428
- * See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
429
- *
430
- * Scopes:
431
- * * {@link SceneManager}
432
- *
433
- * @parser {@link parseNumber}
434
- */
435
- Parameter.ENVIRONMENT_INTENSITY = 'environment.intensity';
436
- /**
437
- * Background texture on a [PhotoDome](https://doc.babylonjs.com/divingDeeper/environment/360PhotoDome). Just background, no IBL or reflection.
438
- *
439
- * Recommended format is `*.jpg`. HDR files are not supported as background but can be converted to `*.jpg` using tools like Photoshop, Gimp or various free online converters.
440
- *
441
- * See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
442
- *
443
- * Scopes:
444
- * * {@link SceneManager}
445
- *
446
- * @parser string
447
- */
448
- Parameter.ENVIRONMENT_BACKGROUND = 'environment.background';
449
- /**
450
- * If `true`, sets a `scene.environmentTexture` and creates a *BackgroundHelper* Node (via
451
- * [scene.createDefaultEnvironment](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#createDefaultEnvironment))
452
- * with two subnodes/meshes:
453
- * - BackgroundPlane
454
- * - BackgroundSkybox
455
- *
456
- * The value of this parameter is ignored if {@link ENVIRONMENT_BACKGROUND} is also set.
457
- *
458
- * See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
459
- *
460
- * Scopes:
461
- * * {@link SceneManager}
462
- *
463
- * @parser {@link parseBoolean}
464
- */
465
- Parameter.ENVIRONMENT_USEDEFAULT = 'environment.usedefault';
466
- return Parameter;
467
- }());
468
- export { Parameter };
1
+ import { Color3 } from '@babylonjs/core/Maths/math.color';
2
+ import { Vector3 } from '@babylonjs/core/Maths/math.vector';
3
+ import { get, isEmpty, isNumber, isString } from 'lodash-es';
4
+ /**
5
+ * This `Parameter` class defines all parameters that can be consumed and committed by a {@link ParameterObservable}.
6
+ * Use {@link ParameterObservable.addParameterObserver} or {@link ParameterObservable.commitParameters} to either add or
7
+ * commit parameters on your observable objects.
8
+ */
9
+ export class Parameter {
10
+ /**
11
+ * Constructor.
12
+ */
13
+ constructor() { }
14
+ /**
15
+ * The {@link ParameterDeclarations} for all parameters in this class.
16
+ */
17
+ static get declarations() {
18
+ const declarations = {};
19
+ declarations[Parameter.VISIBLE] = { type: 'boolean', parser: Parameter.parseBoolean };
20
+ declarations[Parameter.SCALING] = { type: 'number', parser: Parameter.parseNumber };
21
+ declarations[Parameter.POSITION] = { type: 'vector', parser: Parameter.parseVector };
22
+ declarations[Parameter.ROTATION] = { type: 'vector', parser: Parameter.parseVector };
23
+ declarations[Parameter.HIGHLIGHTED] = { type: 'boolean', parser: Parameter.parseBoolean };
24
+ declarations[Parameter.MATERIAL] = { type: 'string' };
25
+ declarations[Parameter.MATERIAL_COLOR] = { type: 'color', parser: Parameter.parseColor };
26
+ declarations[Parameter.MATERIAL_METALLNESS] = { type: 'number', parser: Parameter.parseNumber };
27
+ declarations[Parameter.MATERIAL_ROUGHNESS] = { type: 'number', parser: Parameter.parseNumber };
28
+ declarations[Parameter.HIGHLIGHT_ENABLED] = { type: 'boolean', parser: Parameter.parseBoolean };
29
+ declarations[Parameter.HIGHLIGHT_COLOR] = { type: 'color', parser: Parameter.parseColor };
30
+ declarations[Parameter.HIGHLIGHTED] = { type: 'boolean', parser: Parameter.parseBoolean };
31
+ declarations[Parameter.CAST_SHADOW] = { type: 'boolean', parser: Parameter.parseBoolean };
32
+ declarations[Parameter.CAST_SHADOW_FROM_LIGHTS] = { type: 'csl', parser: Parameter.parseCommaSeparatedList };
33
+ declarations[Parameter.RECEIVE_SHADOWS] = { type: 'boolean', parser: Parameter.parseBoolean };
34
+ declarations[Parameter.INTENSITY] = { type: 'number', parser: Parameter.parseNumber };
35
+ declarations[Parameter.DIRECTION] = { type: 'vector', parser: Parameter.parseVector };
36
+ declarations[Parameter.ANGLE] = { type: 'number', parser: Parameter.parseNumber };
37
+ declarations[Parameter.EXPONENT] = { type: 'number', parser: Parameter.parseNumber };
38
+ declarations[Parameter.DIFFUSE] = { type: 'color', parser: Parameter.parseColor };
39
+ declarations[Parameter.SPECULAR] = { type: 'color', parser: Parameter.parseColor };
40
+ declarations[Parameter.ENVIRONMENT] = { type: 'string' };
41
+ declarations[Parameter.ENVIRONMENT_COLOR] = { type: 'color', parser: Parameter.parseColor };
42
+ declarations[Parameter.ENVIRONMENT_ROTATION] = { type: 'number', parser: Parameter.parseNumber };
43
+ declarations[Parameter.ENVIRONMENT_INTENSITY] = { type: 'number', parser: Parameter.parseNumber };
44
+ declarations[Parameter.ENVIRONMENT_BACKGROUND] = { type: 'string' };
45
+ declarations[Parameter.ENVIRONMENT_USEDEFAULT] = { type: 'boolean', parser: Parameter.parseBoolean };
46
+ return declarations;
47
+ }
48
+ /**
49
+ * Gets the {@link ParameterDeclaration} for a given {@link Parameter} declared in this class.
50
+ */
51
+ static getDeclaration(parameter) {
52
+ return Parameter.declarations[parameter];
53
+ }
54
+ /**
55
+ * All parameters defined in this class.
56
+ */
57
+ static get all() {
58
+ const all = [];
59
+ for (const parameter in Parameter) {
60
+ const property = Object.getOwnPropertyDescriptor(Parameter, parameter);
61
+ if (parameter.toUpperCase() === parameter && property && isString(property.value)) {
62
+ all.push(property.value);
63
+ }
64
+ }
65
+ return all;
66
+ }
67
+ /**
68
+ * Parses given {@link ParameterBag} with given {@link ParameterDeclarations}.
69
+ */
70
+ static parseFromDeclarations(declarations, parameterBag) {
71
+ const parameters = {};
72
+ for (const parameter in parameterBag) {
73
+ const value = get(parameterBag, parameter);
74
+ parameters[parameter] = value;
75
+ const declaration = declarations[parameter];
76
+ if (declaration) {
77
+ if (!isEmpty(value) && declaration.parser) {
78
+ parameters[parameter] = declaration.parser(value);
79
+ }
80
+ }
81
+ }
82
+ return parameters;
83
+ }
84
+ /**
85
+ * Parses a string of format `'(x,y,z)'` to a `Vector3`.
86
+ */
87
+ static parseVector(value) {
88
+ if (!isString(value)) {
89
+ throw new Error(`Unable to convert "${value}" into a Vector: not a string.`);
90
+ }
91
+ let cleanedValue = value.split(' ').join('');
92
+ if (cleanedValue.startsWith('(') && cleanedValue.endsWith(')')) {
93
+ cleanedValue = cleanedValue.substring(1, cleanedValue.length - 1);
94
+ let [x, y, z] = cleanedValue.split(',').map(value => parseFloat(value));
95
+ return new Vector3(x, y, z);
96
+ }
97
+ else {
98
+ throw new Error(`Unable to parse "${value}" to a Vector: expected "(x,y,z)".`);
99
+ }
100
+ }
101
+ /**
102
+ * Stringifies a Vector3 to format `(x,y,z)`.
103
+ */
104
+ static stringifyVector(value) {
105
+ return `(${value.x},${value.y},${value.z})`;
106
+ }
107
+ /**
108
+ * Parses a string of format `'(x,y,z)'` with angular degrees to a `Vector3` with rotation information in radians.
109
+ */
110
+ static parseRotation(value) {
111
+ const rotation = Parameter.parseVector(value);
112
+ const deg2rad = function (deg) {
113
+ return (deg * Math.PI) / 180;
114
+ };
115
+ return rotation.set(deg2rad(rotation.x), deg2rad(rotation.y), deg2rad(rotation.z));
116
+ }
117
+ /**
118
+ * Parses a string of format `'(x,y,z)'` or a simple `number` to a `Vector3` for scaling.
119
+ */
120
+ static parseScaling(value) {
121
+ let scaling = new Vector3();
122
+ if (isString(value)) {
123
+ const cleanedFactor = value.split(' ').join('');
124
+ if (cleanedFactor.startsWith('(') && cleanedFactor.endsWith(')')) {
125
+ scaling = Parameter.parseVector(cleanedFactor);
126
+ }
127
+ else {
128
+ const _factor = parseFloat(value);
129
+ scaling = new Vector3(_factor, _factor, _factor);
130
+ }
131
+ }
132
+ else if (isNumber(value)) {
133
+ scaling = new Vector3(value, value, value);
134
+ }
135
+ else {
136
+ throw new Error(`Unable to convert "${value}" to a Vector: expected "(x,y,z)".`);
137
+ }
138
+ return scaling;
139
+ }
140
+ /**
141
+ * Parses a string of format `'#rrggbb'` or `'(r,g,b)'` to a `Color3`.
142
+ */
143
+ static parseColor(value) {
144
+ let cleanedValue = value.toString().split(' ').join('');
145
+ if (cleanedValue.startsWith('#')) {
146
+ return Color3.FromHexString(value.toString());
147
+ }
148
+ if (cleanedValue.startsWith('(') && cleanedValue.endsWith(')')) {
149
+ cleanedValue = cleanedValue.substring(1, cleanedValue.length - 1);
150
+ let [r, g, b] = cleanedValue.split(',').map(value => parseFloat(value));
151
+ return Color3.FromInts(r, g, b);
152
+ }
153
+ throw new Error(`Unable to parse "${value}" to a Color: expected "#rrggbb" or "(r,g,b)".`);
154
+ }
155
+ /**
156
+ * Parses a `boolean` string (`'true'`/`'1'` or `'false'`/`'0'`) or `number` (`1` or `0`) to a `boolean` or `undefined`.
157
+ */
158
+ static parseBoolean(value) {
159
+ if (value.toString() === 'true' || value.toString() === '1') {
160
+ return true;
161
+ }
162
+ else if (value.toString() === 'false' || value.toString() === '0') {
163
+ return false;
164
+ }
165
+ throw new Error(`Unable to parse "${value}" to a boolean.`);
166
+ }
167
+ /**
168
+ * Parses a number `string` to a `number`.
169
+ */
170
+ static parseNumber(value) {
171
+ return parseFloat(value.toString());
172
+ }
173
+ /**
174
+ * Parses a string with comma separated values to a list of strings.
175
+ */
176
+ static parseCommaSeparatedList(value) {
177
+ return value
178
+ .toString()
179
+ .split(',')
180
+ .map(s => s.trim());
181
+ }
182
+ }
183
+ /**
184
+ * Mutates the visibility. Helper methods are {@link VariantParameterizable.show} and
185
+ * {@link VariantParameterizable.hide}. Getter and setter is {@link VariantParameterizable.visible}.
186
+ *
187
+ * Scopes:
188
+ * * {@link Element}
189
+ * * {@link Variant}
190
+ * * {@link ViewerLight} Available for all light types
191
+ *
192
+ * @parser {@link parseBoolean}
193
+ */
194
+ Parameter.VISIBLE = 'visible';
195
+ /**
196
+ * Stretches or compresses some meshes. Getter and setter is {@link VariantParameterizable.scaling}.
197
+ *
198
+ * Scopes:
199
+ * * {@link Element}
200
+ * * {@link Variant}
201
+ *
202
+ * @parser {@link parseScaling}
203
+ */
204
+ Parameter.SCALING = 'scaling';
205
+ /**
206
+ * Mutates the material. Getter and setter is {@link VariantParameterizable.material}. The value of this parameter
207
+ * represents the ID of a baked-in glTF or custom created material in the {@link Variant} tree.
208
+ *
209
+ * Scopes:
210
+ * * {@link Element}
211
+ * * {@link Variant}
212
+ *
213
+ * @parser string
214
+ */
215
+ Parameter.MATERIAL = 'material';
216
+ /**
217
+ * Mutates the material color.
218
+ *
219
+ * Scopes:
220
+ * * {@link Element}
221
+ * * {@link Variant}
222
+ *
223
+ * @parser {@link parseColor}
224
+ */
225
+ Parameter.MATERIAL_COLOR = 'material.color';
226
+ /**
227
+ * Mutates the material metallness.
228
+ *
229
+ * Scopes:
230
+ * * {@link Element}
231
+ * * {@link Variant}
232
+ *
233
+ * @parser {@link parseNumber}
234
+ */
235
+ Parameter.MATERIAL_METALLNESS = 'material.metallness';
236
+ /**
237
+ * Mutates the material roughness.
238
+ *
239
+ * Scopes:
240
+ * * {@link Element}
241
+ * * {@link Variant}
242
+ *
243
+ * @parser {@link parseNumber}
244
+ */
245
+ Parameter.MATERIAL_ROUGHNESS = 'material.roughness';
246
+ /**
247
+ * Mutates whether a highlight layer should be enabled.
248
+ *
249
+ * Scopes:
250
+ * * {@link Element}
251
+ * * {@link Variant}
252
+ *
253
+ * @parser {@link parseBoolean}
254
+ */
255
+ Parameter.HIGHLIGHT_ENABLED = 'highlight.enabled';
256
+ /**
257
+ * Changes the highlight color.
258
+ *
259
+ * Scopes:
260
+ * * {@link Element}
261
+ * * {@link Variant}
262
+ *
263
+ * @parser {@link parseColor}
264
+ */
265
+ Parameter.HIGHLIGHT_COLOR = 'highlight.color';
266
+ /**
267
+ * Mutates the highlighted state. Getter and setter is {@link VariantParameterizable.highlighted}.
268
+ *
269
+ * Scopes:
270
+ * * {@link Element}
271
+ * * {@link Variant}
272
+ *
273
+ * @parser {@link parseBoolean}
274
+ */
275
+ Parameter.HIGHLIGHTED = 'highlighted';
276
+ /**
277
+ * Mutates the position relative to its origin position. Getter and setter is {@link VariantParameterizable.position}.
278
+ *
279
+ * Scopes:
280
+ * * {@link Element}
281
+ * * {@link Variant}
282
+ * * {@link ViewerLight} Available for [PointLight](https://doc.babylonjs.com/typedoc/classes/babylon.pointlight#position), [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#position), [DirectionalLight](https://doc.babylonjs.com/typedoc/classes/babylon.directionallight#position)
283
+ *
284
+ * @parser {@link parseVector}
285
+ */
286
+ Parameter.POSITION = 'position';
287
+ /**
288
+ * Mutates the rotation relative to its origin rotation. Getter and setter is {@link VariantParameterizable.rotation}.
289
+ *
290
+ * Scopes:
291
+ * * {@link Element}
292
+ * * {@link Variant}
293
+ *
294
+ * @parser {@link parseRotation}
295
+ */
296
+ Parameter.ROTATION = 'rotation';
297
+ /**
298
+ * Mutates whether a shadow should be casted or not.
299
+ *
300
+ * Scopes:
301
+ * * {@link Element}
302
+ * * {@link Variant}
303
+ *
304
+ * @parser {@link parseBoolean}
305
+ */
306
+ Parameter.CAST_SHADOW = 'castShadow';
307
+ /**
308
+ * Mutates from which lights a shadow should be casted.
309
+ *
310
+ * Scopes:
311
+ * * {@link Element}
312
+ * * {@link Variant}
313
+ *
314
+ * @parser {@link parseCommaSeparatedList}
315
+ */
316
+ Parameter.CAST_SHADOW_FROM_LIGHTS = 'castShadow.fromLights';
317
+ /**
318
+ * Mutates whether to receive shadows or not.
319
+ *
320
+ * Scopes:
321
+ * * {@link Element}
322
+ * * {@link Variant}
323
+ *
324
+ * @parser {@link parseBoolean}
325
+ */
326
+ Parameter.RECEIVE_SHADOWS = 'receiveShadows';
327
+ /**
328
+ * Mutates the intensity of Lights.
329
+ *
330
+ * Scopes:
331
+ * * {@link ViewerLight} Available for [PointLight](https://doc.babylonjs.com/typedoc/classes/babylon.pointlight#intensity), [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#intensity), [DirectionalLight](https://doc.babylonjs.com/typedoc/classes/babylon.directionallight#intensity), [HemisphericLight](https://doc.babylonjs.com/typedoc/classes/babylon.hemisphericlight#intensity)
332
+ *
333
+ * @parser {@link parseNumber}
334
+ */
335
+ Parameter.INTENSITY = 'intensity';
336
+ /**
337
+ * Mutates the direction of Lights.
338
+ *
339
+ * Scopes:
340
+ * * {@link ViewerLight} Available for [PointLight](https://doc.babylonjs.com/typedoc/classes/babylon.pointlight#direction), [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#direction), [DirectionalLight](https://doc.babylonjs.com/typedoc/classes/babylon.directionallight#direction), [HemisphericLight](https://doc.babylonjs.com/typedoc/classes/babylon.hemisphericlight#direction)
341
+ *
342
+ * @parser {@link parseNumber}
343
+ */
344
+ Parameter.DIRECTION = 'direction';
345
+ /**
346
+ * Mutates the angle of Lights.
347
+ *
348
+ * Scopes:
349
+ * * {@link ViewerLight} Available for [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#angle)
350
+ *
351
+ * @parser {@link parseNumber}
352
+ */
353
+ Parameter.ANGLE = 'angle';
354
+ /**
355
+ * Mutates the exponent of Lights.
356
+ *
357
+ * Scopes:
358
+ * * {@link ViewerLight} Available for [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#exponent)
359
+ *
360
+ * @parser {@link parseNumber}
361
+ */
362
+ Parameter.EXPONENT = 'exponent';
363
+ /**
364
+ * Mutates the diffuse color of Lights.
365
+ *
366
+ * Scopes:
367
+ * * {@link ViewerLight} Available for [PointLight](https://doc.babylonjs.com/typedoc/classes/babylon.pointlight#diffuse), [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#diffuse), [DirectionalLight](https://doc.babylonjs.com/typedoc/classes/babylon.directionallight#diffuse), [HemisphericLight](https://doc.babylonjs.com/typedoc/classes/babylon.hemisphericlight#diffuse)
368
+ *
369
+ * @parser {@link parseNumber}
370
+ */
371
+ Parameter.DIFFUSE = 'diffuse';
372
+ /**
373
+ * Mutates the specular color of Lights.
374
+ *
375
+ * Scopes:
376
+ * * {@link ViewerLight} Available for [PointLight](https://doc.babylonjs.com/typedoc/classes/babylon.pointlight#specular), [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#specular), [DirectionalLight](https://doc.babylonjs.com/typedoc/classes/babylon.directionallight#specular), [HemisphericLight](https://doc.babylonjs.com/typedoc/classes/babylon.hemisphericlight#specular)
377
+ *
378
+ * @parser {@link parseNumber}
379
+ */
380
+ Parameter.SPECULAR = 'specular';
381
+ /**
382
+ * Sets the environment. See [BABYLON.Scene.environmentTexture](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#environmentTexture).
383
+ *
384
+ * Usually the URL to an `*.env` file.
385
+ *
386
+ * See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
387
+ *
388
+ * Scopes:
389
+ * * {@link SceneManager}
390
+ *
391
+ * @parser string
392
+ */
393
+ Parameter.ENVIRONMENT = 'environment';
394
+ /**
395
+ * Sets [BABYLON.Scene.clearColor](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#clearColor)
396
+ *
397
+ * See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
398
+ *
399
+ * Scopes:
400
+ * * {@link SceneManager}
401
+ *
402
+ * @parser {@link parseColor}
403
+ */
404
+ Parameter.ENVIRONMENT_COLOR = 'environment.color';
405
+ /**
406
+ * Rotates connected textures, i.e. IBL, reflection, background, ...
407
+ * Rotation angle in degree.
408
+ *
409
+ * See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
410
+ *
411
+ * Scopes:
412
+ * * {@link SceneManager}
413
+ *
414
+ * @parser {@link parseNumber}
415
+ */
416
+ Parameter.ENVIRONMENT_ROTATION = 'environment.rotation';
417
+ /**
418
+ * Intensity of IBL. Defaults to 1, usually between 0 & 2.
419
+ *
420
+ * See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
421
+ *
422
+ * Scopes:
423
+ * * {@link SceneManager}
424
+ *
425
+ * @parser {@link parseNumber}
426
+ */
427
+ Parameter.ENVIRONMENT_INTENSITY = 'environment.intensity';
428
+ /**
429
+ * Background texture on a [PhotoDome](https://doc.babylonjs.com/divingDeeper/environment/360PhotoDome). Just background, no IBL or reflection.
430
+ *
431
+ * Recommended format is `*.jpg`. HDR files are not supported as background but can be converted to `*.jpg` using tools like Photoshop, Gimp or various free online converters.
432
+ *
433
+ * See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
434
+ *
435
+ * Scopes:
436
+ * * {@link SceneManager}
437
+ *
438
+ * @parser string
439
+ */
440
+ Parameter.ENVIRONMENT_BACKGROUND = 'environment.background';
441
+ /**
442
+ * If `true`, sets a `scene.environmentTexture` and creates a *BackgroundHelper* Node (via
443
+ * [scene.createDefaultEnvironment](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#createDefaultEnvironment))
444
+ * with two subnodes/meshes:
445
+ * - BackgroundPlane
446
+ * - BackgroundSkybox
447
+ *
448
+ * The value of this parameter is ignored if {@link ENVIRONMENT_BACKGROUND} is also set.
449
+ *
450
+ * See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
451
+ *
452
+ * Scopes:
453
+ * * {@link SceneManager}
454
+ *
455
+ * @parser {@link parseBoolean}
456
+ */
457
+ Parameter.ENVIRONMENT_USEDEFAULT = 'environment.usedefault';
469
458
  //# sourceMappingURL=parameter.js.map