@colijnit/homedecorator 258.1.13 → 258.1.15

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.
@@ -31,6 +31,10 @@ export declare class CustomShapeCreatorComponent implements OnInit {
31
31
  selectedFace: Face;
32
32
  textureOptions: typeof TextureEditorOptions;
33
33
  skin: BoxSkin;
34
+ private _oldFloorPosition;
35
+ private _oldFloorElevation;
36
+ private _oldWallPosition;
37
+ private _oldWallElevation;
34
38
  constructor(_hudService: HudService, _sceneService: SceneService, _roomService: RoomService, _itemService: ItemService, _sceneEventService: SceneEventService, _messageBusService: MessageBusService);
35
39
  ngOnInit(): void;
36
40
  setName(name: string): void;
@@ -2409,7 +2409,9 @@
2409
2409
  }
2410
2410
  };
2411
2411
  BaseItem.prototype.setYPositionBasedOnElevation = function () {
2412
- this.position.y = this.elevation;
2412
+ if (this.elevation) {
2413
+ this.position.y = this.elevation;
2414
+ }
2413
2415
  };
2414
2416
  BaseItem.prototype.getHalfSizeWithoutScale = function () {
2415
2417
  if (this.children.length < 1) {
@@ -2735,13 +2737,13 @@
2735
2737
  }
2736
2738
  if (rawMetadata.elevation) {
2737
2739
  this.elevation = rawMetadata.elevation;
2738
- this.setYPositionBasedOnElevation();
2739
2740
  }
2740
2741
  else {
2741
2742
  this.elevation = 0;
2742
2743
  }
2743
2744
  }
2744
2745
  this.calculateHalfSize();
2746
+ this.setYPositionBasedOnElevation();
2745
2747
  };
2746
2748
  /** on is a bool */
2747
2749
  Item.prototype.updateHighlight = function () {
@@ -14095,7 +14097,7 @@
14095
14097
  });
14096
14098
  };
14097
14099
  WallItem.prototype.setYPositionBasedOnElevation = function () {
14098
- this.position.y = this.elevation + this.halfSize.y;
14100
+ this.position.y = this.elevation + (this.halfSize ? this.halfSize.y : 0);
14099
14101
  };
14100
14102
  WallItem.prototype.addMaterialMap = function (material, texture, flip) {
14101
14103
  return __awaiter$17(this, void 0, void 0, function () {
@@ -14547,6 +14549,7 @@
14547
14549
  var clone = this.createClass();
14548
14550
  this.cloneProperties(clone);
14549
14551
  clone.name = 'test clone';
14552
+ clone.buildFinished();
14550
14553
  return clone;
14551
14554
  };
14552
14555
  InWallItem.prototype.createMaterial = function (side, isSame) {
@@ -14921,6 +14924,7 @@
14921
14924
  }
14922
14925
  InWallFloorItem.prototype.createClass = function () {
14923
14926
  var clazz = new InWallFloorItem(this.metadata, new THREE.Mesh(new THREE.BoxGeometry(this.halfSize.x * 2, this.halfSize.y * 2, this.halfSize.z * 2)));
14927
+ clazz.buildFinished();
14924
14928
  return clazz;
14925
14929
  };
14926
14930
  return InWallFloorItem;
@@ -15029,6 +15033,7 @@
15029
15033
  var metadata = Object.assign({}, this.metadata);
15030
15034
  metadata.skin = Object.assign({}, this.skin);
15031
15035
  var copy = new CustomShapeFloorItem(metadata, new THREE.Mesh(this.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z), materialsCloned));
15036
+ copy.buildFinished();
15032
15037
  copy.scaleGeometry(this.scale.x, this.scale.y, this.scale.z);
15033
15038
  copy.calculateHalfSize();
15034
15039
  return copy;
@@ -15094,6 +15099,7 @@
15094
15099
  var metadata = Object.assign({}, this.metadata);
15095
15100
  metadata.skin = Object.assign({}, this.skin);
15096
15101
  var copy = new CustomCylinderFloorItem(metadata, new THREE.Mesh(this.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z), materialsCloned));
15102
+ copy.buildFinished();
15097
15103
  copy.scaleGeometry(this.scale.x, this.scale.y, this.scale.z);
15098
15104
  copy.calculateHalfSize();
15099
15105
  return copy;
@@ -20386,6 +20392,9 @@
20386
20392
  case 1:
20387
20393
  _a.sent();
