@combeenation/3d-viewer 4.0.0-beta5 → 4.1.0-alpha1

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.
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GltfExportManager = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var serializers_1 = require("@babylonjs/serializers");
6
+ var lodash_es_1 = require("lodash-es");
7
+ var GltfExportManager = /** @class */ (function () {
8
+ /**
9
+ * Constructor.
10
+ */
11
+ function GltfExportManager(scene) {
12
+ this.scene = scene;
13
+ }
14
+ /**
15
+ * Creates an {@link GltfExportManager}.
16
+ */
17
+ GltfExportManager.create = function (scene) {
18
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
19
+ return tslib_1.__generator(this, function (_a) {
20
+ return [2 /*return*/, new GltfExportManager(scene)];
21
+ });
22
+ });
23
+ };
24
+ /**
25
+ * Exports selected nodes to a {@link GlbExportResult} blob.
26
+ * @param exportOptions export options to be merged with default options. See {@link gltfExportOptions}.
27
+ */
28
+ GltfExportManager.prototype.exportGlb = function (exportOptions) {
29
+ if (exportOptions === void 0) { exportOptions = {}; }
30
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
31
+ var glbData;
32
+ return tslib_1.__generator(this, function (_a) {
33
+ switch (_a.label) {
34
+ case 0: return [4 /*yield*/, serializers_1.GLTF2Export.GLBAsync(this.scene, 'dummy', this.gltfExportOptions(exportOptions))];
35
+ case 1:
36
+ glbData = _a.sent();
37
+ return [2 /*return*/, glbData.glTFFiles['dummy.glb']]; // should be only one file for glb
38
+ }
39
+ });
40
+ });
41
+ };
42
+ /**
43
+ * Exports selected nodes to GLTF. This may result in more than one file, since textures are exported separately.
44
+ * @param filename name of the main (text-based) .GLTF file referring to separate texture files.
45
+ * @param exportOptions export options to be merged with default options. See {@link gltfExportOptions}.
46
+ */
47
+ GltfExportManager.prototype.exportGltfToFile = function (filename, exportOptions) {
48
+ if (exportOptions === void 0) { exportOptions = {}; }
49
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
50
+ return tslib_1.__generator(this, function (_a) {
51
+ switch (_a.label) {
52
+ case 0: return [4 /*yield*/, serializers_1.GLTF2Export.GLTFAsync(this.scene, filename, this.gltfExportOptions(exportOptions)).then(function (glb) {
53
+ glb.downloadFiles();
54
+ })];
55
+ case 1:
56
+ _a.sent();
57
+ return [2 /*return*/];
58
+ }
59
+ });
60
+ });
61
+ };
62
+ /**
63
+ * Exports selected nodes to GLB. This results in one binary file.
64
+ * @param filename name of the .GLB file.
65
+ * @param exportOptions export options to be merged with default options. See {@link gltfExportOptions}.
66
+ */
67
+ GltfExportManager.prototype.exportGlbToFile = function (filename, exportOptions) {
68
+ if (exportOptions === void 0) { exportOptions = {}; }
69
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
70
+ return tslib_1.__generator(this, function (_a) {
71
+ switch (_a.label) {
72
+ case 0: return [4 /*yield*/, serializers_1.GLTF2Export.GLBAsync(this.scene, filename, this.gltfExportOptions(exportOptions)).then(function (glb) {
73
+ glb.downloadFiles();
74
+ })];
75
+ case 1:
76
+ _a.sent();
77
+ return [2 /*return*/];
78
+ }
79
+ });
80
+ });
81
+ };
82
+ /**
83
+ * Gets predefined {@link IExportOptions } merged with given ones.
84
+ * @protected
85
+ */
86
+ GltfExportManager.prototype.gltfExportOptions = function (mergeWithOptions) {
87
+ if (mergeWithOptions === void 0) { mergeWithOptions = {}; }
88
+ var defaultOptions = {
89
+ // includeCoordinateSystemConversionNodes: true,
90
+ shouldExportNode: function (node) {
91
+ if (!node.isEnabled()) {
92
+ return false;
93
+ }
94
+ if (node.isVisible === false) {
95
+ return false;
96
+ }
97
+ if (node.name === '__bounding_box__') {
98
+ return false;
99
+ }
100
+ return true;
101
+ }
102
+ };
103
+ return lodash_es_1.merge({}, defaultOptions, mergeWithOptions);
104
+ };
105
+ return GltfExportManager;
106
+ }());
107
+ exports.GltfExportManager = GltfExportManager;
108
+ //# sourceMappingURL=gltfExportManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gltfExportManager.js","sourceRoot":"","sources":["../../../../src/api/manager/gltfExportManager.ts"],"names":[],"mappings":";;;;AACA,sDAAqE;AACrE,uCAAkC;AAElC;IAEC;;OAEG;IACH,2BAAiC,KAAY;QAAZ,UAAK,GAAL,KAAK,CAAO;IAC7C,CAAC;IAED;;OAEG;IACiB,wBAAM,GAA1B,UAA4B,KAAY;;;gBACvC,sBAAO,IAAI,iBAAiB,CAAE,KAAK,CAAE,EAAC;;;KACtC;IAED;;;OAGG;IACU,qCAAS,GAAtB,UAAwB,aAAkC;QAAlC,8BAAA,EAAA,kBAAkC;;;;;4BACzC,qBAAM,yBAAW,CAAC,QAAQ,CAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,iBAAiB,CAAE,aAAa,CAAE,CAAE,EAAA;;wBAApG,OAAO,GAAG,SAA0F;wBAC1G,sBAAO,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,EAAC,CAAE,kCAAkC;;;;KAC1E;IAED;;;;OAIG;IACU,4CAAgB,GAA7B,UAA+B,QAAgB,EAAE,aAAkC;QAAlC,8BAAA,EAAA,kBAAkC;;;;4BAClF,qBAAM,yBAAW,CAAC,SAAS,CAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,iBAAiB,CAAE,aAAa,CAAE,CAAE,CAAC,IAAI,CAAE,UAAE,GAAG;4BACvG,GAAG,CAAC,aAAa,EAAE,CAAC;wBACrB,CAAC,CAAE,EAAA;;wBAFH,SAEG,CAAC;;;;;KACJ;IAED;;;;OAIG;IACU,2CAAe,GAA5B,UAA8B,QAAgB,EAAE,aAAkC;QAAlC,8BAAA,EAAA,kBAAkC;;;;4BACjF,qBAAM,yBAAW,CAAC,QAAQ,CAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,iBAAiB,CAAE,aAAa,CAAE,CAAE,CAAC,IAAI,CAAE,UAAE,GAAG;4BACtG,GAAG,CAAC,aAAa,EAAE,CAAC;wBACrB,CAAC,CAAE,EAAA;;wBAFH,SAEG,CAAC;;;;;KACJ;IAED;;;OAGG;IACO,6CAAiB,GAA3B,UAA6B,gBAAqC;QAArC,iCAAA,EAAA,qBAAqC;QACjE,IAAM,cAAc,GAAG;YACtB,gDAAgD;YAChD,gBAAgB,EAAE,UAAU,IAAS;gBACpC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAG;oBACvB,OAAO,KAAK,CAAC;iBACb;gBACD,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK,EAAG;oBAC9B,OAAO,KAAK,CAAC;iBACb;gBACD,IAAI,IAAI,CAAC,IAAI,KAAK,kBAAkB,EAAG;oBACtC,OAAO,KAAK,CAAC;iBACb;gBACD,OAAO,IAAI,CAAC;YACb,CAAC;SACD,CAAC;QACF,OAAO,iBAAK,CAAE,EAAE,EAAE,cAAc,EAAE,gBAAgB,CAAE,CAAC;IACtD,CAAC;IAEF,wBAAC;AAAD,CAAC,AArED,IAqEC;AArEY,8CAAiB"}
@@ -2,7 +2,6 @@ import { HighlightLayer } from '@babylonjs/core/Layers/highlightLayer';
2
2
  import { ShadowGenerator } from '@babylonjs/core/Lights/Shadows/shadowGenerator';
3
3
  import { Material } from '@babylonjs/core/Materials/material';
4
4
  import { Color3 } from '@babylonjs/core/Maths/math.color';
5
- import { Vector3 } from '@babylonjs/core/Maths/math.vector';
6
5
  import { AbstractMesh } from '@babylonjs/core/Meshes/abstractMesh';
7
6
  import { TransformNode } from '@babylonjs/core/Meshes/transformNode';
8
7
  import { Node } from '@babylonjs/core/node';
@@ -74,19 +73,11 @@ declare const enableNodeWithParents: (node: Node) => void;
74
73
  */
75
74
  declare const disableNodeWithParents: (node: Node) => void;
76
75
  /**
77
- * Attention: this function mutates the position of a node. Keep in mind that there are dependencies to other
78
- * functions moving nodes around.
76
+ * Applies a {@link TransformationDefinition} consecutively to ensure dependencies in positioning etc.
79
77
  * @param node
80
- * @param rotation
78
+ * @param transformation
81
79
  */
82
- declare const rotateTransformNode: (node: TransformNode, rotation: Vector3) => TransformNode;
83
- /**
84
- * Attention: this function mutates the position of a node. Keep in mind that there are dependencies to other
85
- * functions moving nodes around.
86
- * @param node
87
- * @param distance
88
- */
89
- declare const moveTransformNode: (node: TransformNode, distance: Vector3) => TransformNode;
80
+ declare const transformTransformNode: (node: TransformNode, transformation: TransformationDefinition) => void;
90
81
  /**
91
82
  * @param node
92
83
  * @param material
@@ -172,4 +163,4 @@ declare const removeFromShadowGenerator: (generator: ShadowGenerator, node: Tran
172
163
  * @param canvas
173
164
  */