20388
20394
  this.walls.forEach(function (wall) { return wall.updateWallItems(); });
20395
+ if (this.walls && this.walls.length > 0 && this._viewModeService.is3dViewActive()) {
20396
+ this._updateEdgeVisibility(this._cameraService.camera.position);
20397
+ }
20389
20398
  return [2 /*return*/];
20390
20399
  }
20391
20400
  });
@@ -21943,6 +21952,7 @@
21943
21952
  var metadata = Object.assign({}, this.metadata);
21944
21953
  metadata.skin = Object.assign({}, this.skin);
21945
21954
  var copy = new CustomShapeWallItem(metadata, new THREE.Mesh(this.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z), materialsCloned));
21955
+ copy.buildFinished();
21946
21956
  copy.scaleGeometry(this.scale.x, this.scale.y, this.scale.z);
21947
21957
  copy.calculateHalfSize();
21948
21958
  return copy;
@@ -22002,6 +22012,7 @@
22002
22012
  var metadata = Object.assign({}, this.metadata);
22003
22013
  metadata.skin = Object.assign({}, this.skin);
22004
22014
  var copy = new CustomCylinderWallItem(metadata, new THREE.Mesh(this.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z), materialsCloned));
22015
+ copy.buildFinished();
22005
22016
  copy.scaleGeometry(this.scale.x, this.scale.y, this.scale.z);
22006
22017
  copy.calculateHalfSize();
22007
22018
  return copy;
@@ -23650,7 +23661,7 @@
23650
23661
  }
23651
23662
  };
23652
23663
  OnWallMeasurements.prototype.getZPos = function () {
23653
- return Math.max(this.item.getHalfSize().z, this.wallThickness / 2);
23664
+ return Math.max(this.item.getHalfSize().z, this.wallThickness / 2) + 0.05;
23654
23665
  };
23655
23666
  OnWallMeasurements.prototype.hasChanged = function () {
23656
23667
  return this.rotationY !== this.item.rotation.y ||
@@ -42862,17 +42873,21 @@
42862
42873
  this.isFloorType = !this.isFloorType;
42863
42874
  var origScale = new THREE.Vector3(1, 1, 1).divide(this.shape.metadata.scale || new THREE.Vector3(1, 1, 1));
42864
42875
  if (this.isFloorType) {
42876
+ this._oldWallPosition = this.shape.position.clone();
42877
+ this._oldWallElevation = this.shape.elevation;
42865
42878
  var metadata = Object.assign(Object.assign({}, this.shape.metadata), { itemType: ItemType.CustomShape });
42866
- metadata.position = undefined;
42879
+ metadata.position = this._oldFloorPosition ? this._oldFloorPosition.clone() : undefined;
42880
+ metadata.elevation = this._oldFloorElevation ? this._oldFloorElevation : 0;
42867
42881
  metadata.centerPivot = true;
42868
42882
  var geometry = this.shape.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z);
42869
42883
  var shapeFloor = new CustomShapeFloorItem(metadata, new THREE.Mesh(geometry, this.shape.customMesh.material));
42884
+ shapeFloor.buildFinished();
42870
42885
  shapeFloor.scaleGeometry(this.shape.scale.x, this.shape.scale.y, this.shape.scale.z);
42871
42886
  shapeFloor.calculateHalfSize();
42872
42887
  shapeFloor.skin = this.shape.skin;
42873
42888
  var roomCenter = this._roomService.getRoomCenter();
42874
42889
  if (roomCenter) {
42875
- shapeFloor.position.copy(roomCenter);
42890
+ shapeFloor.position.copy(this._oldFloorPosition ? this._oldFloorPosition.clone() : roomCenter);
42876
42891
  }
42877
42892
  shapeFloor.position.y = shapeFloor.getFloorY();
42878
42893
  this._itemService.addItem(shapeFloor);
@@ -42882,11 +42897,14 @@
42882
42897
  this._hudService.updateSelectedItemHud();
42883
42898
  }
42884
42899
  else {
42900
+ this._oldFloorPosition = this.shape.position.clone();
42901
+ this._oldFloorElevation = this.shape.elevation;
42885
42902
  var metadata = Object.assign(Object.assign({}, this.shape.metadata), { itemType: ItemType.CustomShapeWall });
42886
- metadata.position = undefined;
42903
+ metadata.position = this._oldWallPosition ? this._oldWallPosition.clone() : undefined;
42887
42904
  metadata.centerPivot = false;
42888
42905
  var geometry = this.shape.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z);