174
165
  declare const getClientRectFromMesh: (mesh: AbstractMesh, scene: Scene, canvas: HTMLCanvasElement) => ClientRect;
175
- export { getRootNode, mapToDottedNodes, getDottedPathForNode, cloneTransformNode, cloneNodeWithParents, cloneTransformNodeMaterial, injectNodeMetadata, assertTransformNode, activateTransformNode, deactivateTransformNode, enableNodeWithParents, disableNodeWithParents, rotateTransformNode, moveTransformNode, setMaterial, setSourceNodeMaterial, setMaterialColor, setMaterialTexture, setMaterialMetallness, setMaterialRoughness, addToHighlightLayer, removeFromHighlightLayer, setReceiveShadows, addToShadowGenerator, removeFromShadowGenerator, getClientRectFromMesh };
166
+ export { getRootNode, mapToDottedNodes, getDottedPathForNode, cloneTransformNode, cloneNodeWithParents, cloneTransformNodeMaterial, injectNodeMetadata, assertTransformNode, activateTransformNode, deactivateTransformNode, enableNodeWithParents, disableNodeWithParents, transformTransformNode, setMaterial, setSourceNodeMaterial, setMaterialColor, setMaterialTexture, setMaterialMetallness, setMaterialRoughness, addToHighlightLayer, removeFromHighlightLayer, setReceiveShadows, addToShadowGenerator, removeFromShadowGenerator, getClientRectFromMesh };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getClientRectFromMesh = exports.removeFromShadowGenerator = exports.addToShadowGenerator = exports.setReceiveShadows = exports.removeFromHighlightLayer = exports.addToHighlightLayer = exports.setMaterialRoughness = exports.setMaterialMetallness = exports.setMaterialTexture = exports.setMaterialColor = exports.setSourceNodeMaterial = exports.setMaterial = exports.moveTransformNode = exports.rotateTransformNode = exports.disableNodeWithParents = exports.enableNodeWithParents = exports.deactivateTransformNode = exports.activateTransformNode = exports.assertTransformNode = exports.injectNodeMetadata = exports.cloneTransformNodeMaterial = exports.cloneNodeWithParents = exports.cloneTransformNode = exports.getDottedPathForNode = exports.mapToDottedNodes = exports.getRootNode = void 0;
3
+ exports.getClientRectFromMesh = exports.removeFromShadowGenerator = exports.addToShadowGenerator = exports.setReceiveShadows = exports.removeFromHighlightLayer = exports.addToHighlightLayer = exports.setMaterialRoughness = exports.setMaterialMetallness = exports.setMaterialTexture = exports.setMaterialColor = exports.setSourceNodeMaterial = exports.setMaterial = exports.transformTransformNode = exports.disableNodeWithParents = exports.enableNodeWithParents = exports.deactivateTransformNode = exports.activateTransformNode = exports.assertTransformNode = exports.injectNodeMetadata = exports.cloneTransformNodeMaterial = exports.cloneNodeWithParents = exports.cloneTransformNode = exports.getDottedPathForNode = exports.mapToDottedNodes = exports.getRootNode = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var light_1 = require("@babylonjs/core/Lights/light");
6
6
  var math_axis_1 = require("@babylonjs/core/Maths/math.axis");
@@ -211,59 +211,39 @@ var disableNodeWithParents = function (node) {
211
211
  };
212
212
  exports.disableNodeWithParents = disableNodeWithParents;
213
213
  /**
214
- * Attention: this function mutates the position of a node. Keep in mind that there are dependencies to other
215
- * functions moving nodes around.
214
+ * Applies a {@link TransformationDefinition} consecutively to ensure dependencies in positioning etc.
216
215
  * @param node
217
- * @param rotation
216
+ * @param transformation
218
217
  */
219
- var rotateTransformNode = function (node, rotation) {
220
- var _a;
221
- // remember absolute rotation and reset it before translating
222
- if (!lodash_es_1.has(node.metadata, 'rotation.initial')) {
223
- injectNodeMetadata(node, { 'rotation.initial': (_a = node.rotationQuaternion) === null || _a === void 0 ? void 0 : _a.asArray() }, false);
224
- }
225
- if (!lodash_es_1.has(node.metadata, 'rotation.position') || lodash_es_1.get(node.metadata, 'position.dirty')) {
226
- var rotationPosition = node.absolutePosition.clone();
227
- if (lodash_es_1.has(node.metadata, 'rotation.offset')) {
228
- rotationPosition = rotationPosition.subtract(lodash_es_1.get(node.metadata, 'rotation.offset'));
229
- }
230
- injectNodeMetadata(node, { 'rotation.position': rotationPosition }, false);
231
- injectNodeMetadata(node, { 'position.dirty': false }, false);
232
- }
233
- node.setAbsolutePosition(lodash_es_1.get(node.metadata, 'rotation.position'));
234
- if (node.metadata.rotation) {
235
- node.rotationQuaternion = math_vector_1.Quaternion.FromArray(lodash_es_1.get(node.metadata, 'rotation.initial'));
236
- }
237
- node.rotateAround(math_vector_1.Vector3.Zero(), math_axis_1.Axis.X, rotation.x);
238
- node.rotateAround(math_vector_1.Vector3.Zero(), math_axis_1.Axis.Y, rotation.y);
239
- node.rotateAround(math_vector_1.Vector3.Zero(), math_axis_1.Axis.Z, rotation.z);
240
- node.computeWorldMatrix(true);
241
- injectNodeMetadata(node, {
242
- 'rotation.offset': node.absolutePosition.subtract(lodash_es_1.get(node.metadata, 'rotation.position'))
243
- }, false);
244
- return node;
245
- };
246
- exports.rotateTransformNode = rotateTransformNode;
247
- /**
248
- * Attention: this function mutates the position of a node. Keep in mind that there are dependencies to other
249
- * functions moving nodes around.
250
- * @param node
251
- * @param distance
252
- */
253
- var moveTransformNode = function (node, distance) {
254
- // remember absolute position and reset it before translating
218
+ var transformTransformNode = function (node, transformation) {
219
+ // scaling
220
+ if (!lodash_es_1.has(node.metadata, 'scaling.initial')) {
221
+ injectNodeMetadata(node, { 'scaling.initial': node.scaling }, false);
222
+ }
223
+ var initialScaling = lodash_es_1.get(node.metadata, 'scaling.initial');
224
+ node.scaling = initialScaling.multiply(transformation.scaling);
225
+ // position
255
226
  if (!lodash_es_1.has(node.metadata, 'position.initial')) {
256
227
  injectNodeMetadata(node, { 'position.initial': node.absolutePosition.clone() }, false);
257
228
  }
258
- var position = lodash_es_1.get(node.metadata, 'position.initial');
259
- if (lodash_es_1.has(node.metadata, 'rotation.offset')) {
260
- position = position.add(lodash_es_1.get(node.metadata, 'rotation.offset'));
229
+ var initialPosition = lodash_es_1.get(node.metadata, 'position.initial');
230
+ node.setAbsolutePosition(initialPosition.add(transformation.position).multiply(transformation.scaling));
231
+ // rotation
232
+ if (!lodash_es_1.has(node.metadata, 'rotation.initial')) {
233
+ var rotationQuaternion = node.rotationQuaternion;
234
+ if (!rotationQuaternion) {
235
+ rotationQuaternion = math_vector_1.Quaternion.RotationYawPitchRoll(node.rotation.x, node.rotation.y, node.rotation.z);
236
+ }
237
+ injectNodeMetadata(node, { 'rotation.initial': rotationQuaternion.asArray() }, false);
261
238
  }
262
- node.setAbsolutePosition(position.add(distance));
263
- injectNodeMetadata(node, { 'position.dirty': true }, false);
264
- return node;
239
+ var initialRotationQuaternion = math_vector_1.Quaternion.FromArray(lodash_es_1.get(node.metadata, 'rotation.initial'));
240
+ node.rotationQuaternion = initialRotationQuaternion;
241
+ node.rotateAround(math_vector_1.Vector3.Zero(), math_axis_1.Axis.X, transformation.rotation.x);
242
+ node.rotateAround(math_vector_1.Vector3.Zero(), math_axis_1.Axis.Y, transformation.rotation.y);
243
+ node.rotateAround(math_vector_1.Vector3.Zero(), math_axis_1.Axis.Z, transformation.rotation.z);
244
+ node.computeWorldMatrix(true);
265
245
  };
266
- exports.moveTransformNode = moveTransformNode;
246
+ exports.transformTransformNode = transformTransformNode;
267
247
  /**
268
248
  * @param node
269
249
  * @param material
@@ -1 +1 @@
1
- {"version":3,"file":"babylonHelper.js","sourceRoot":"","sources":["../../../../src/api/util/babylonHelper.ts"],"names":[],"mappings":";;;;AACA,sDAAqD;AAKrD,6DAAuD;AAEvD,iEAAwE;AACxE,oEAAmE;AACnE,sEAAqE;AAErE,sEAAqE;AAGrE,uCAAuD;AACvD,oDAAmD;AAEnD;;;GAGG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,CAAE,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,EAAH,CAAG,CAAE,CAAE,CAAC;IACjE,IAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAE,IAAI,EAAE,WAAW,CAAC,GAAG,CAAE,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,EAAH,CAAG,CAAE,CAAE,CAAC;IACjE,IAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAE,IAAI,EAAE,WAAW,CAAC,GAAG,CAAE,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,EAAH,CAAG,CAAE,CAAE,CAAC;IACjE,gCAAgC;IAChC,OAAO;QACN,KAAK,EAAE,IAAI,GAAG,IAAI;QAClB,MAAM,EAAE,IAAI,GAAG,IAAI;QACnB,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,IAAI;QACT,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;KACE,CAAC;AACjB,CAAC,CAAC;AA2BD,sDAAqB"}
@@ -63,6 +63,11 @@ declare type ElementDefinition = {
63
63
  traceables?: TraceableDefinitions;
64
64
  paintables?: PaintableDefinitions;
65
65
  };
66
+ declare type TransformationDefinition = {
67
+ scaling: Vector3;
68
+ position: Vector3;
69
+ rotation: Vector3;
70
+ };
66
71
  declare type StructureJson = {
67
72
  /**
68
73
  * `scene` describes the visualisation of the Babylon `scene` such as the incidence of light and camera position. If a
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@combeenation/3d-viewer",
3
3
  "description": "Combeenation 3D Viewer",
4
- "version": "4.0.0-beta5",
4
+ "version": "4.1.0-alpha1",
5
5
  "homepage": "https://github.com/Combeenation/3d-viewer#readme",
6
6
  "keywords": [],
7
7
  "author": "",
@@ -21,16 +21,15 @@ import {
21
21
  getClientRectFromMesh,
22
22
  injectNodeMetadata,
23
23
  mapToDottedNodes,
24
- moveTransformNode,
25
24
  removeFromHighlightLayer,
26
25
  removeFromShadowGenerator,
27
- rotateTransformNode,
28
26
  setMaterial,
29
27
  setMaterialColor,
30
28
  setMaterialMetallness,
31
29
  setMaterialRoughness,
32
30
  setMaterialTexture,
33
- setReceiveShadows
31
+ setReceiveShadows,
32
+ transformTransformNode
34
33
  } from '../util/babylonHelper';
35
34
  import { createImageFromImgSrc, createImageFromSvg } from '../util/resourceHelper';
36
35
  import { VariantParameterizable } from './../classes/variantParameterizable';
@@ -356,7 +355,31 @@ export class Element extends VariantParameterizable {
356
355
  this._parameterObservers.set( Parameter.SCALING, [
357
356
  async ( element: Element, oldValue: ParameterValue, newValue: ParameterValue ) => {
358
357
  // we have to deal just with root nodes here due to relative impacts in a node tree
359
- element.nodes.forEach( node => node.scaling = Parameter.parseScaling( newValue ) );
358
+ element.nodes.forEach( node => transformTransformNode( node, {
359
+ scaling: Parameter.parseVector( newValue ),
360
+ position: Parameter.parseVector( element.inheritedParameters[Parameter.POSITION] || '(0, 0, 0)' ),
361
+ rotation: Parameter.parseRotation( element.inheritedParameters[Parameter.ROTATION] || '(0, 0, 0)' )
362
+ } ) );
363
+ }
364
+ ] );
365
+ this._parameterObservers.set( Parameter.POSITION, [
366
+ async ( element: Element, oldValue: ParameterValue, newValue: ParameterValue ) => {
367
+ // we have to deal just with root nodes here due to relative impacts in a node tree
368
+ element.nodes.forEach( node => transformTransformNode( node, {
369
+ scaling: Parameter.parseVector( element.inheritedParameters[Parameter.SCALING] || '(1, 1, 1)' ),
370
+ position: Parameter.parseVector( newValue ),
371
+ rotation: Parameter.parseRotation( element.inheritedParameters[Parameter.ROTATION] || '(0, 0, 0)' )
372
+ } ) );
373
+ }
374
+ ] );
375
+ this._parameterObservers.set( Parameter.ROTATION, [
376
+ async ( element: Element, oldValue: ParameterValue, newValue: ParameterValue ) => {
377
+ // we have to deal just with root nodes here due to relative impacts in a node tree
378
+ element.nodes.forEach( node => transformTransformNode( node, {
379
+ scaling: Parameter.parseVector( element.inheritedParameters[Parameter.SCALING] || '(1, 1, 1)' ),
380
+ position: Parameter.parseVector( element.inheritedParameters[Parameter.POSITION] || '(0, 0, 0)' ),
381
+ rotation: Parameter.parseRotation( newValue )
382
+ } ) );
360
383
  }
361
384
  ] );
362
385
  this._parameterObservers.set( Parameter.MATERIAL, [
@@ -514,25 +537,6 @@ export class Element extends VariantParameterizable {
514
537
  }
515
538
  }
516
539
  ] );
517
- this._parameterObservers.set( Parameter.POSITION, [
518
- async ( element: Element, oldValue: ParameterValue, newValue: ParameterValue ) => {
519
- // we have to deal just with root nodes here due to relative impacts in a node tree
520
- element.nodes.forEach( node => moveTransformNode( node, Parameter.parseVector( newValue ) ) );
521
- }
522
- ] );
523
- this._parameterObservers.set( Parameter.ROTATION, [
524
- async ( element: Element, oldValue: ParameterValue, newValue: ParameterValue ) => {
525
- // The current implementation (rotating around coordinates 0,0,0) implicitly mutates the position of a node.
526
- // Since a user expects the rotation after the positioning, we have to manually fire the position observers.
527
- // Without calling these observers, the pivot and the position of a node is initially the same before rotating,
528
- // so there is no rotation happening at all.
529
- if( Parameter.POSITION in element.inheritedParameters ) {
530
- await element.commitParameter( Parameter.POSITION, element.inheritedParameters[Parameter.POSITION] );
531
- }
532
- // we have to deal just with root nodes here due to relative impacts in a node tree
533
- element.nodes.forEach( node => rotateTransformNode( node, Parameter.parseRotation( newValue ) ) );
534
- }
535
- ] );
536
540
  this._parameterObservers.set( Parameter.CAST_SHADOW, [
537
541
  async ( element: Element, oldValue: ParameterValue, newValue: ParameterValue ) => {
538
542
  let castShadow;
@@ -240,6 +240,8 @@ export class Parameter {
240
240
  const declarations: ParameterDeclarations = {};
241
241
  declarations[Parameter.VISIBLE] = { type: 'boolean', parser: Parameter.parseBoolean };
242
242
  declarations[Parameter.SCALING] = { type: 'number', parser: Parameter.parseNumber };
243
+ declarations[Parameter.POSITION] = { type: 'vector', parser: Parameter.parseVector };
244
+ declarations[Parameter.ROTATION] = { type: 'vector', parser: Parameter.parseVector };
243
245
  declarations[Parameter.HIGHLIGHTED] = { type: 'boolean', parser: Parameter.parseBoolean };
244
246
  declarations[Parameter.MATERIAL] = { type: 'string' };
245
247
  declarations[Parameter.MATERIAL_COLOR] = { type: 'color', parser: Parameter.parseColor };
@@ -248,8 +250,6 @@ export class Parameter {
248
250
  declarations[Parameter.HIGHLIGHT_ENABLED] = { type: 'boolean', parser: Parameter.parseBoolean };
249
251
  declarations[Parameter.HIGHLIGHT_COLOR] = { type: 'color', parser: Parameter.parseColor };
250
252
  declarations[Parameter.HIGHLIGHTED] = { type: 'boolean', parser: Parameter.parseBoolean };
251
- declarations[Parameter.POSITION] = { type: 'vector', parser: Parameter.parseVector };
252
- declarations[Parameter.ROTATION] = { type: 'vector', parser: Parameter.parseVector };
253
253
  declarations[Parameter.CAST_SHADOW] = { type: 'boolean', parser: Parameter.parseBoolean };
254
254
  declarations[Parameter.CAST_SHADOW_FROM_LIGHTS] = { type: 'csl', parser: Parameter.parseCommaSeparatedList };
255
255
  declarations[Parameter.RECEIVE_SHADOWS] = { type: 'boolean', parser: Parameter.parseBoolean };
@@ -1,10 +1,10 @@
1
+ import { cloneDeep, concat, get, merge } from 'lodash-es';
1
2
  import { DottedPath } from './../classes/dottedPath';
2
3
  import { Event } from './../classes/event';
3
4
  import { Parameterizable } from './../classes/parameterizable';
4
5
  import { Variant } from './../classes/variant';
5
6
  import { mergeMaps } from './../util/resourceHelper';
6
7
  import { camelToSnakeCase } from './../util/stringHelper';
7
- import { cloneDeep, concat, get, merge } from 'lodash-es';
8
8
 
9
9
  export abstract class VariantParameterizable extends Parameterizable {
10
10
 
@@ -20,6 +20,13 @@ export abstract class VariantParameterizable extends Parameterizable {
20
20
  */
21
21
  get inheritedParameters(): ParameterBag {
22
22
  const parameterBag: ParameterBag = {};
23
+ for( const parameter in this.variant.inheritedParameters ) {
24
+ const dpp = DottedPath.create( parameter );
25
+ if( dpp.parts.length !== 1 ) {
26
+ continue;
27
+ }
28
+ parameterBag[parameter] = this.variant.inheritedParameters[parameter];
29
+ }
23
30
  for( const parameter in this.variant.inheritedParameters ) {
24
31
  const dpp = DottedPath.create( parameter );
25
32
  if( dpp.firstPart !== this.name ) {
@@ -278,18 +278,27 @@ export class Viewer extends EventBroadcaster {
278
278
  }
279
279
  this.scene.render(); // XXX: workaround for BoundingBox not respecting render loop
280
280
  const bbName = '__bounding_box__';
281
- let max = new Vector3( 0, 0, 0 );
282
- let min = new Vector3( 0, 0, 0 );
283
- this.scene.meshes.filter( mesh => bbName !== mesh.id && mesh.isEnabled() ).forEach( mesh => {
284
- max = Vector3.Maximize( max, mesh.getBoundingInfo().boundingBox.maximumWorld );
285
- min = Vector3.Minimize( min, mesh.getBoundingInfo().boundingBox.minimumWorld );
286
- } );
281
+
282
+ const { max, min } = this.scene.meshes.filter( mesh => {
283
+ const isEnabled = mesh.isEnabled();
284
+ // ignore the existing bounding box mesh for calculating the current one
285
+ const isNotBBoxMesh = bbName !== mesh.id;
286
+ // ignore meshes with invalid bounding infos
287
+ const hasValidBBoxInfo = mesh.getBoundingInfo().boundingSphere.radius > 0;
288
+ return isEnabled && isNotBBoxMesh && hasValidBBoxInfo;
289
+ } ).reduce( ( accBBoxMinMax, curMesh, idx ) => {
290
+ const bBox = curMesh.getBoundingInfo().boundingBox;
291
+ // use the first entry in the array as default value and get the resulting maximum/minimum values
292
+ const max = ( idx === 0 ) ? bBox.maximumWorld : Vector3.Maximize( accBBoxMinMax.max, bBox.maximumWorld )
293
+ const min = ( idx === 0 ) ? bBox.minimumWorld : Vector3.Minimize( accBBoxMinMax.min, bBox.minimumWorld )
294
+ return { max, min }
295
+ }, { max: new Vector3(), min: new Vector3() } );
296
+
287
297
  let boundingBox = this.scene.getMeshByName( bbName ) as Mesh;
288
298
  if( !boundingBox ) {
289
299
  boundingBox = new Mesh( bbName, this.scene );
290
300
  }
291
301
  boundingBox.setBoundingInfo( new BoundingInfo( min, max ) );
292
- //boundingBox.showBoundingBox = true;
293
302
  return boundingBox;
294
303
  }
295
304
 
@@ -14,8 +14,7 @@ import {
14
14
  enableNodeWithParents,
15
15
  getRootNode,
16
16
  injectNodeMetadata,
17
- moveTransformNode,
18
- rotateTransformNode
17
+ transformTransformNode
19
18
  } from './../util/babylonHelper';
20
19
  import { DottedPath } from './dottedPath';
21
20
  import { Parameter } from './parameter';
@@ -128,37 +127,42 @@ export class ViewerLight extends VariantParameterizable {
128
127
  set( light.light, 'intensity', Parameter.parseNumber( newValue ) );
129
128
  }
130
129
  ] );
131
- this._parameterObservers.set( Parameter.POSITION, [
130
+ this._parameterObservers.set( Parameter.SCALING, [
132
131
  async ( light: ViewerLight, oldValue: ParameterValue, newValue: ParameterValue ) => {
133
132
  // we have to deal just with root nodes here due to relative impacts in a node tree
134
133
  const rootNode = getRootNode( light.light );
135
134
  if( rootNode instanceof TransformNode ) {
136
- moveTransformNode( rootNode, Parameter.parseVector( newValue ) );
135
+ transformTransformNode( rootNode, {
136
+ scaling: Parameter.parseScaling( newValue ),
137
+ position: Parameter.parseVector( light.inheritedParameters[Parameter.POSITION] || '(0, 0, 0)' ),
138
+ rotation: Parameter.parseRotation( light.inheritedParameters[Parameter.ROTATION] || '(0, 0, 0)' )
139
+ } );
137
140
  }
138
141
  }
139
142
  ] );
140
- this._parameterObservers.set( Parameter.ROTATION, [
143
+ this._parameterObservers.set( Parameter.POSITION, [
141
144
  async ( light: ViewerLight, oldValue: ParameterValue, newValue: ParameterValue ) => {
142
- // The current implementation (rotating around coordinates 0,0,0) implicitly mutates the position of a node.
143
- // Since a user expects the rotation after the positioning, we have to manually fire the position observers.
144
- // Without calling these observers, the pivot and the position of a node is initially the same before rotating,
145
- // so there is no rotation happening at all.
146
- if( Parameter.POSITION in light.inheritedParameters ) {
147
- await light.commitParameter( Parameter.POSITION, light.inheritedParameters[Parameter.POSITION] );
148
- }
149
145
  // we have to deal just with root nodes here due to relative impacts in a node tree
150
146
  const rootNode = getRootNode( light.light );
151
147
  if( rootNode instanceof TransformNode ) {
152
- rotateTransformNode( rootNode, Parameter.parseRotation( newValue ) );
148
+ transformTransformNode( rootNode, {
149
+ scaling: Parameter.parseVector( light.inheritedParameters[Parameter.SCALING] || '(1, 1, 1)' ),
150
+ position: Parameter.parseVector( newValue ),
151
+ rotation: Parameter.parseRotation( light.inheritedParameters[Parameter.ROTATION] || '(0, 0, 0)' )
152
+ } );
153
153
  }
154
154
  }
155
155
  ] );
156
- this._parameterObservers.set( Parameter.SCALING, [
156
+ this._parameterObservers.set( Parameter.ROTATION, [
157
157
  async ( light: ViewerLight, oldValue: ParameterValue, newValue: ParameterValue ) => {
158
158
  // we have to deal just with root nodes here due to relative impacts in a node tree
159
159
  const rootNode = getRootNode( light.light );
160
160
  if( rootNode instanceof TransformNode ) {
161
- rootNode.scaling = Parameter.parseScaling( newValue );
161
+ transformTransformNode( rootNode, {
162
+ scaling: Parameter.parseVector( light.inheritedParameters[Parameter.SCALING] || '(1, 1, 1)' ),
163
+ position: Parameter.parseVector( light.inheritedParameters[Parameter.POSITION] || '(0, 0, 0)' ),
164
+ rotation: Parameter.parseRotation( newValue )
165
+ } );
162
166
  }
163
167
  }
164
168
  ] );