42889
42906
  var shapeWall = new CustomShapeWallItem(metadata, new THREE.Mesh(geometry, this.shape.customMesh.material));
42907
+ shapeWall.buildFinished();
42890
42908
  shapeWall.scaleGeometry(this.shape.scale.x, this.shape.scale.y, this.shape.scale.z);
42891
42909
  shapeWall.calculateHalfSize();
42892
42910
  shapeWall.skin = this.shape.skin;
@@ -43159,6 +43177,7 @@
43159
43177
  var geometry = this.shape.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z);
43160
43178
  geometry.rotateX(-Math.PI / 2);
43161
43179
  var shapeFloor = new CustomCylinderFloorItem(metadata, new THREE.Mesh(geometry, this.shape.customMesh.material));
43180
+ shapeFloor.buildFinished();
43162
43181
  shapeFloor.scaleGeometry(this.shape.scale.x, this.shape.scale.y, this.shape.scale.z);
43163
43182
  shapeFloor.calculateHalfSize();
43164
43183
  shapeFloor.skin = this.shape.skin;
@@ -43180,6 +43199,7 @@
43180
43199
  var position = this.shape.position.clone();
43181
43200
  var geometry = this.shape.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z);
43182
43201
  var shapeWall = new CustomCylinderWallItem(metadata, new THREE.Mesh(geometry, this.shape.customMesh.material));
43202
+ shapeWall.buildFinished();
43183
43203
  shapeWall.scaleGeometry(this.shape.scale.x, this.shape.scale.y, this.shape.scale.z);
43184
43204
  shapeWall.customMesh.geometry.rotateX(Math.PI / 2);
43185
43205
  shapeWall.calculateHalfSize();
@@ -45277,6 +45297,7 @@
45277
45297
  itemSelected: this.itemSelected.bind(this),
45278
45298
  itemUnselected: this.itemUnselected.bind(this)
45279
45299
  });
45300
+ item.buildFinished();
45280
45301
  this._itemService.addItem(item);
45281
45302
  return [2 /*return*/, item];
45282
45303
  }
@@ -45389,6 +45410,7 @@
45389
45410
  };
45390
45411
  metadata.scale = model.scale;
45391
45412
  item = new FloorItem(metadata, model.object, null, handlers);
45413
+ item.buildFinished();
45392
45414
  if (object.itemGroup) {
45393
45415
  this._groupService.reattachToItemGroup(item, object.itemGroup, position);
45394
45416
  }
@@ -45434,6 +45456,7 @@
45434
45456
  return [7 /*endfinally*/];
45435
45457
  case 12:
45436
45458
  item = new CustomShapeFloorItem(metadata, new THREE.Mesh(geometry, materials), object.texture);
45459
+ item.buildFinished();
45437
45460
  if (object.itemGroup) {
45438
45461
  this._groupService.reattachToItemGroup(item, object.itemGroup, position);
45439
45462
  }
@@ -45473,6 +45496,7 @@
45473
45496
  return [7 /*endfinally*/];
45474
45497
  case 21:
45475
45498
  item = new CustomShapeWallItem(metadata, new THREE.Mesh(geometry, materials), object.texture);
45499
+ item.buildFinished();
45476
45500
  closestWallEdge = this._roomService.getClosestWallEdge(position.x, position.z);
45477
45501
  item.placeOnEdge(closestWallEdge);
45478
45502
  if (object.itemGroup) {
@@ -45514,6 +45538,7 @@
45514
45538
  return [7 /*endfinally*/];
45515
45539
  case 30:
45516
45540
  item = new CustomCylinderFloorItem(metadata, new THREE.Mesh(geometry, materials), object.texture);
45541
+ item.buildFinished();
45517
45542
  if (object.itemGroup) {
45518
45543
  this._groupService.reattachToItemGroup(item, object.itemGroup, position);
45519
45544
  }
@@ -45554,6 +45579,7 @@
45554
45579
  return [7 /*endfinally*/];
45555
45580
  case 39:
45556
45581
  item = new CustomCylinderWallItem(metadata, new THREE.Mesh(geometry, materials), object.texture);
45582
+ item.buildFinished();
45557
45583
  closestWallEdge = this._roomService.getClosestWallEdge(position.x, position.z);
45558
45584
  item.placeOnEdge(closestWallEdge);
45559
45585
  if (object.itemGroup) {