@colijnit/homedecorator 259.1.6 → 259.1.8
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.
- package/app/plugins/core3d/items/item.d.ts +2 -0
- package/app/plugins/core3d/items/wall-objects.d.ts +1 -0
- package/app/plugins/room-planner/components/custome-shape-creator/custom-shape-creator.component.d.ts +4 -0
- package/bundles/colijnit-homedecorator.umd.js +92 -49
- package/bundles/colijnit-homedecorator.umd.js.map +1 -1
- package/esm2015/app/core/service/presets.service.js +1 -1
- package/esm2015/app/plugins/core3d/hud/bounding-measurement-box/door-or-window-box-measurement.js +4 -4
- package/esm2015/app/plugins/core3d/hud/on-wall-measurements.js +2 -2
- package/esm2015/app/plugins/core3d/items/base-item.js +4 -2
- package/esm2015/app/plugins/core3d/items/custom-cylinder-floor-item.js +2 -1
- package/esm2015/app/plugins/core3d/items/custom-cylinder-wall-item.js +2 -1
- package/esm2015/app/plugins/core3d/items/custom-shape-floor-item.js +2 -1
- package/esm2015/app/plugins/core3d/items/custom-shape-wall-item.js +2 -1
- package/esm2015/app/plugins/core3d/items/in-wall-floor-item.js +2 -1
- package/esm2015/app/plugins/core3d/items/item.js +45 -41
- package/esm2015/app/plugins/core3d/items/wall-objects.js +12 -2
- package/esm2015/app/plugins/core3d/service/item.service.js +3 -1
- package/esm2015/app/plugins/furniture-manager/furniture-manager/furniture-manager.component.js +7 -1
- package/esm2015/app/plugins/room-planner/components/custom-cylinder-creator/custom-cylinder-creator.component.js +3 -1
- package/esm2015/app/plugins/room-planner/components/custome-shape-creator/custom-shape-creator.component.js +11 -4
- package/esm2015/app/plugins/room-planner/components/floorplanner/service/room.service.js +4 -1
- package/esm2015/app/plugins/threedselector/threedselector/service/third-party-model.service.js +2 -1
- package/fesm2015/colijnit-homedecorator.js +91 -49
- package/fesm2015/colijnit-homedecorator.js.map +1 -1
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ import { ChildParams } from '../../../core/interface/child-params.interface';
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class Item extends BaseItem {
|
|
14
14
|
rawMetadata: Metadata;
|
|
15
|
+
private _metadataSet;
|
|
15
16
|
set allwaysConfigureMode(value: boolean);
|
|
16
17
|
get allwaysConfigureMode(): boolean;
|
|
17
18
|
set configuring(value: boolean);
|
|
@@ -74,6 +75,7 @@ export declare class Item extends BaseItem {
|
|
|
74
75
|
endDrag(): void;
|
|
75
76
|
initObject(itemType: any, id: string, identifier: string, modelUrl: any): void;
|
|
76
77
|
getHalfSize(): Vector3;
|
|
78
|
+
protected handleRawMetadata(): void;
|
|
77
79
|
/** on is a bool */
|
|
78
80
|
protected updateHighlight(): void;
|
|
79
81
|
/** */
|
|
@@ -410,6 +410,7 @@ export declare abstract class WallItem extends Item {
|
|
|
410
410
|
updateMaterialVisibility(side?: number): void;
|
|
411
411
|
createTextureMaterial(options?: any): Promise<THREE.MeshPhongMaterial>;
|
|
412
412
|
getTexture(): Texture;
|
|
413
|
+
setScaleXYZ(x: number, y: number, z: number, recalculateHalfSize?: boolean): void;
|
|
413
414
|
protected createMaterial(side?: number, isSame?: boolean): Promise<void>;
|
|
414
415
|
protected setYPositionBasedOnElevation(): void;
|
|
415
416
|
protected addMaterialMap(material: THREE.MeshPhongMaterial, texture: Texture, flip: boolean): Promise<void>;
|
|
@@ -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
|
-
|
|
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) {
|
|
@@ -2439,6 +2441,7 @@
|
|
|
2439
2441
|
function Item(rawMetadata, object, texture, handlers) {
|
|
2440
2442
|
var _this = _super.call(this, rawMetadata, object, texture) || this;
|
|
2441
2443
|
_this.rawMetadata = rawMetadata;
|
|
2444
|
+
_this._metadataSet = false;
|
|
2442
2445
|
_this.obsolete = false;
|
|
2443
2446
|
_this.highLightDisabled = false;
|
|
2444
2447
|
_this.originalLength = 0;
|
|
@@ -2487,46 +2490,9 @@
|
|
|
2487
2490
|
_this.addChild(child);
|
|
2488
2491
|
});
|
|
2489
2492
|
}
|
|
2490
|
-
if (rawMetadata && rawMetadata.scale != null) {
|
|
2491
|
-
if (_this.canScaleX || _this.canScaleY || _this.canScaleZ) {
|
|
2492
|
-
_this._shouldSetScale = true;
|
|
2493
|
-
}
|
|
2494
|
-
else {
|
|
2495
|
-
_this.scaleGeometry(rawMetadata.scale.x, rawMetadata.scale.y, rawMetadata.scale.z);
|
|
2496
|
-
}
|
|
2497
|
-
}
|
|
2498
|
-
if (_this.scalePercentage !== 100) {
|
|
2499
|
-
_this.scale.set(_this.scalePercentage / 100, _this.scalePercentage / 100, _this.scalePercentage / 100);
|
|
2500
|
-
}
|
|
2501
|
-
_this.calculateHalfSize();
|
|
2502
2493
|
if (_this.usePivot) {
|
|
2503
2494
|
_this.updatePivot(_this.updatePivotOnCreate);
|
|
2504
2495
|
}
|
|
2505
|
-
if (rawMetadata) {
|
|
2506
|
-
_this.initObject(rawMetadata.itemType, rawMetadata.itemId, rawMetadata.itemIdentifier, rawMetadata.modelUrl);
|
|
2507
|
-
if (rawMetadata.position) {
|
|
2508
|
-
_this.position.copy(rawMetadata.position);
|
|
2509
|
-
_this.positionSet = true;
|
|
2510
|
-
}
|
|
2511
|
-
else {
|
|
2512
|
-
_this.positionSet = false;
|
|
2513
|
-
}
|
|
2514
|
-
if (rawMetadata.elevation) {
|
|
2515
|
-
_this.elevation = rawMetadata.elevation;
|
|
2516
|
-
_this.setYPositionBasedOnElevation();
|
|
2517
|
-
}
|
|
2518
|
-
else {
|
|
2519
|
-
_this.elevation = 0;
|
|
2520
|
-
}
|
|
2521
|
-
if (rawMetadata.rotation) {
|
|
2522
|
-
if (rawMetadata.rotation instanceof THREE.Euler) {
|
|
2523
|
-
_this.rotation.set(rawMetadata.rotation.x, rawMetadata.rotation.y, rawMetadata.rotation.z);
|
|
2524
|
-
}
|
|
2525
|
-
else {
|
|
2526
|
-
_this.rotation.y = rawMetadata.rotation || 0;
|
|
2527
|
-
}
|
|
2528
|
-
}
|
|
2529
|
-
}
|
|
2530
2496
|
// this.add(new AxesHelper(2));
|
|
2531
2497
|
_this._setOriginals();
|
|
2532
2498
|
return _this;
|
|
@@ -2597,6 +2563,7 @@
|
|
|
2597
2563
|
};
|
|
2598
2564
|
Item.prototype.buildFinished = function () {
|
|
2599
2565
|
_super.prototype.buildFinished.call(this);
|
|
2566
|
+
this.handleRawMetadata();
|
|
2600
2567
|
// If it's possible to change materials then we need to store the original item
|
|
2601
2568
|
// This way when we save the project we can do a diff on the materials and store
|
|
2602
2569
|
// changes instead of the whole material
|
|
@@ -2606,9 +2573,6 @@
|
|
|
2606
2573
|
}
|
|
2607
2574
|
this.originalItem = ObjectUtils.DeepCloneObject3D(this);
|
|
2608
2575
|
}
|
|
2609
|
-
if (this._shouldSetScale) {
|
|
2610
|
-
this.setScaleXYZ(this.rawMetadata.scale.x, this.rawMetadata.scale.y, this.rawMetadata.scale.z);
|
|
2611
|
-
}
|
|
2612
2576
|
};
|
|
2613
2577
|
Item.prototype.connectorFromElement = function (selection) {
|
|
2614
2578
|
var id = this._getIdentifierFromSelection(selection);
|
|
@@ -2741,6 +2705,48 @@
|
|
|
2741
2705
|
Item.prototype.getHalfSize = function () {
|
|
2742
2706
|
return this.halfSize.clone();
|
|
2743
2707
|
};
|
|
2708
|
+
Item.prototype.handleRawMetadata = function () {
|
|
2709
|
+
var rawMetadata = this.rawMetadata;
|
|
2710
|
+
if (rawMetadata && !this._metadataSet) {
|
|
2711
|
+
this.initObject(rawMetadata.itemType, rawMetadata.itemId, rawMetadata.itemIdentifier, rawMetadata.modelUrl);
|
|
2712
|
+
if (rawMetadata.rotation) {
|
|
2713
|
+
if (rawMetadata.rotation instanceof THREE.Euler) {
|
|
2714
|
+
this.rotation.set(rawMetadata.rotation.x, rawMetadata.rotation.y, rawMetadata.rotation.z);
|
|
2715
|
+
}
|
|
2716
|
+
else {
|
|
2717
|
+
this.rotation.y = rawMetadata.rotation || 0;
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
if (rawMetadata.position) {
|
|
2721
|
+
this.position.copy(rawMetadata.position);
|
|
2722
|
+
this.positionSet = true;
|
|
2723
|
+
}
|
|
2724
|
+
else {
|
|
2725
|
+
this.positionSet = false;
|
|
2726
|
+
}
|
|
2727
|
+
if (rawMetadata.scale) {
|
|
2728
|
+
if (this.canScaleX || this.canScaleY || this.canScaleZ) {
|
|
2729
|
+
this.setScaleXYZ(this.rawMetadata.scale.x, this.rawMetadata.scale.y, this.rawMetadata.scale.z);
|
|
2730
|
+
// this._shouldSetScale = true;
|
|
2731
|
+
}
|
|
2732
|
+
else {
|
|
2733
|
+
this.scaleGeometry(rawMetadata.scale.x, rawMetadata.scale.y, rawMetadata.scale.z);
|
|
2734
|
+
}
|
|
2735
|
+
}
|
|
2736
|
+
if (this.scalePercentage !== 100) {
|
|
2737
|
+
this.scale.set(this.scalePercentage / 100, this.scalePercentage / 100, this.scalePercentage / 100);
|
|
2738
|
+
}
|
|
2739
|
+
if (rawMetadata.elevation) {
|
|
2740
|
+
this.elevation = rawMetadata.elevation;
|
|
2741
|
+
}
|
|
2742
|
+
else {
|
|
2743
|
+
this.elevation = 0;
|
|
2744
|
+
}
|
|
2745
|
+
this._metadataSet = true;
|
|
2746
|
+
}
|
|
2747
|
+
this.calculateHalfSize();
|
|
2748
|
+
this.setYPositionBasedOnElevation();
|
|
2749
|
+
};
|
|
2744
2750
|
/** on is a bool */
|
|
2745
2751
|
Item.prototype.updateHighlight = function () {
|
|
2746
2752
|
if (this.highLightDisabled) {
|
|
@@ -13968,6 +13974,11 @@
|
|
|
13968
13974
|
WallItem.prototype.getTexture = function () {
|
|
13969
13975
|
return this.texture;
|
|
13970
13976
|
};
|
|
13977
|
+
WallItem.prototype.setScaleXYZ = function (x, y, z, recalculateHalfSize) {
|
|
13978
|
+
if (recalculateHalfSize === void 0) { recalculateHalfSize = true; }
|
|
13979
|
+
_super_1.prototype.setScaleXYZ.call(this, x, y, z, recalculateHalfSize);
|
|
13980
|
+
this.reposition();
|
|
13981
|
+
};
|
|
13971
13982
|
WallItem.prototype.createMaterial = function (side, isSame) {
|
|
13972
13983
|
if (side === void 0) { side = THREE__namespace.DoubleSide; }
|
|
13973
13984
|
if (isSame === void 0) { isSame = true; }
|
|
@@ -14026,7 +14037,9 @@
|
|
|
14026
14037
|
});
|
|
14027
14038
|
};
|
|
14028
14039
|
WallItem.prototype.setYPositionBasedOnElevation = function () {
|
|
14029
|
-
|
|
14040
|
+
if (this.boundToFloor) {
|
|
14041
|
+
this.position.y = this.elevation + (this.halfSize ? this.halfSize.y : 0);
|
|
14042
|
+
}
|
|
14030
14043
|
};
|
|
14031
14044
|
WallItem.prototype.addMaterialMap = function (material, texture, flip) {
|
|
14032
14045
|
return __awaiter$1c(this, void 0, void 0, function () {
|
|
@@ -14145,6 +14158,9 @@
|
|
|
14145
14158
|
/** takes the move vec3, and makes sure object stays bounded on plane */
|
|
14146
14159
|
WallItem.prototype._boundMove = function (vec3) {
|
|
14147
14160
|
var edge = this.currentWallEdge;
|
|
14161
|
+
if (!edge) {
|
|
14162
|
+
return;
|
|
14163
|
+
}
|
|
14148
14164
|
vec3.applyMatrix4(edge.interiorTransform);
|
|
14149
14165
|
edge.wall.itemsChanged = true;
|
|
14150
14166
|
if (vec3.x < this._sizeX / 2.0 + this._positionYTolerance) {
|
|
@@ -14475,6 +14491,7 @@
|
|
|
14475
14491
|
var clone = this.createClass();
|
|
14476
14492
|
this.cloneProperties(clone);
|
|
14477
14493
|
clone.name = 'test clone';
|
|
14494
|
+
clone.buildFinished();
|
|
14478
14495
|
return clone;
|
|
14479
14496
|
};
|
|
14480
14497
|
InWallItem.prototype.createMaterial = function (side, isSame) {
|
|
@@ -14849,6 +14866,7 @@
|
|
|
14849
14866
|
}
|
|
14850
14867
|
InWallFloorItem.prototype.createClass = function () {
|
|
14851
14868
|
var clazz = new InWallFloorItem(this.metadata, new THREE.Mesh(new THREE.BoxGeometry(this.halfSize.x * 2, this.halfSize.y * 2, this.halfSize.z * 2)));
|
|
14869
|
+
clazz.buildFinished();
|
|
14852
14870
|
return clazz;
|
|
14853
14871
|
};
|
|
14854
14872
|
return InWallFloorItem;
|
|
@@ -14957,6 +14975,7 @@
|
|
|
14957
14975
|
var metadata = Object.assign({}, this.metadata);
|
|
14958
14976
|
metadata.skin = Object.assign({}, this.skin);
|
|
14959
14977
|
var copy = new CustomShapeFloorItem(metadata, new THREE.Mesh(this.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z), materialsCloned));
|
|
14978
|
+
copy.buildFinished();
|
|
14960
14979
|
copy.scaleGeometry(this.scale.x, this.scale.y, this.scale.z);
|
|
14961
14980
|
copy.calculateHalfSize();
|
|
14962
14981
|
return copy;
|
|
@@ -15022,6 +15041,7 @@
|
|
|
15022
15041
|
var metadata = Object.assign({}, this.metadata);
|
|
15023
15042
|
metadata.skin = Object.assign({}, this.skin);
|
|
15024
15043
|
var copy = new CustomCylinderFloorItem(metadata, new THREE.Mesh(this.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z), materialsCloned));
|
|
15044
|
+
copy.buildFinished();
|
|
15025
15045
|
copy.scaleGeometry(this.scale.x, this.scale.y, this.scale.z);
|
|
15026
15046
|
copy.calculateHalfSize();
|
|
15027
15047
|
return copy;
|
|
@@ -15423,6 +15443,7 @@
|
|
|
15423
15443
|
item.opening = Object.assign({}, metadata.opening);
|
|
15424
15444
|
}
|
|
15425
15445
|
item.userData.itemType = metadata.itemType;
|
|
15446
|
+
item.buildFinished();
|
|
15426
15447
|
this.addItem(item);
|
|
15427
15448
|
return item;
|
|
15428
15449
|
};
|
|
@@ -15460,6 +15481,7 @@
|
|
|
15460
15481
|
return [4 /*yield*/, new itemConstructor(metadata, modelData.object)];
|
|
15461
15482
|
case 1:
|
|
15462
15483
|
item = _a.sent();
|
|
15484
|
+
item.buildFinished();
|
|
15463
15485
|
this.addItem(item);
|
|
15464
15486
|
return [2 /*return*/, item];
|
|
15465
15487
|
}
|
|
@@ -20385,6 +20407,9 @@
|
|
|
20385
20407
|
case 1:
|
|
20386
20408
|
_a.sent();
|
|
20387
20409
|
this.walls.forEach(function (wall) { return wall.updateWallItems(); });
|
|
20410
|
+
if (this.walls && this.walls.length > 0 && this._viewModeService.is3dViewActive()) {
|
|
20411
|
+
this._updateEdgeVisibility(this._cameraService.camera.position);
|
|
20412
|
+
}
|
|
20388
20413
|
return [2 /*return*/];
|
|
20389
20414
|
}
|
|
20390
20415
|
});
|
|
@@ -21945,6 +21970,7 @@
|
|
|
21945
21970
|
var metadata = Object.assign({}, this.metadata);
|
|
21946
21971
|
metadata.skin = Object.assign({}, this.skin);
|
|
21947
21972
|
var copy = new CustomShapeWallItem(metadata, new THREE.Mesh(this.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z), materialsCloned));
|
|
21973
|
+
copy.buildFinished();
|
|
21948
21974
|
copy.scaleGeometry(this.scale.x, this.scale.y, this.scale.z);
|
|
21949
21975
|
copy.calculateHalfSize();
|
|
21950
21976
|
return copy;
|
|
@@ -22004,6 +22030,7 @@
|
|
|
22004
22030
|
var metadata = Object.assign({}, this.metadata);
|
|
22005
22031
|
metadata.skin = Object.assign({}, this.skin);
|
|
22006
22032
|
var copy = new CustomCylinderWallItem(metadata, new THREE.Mesh(this.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z), materialsCloned));
|
|
22033
|
+
copy.buildFinished();
|
|
22007
22034
|
copy.scaleGeometry(this.scale.x, this.scale.y, this.scale.z);
|
|
22008
22035
|
copy.calculateHalfSize();
|
|
22009
22036
|
return copy;
|
|
@@ -23025,7 +23052,7 @@
|
|
|
23025
23052
|
var height = new BoxMeasurement();
|
|
23026
23053
|
var heightString = MeasurementUtils.makeText(this._height, this.dimUnit, this.distanceStep);
|
|
23027
23054
|
var text = this._dictionaryService.get('LABEL_HEIGHT');
|
|
23028
|
-
height.textMesh = makeTextMesh(heightString, this._font, text);
|
|
23055
|
+
height.textMesh = makeTextMesh(heightString, this._font, 0xFF00FF, 0.08, false, false, text);
|
|
23029
23056
|
height.positions = this.calculateHeightPositions();
|
|
23030
23057
|
return height;
|
|
23031
23058
|
};
|
|
@@ -23042,7 +23069,7 @@
|
|
|
23042
23069
|
var width = new BoxMeasurement();
|
|
23043
23070
|
var widthString = MeasurementUtils.makeText(this._width, this.dimUnit, this.distanceStep);
|
|
23044
23071
|
var text = this._dictionaryService.get('LABEL_WIDTH');
|
|
23045
|
-
width.textMesh = makeTextMesh(widthString, this._font, text);
|
|
23072
|
+
width.textMesh = makeTextMesh(widthString, this._font, 0xFF00FF, 0.08, false, false, text);
|
|
23046
23073
|
width.positions = this.calculateWidthPositions();
|
|
23047
23074
|
return width;
|
|
23048
23075
|
};
|
|
@@ -23059,7 +23086,7 @@
|
|
|
23059
23086
|
var openingDepth = new BoxMeasurement();
|
|
23060
23087
|
var openingDepthString = MeasurementUtils.makeText(this._openingDepth, this.dimUnit, this.distanceStep);
|
|
23061
23088
|
var text = this._dictionaryService.get('LABEL_DEPTH');
|
|
23062
|
-
openingDepth.textMesh = makeTextMesh(openingDepthString, this._font, text);
|
|
23089
|
+
openingDepth.textMesh = makeTextMesh(openingDepthString, this._font, 0xFF00FF, 0.08, false, false, text);
|
|
23063
23090
|
openingDepth.positions = this.calculateOpeningDepthPositions();
|
|
23064
23091
|
return openingDepth;
|
|
23065
23092
|
};
|
|
@@ -23652,7 +23679,7 @@
|
|
|
23652
23679
|
}
|
|
23653
23680
|
};
|
|
23654
23681
|
OnWallMeasurements.prototype.getZPos = function () {
|
|
23655
|
-
return Math.max(this.item.getHalfSize().z, this.wallThickness / 2);
|
|
23682
|
+
return Math.max(this.item.getHalfSize().z, this.wallThickness / 2) + 0.05;
|
|
23656
23683
|
};
|
|
23657
23684
|
OnWallMeasurements.prototype.hasChanged = function () {
|
|
23658
23685
|
return this.rotationY !== this.item.rotation.y ||
|
|
@@ -33546,6 +33573,7 @@
|
|
|
33546
33573
|
}
|
|
33547
33574
|
item.allowRotate = true;
|
|
33548
33575
|
item.highLightDisabled = !this._settingsService.settings.options.useStandaloneHighLight;
|
|
33576
|
+
item.buildFinished();
|
|
33549
33577
|
newCustomFloorObj.furniture = item;
|
|
33550
33578
|
return newCustomFloorObj;
|
|
33551
33579
|
};
|
|
@@ -43501,17 +43529,21 @@
|
|
|
43501
43529
|
this.isFloorType = !this.isFloorType;
|
|
43502
43530
|
var origScale = new THREE.Vector3(1, 1, 1).divide(this.shape.metadata.scale || new THREE.Vector3(1, 1, 1));
|
|
43503
43531
|
if (this.isFloorType) {
|
|
43532
|
+
this._oldWallPosition = this.shape.position.clone();
|
|
43533
|
+
this._oldWallElevation = this.shape.elevation;
|
|
43504
43534
|
var metadata = Object.assign(Object.assign({}, this.shape.metadata), { itemType: ItemType.CustomShape });
|
|
43505
|
-
metadata.position = undefined;
|
|
43535
|
+
metadata.position = this._oldFloorPosition ? this._oldFloorPosition.clone() : undefined;
|
|
43536
|
+
metadata.elevation = this._oldFloorElevation ? this._oldFloorElevation : 0;
|
|
43506
43537
|
metadata.centerPivot = true;
|
|
43507
43538
|
var geometry = this.shape.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z);
|
|
43508
43539
|
var shapeFloor = new CustomShapeFloorItem(metadata, new THREE.Mesh(geometry, this.shape.customMesh.material));
|
|
43540
|
+
shapeFloor.buildFinished();
|
|
43509
43541
|
shapeFloor.scaleGeometry(this.shape.scale.x, this.shape.scale.y, this.shape.scale.z);
|
|
43510
43542
|
shapeFloor.calculateHalfSize();
|
|
43511
43543
|
shapeFloor.skin = this.shape.skin;
|
|
43512
43544
|
var roomCenter = this._roomService.getRoomCenter();
|
|
43513
43545
|
if (roomCenter) {
|
|
43514
|
-
shapeFloor.position.copy(roomCenter);
|
|
43546
|
+
shapeFloor.position.copy(this._oldFloorPosition ? this._oldFloorPosition.clone() : roomCenter);
|
|
43515
43547
|
}
|
|
43516
43548
|
shapeFloor.position.y = shapeFloor.getFloorY();
|
|
43517
43549
|
this._itemService.addItem(shapeFloor);
|
|
@@ -43521,11 +43553,14 @@
|
|
|
43521
43553
|
this._hudService.updateSelectedItemHud();
|
|
43522
43554
|
}
|
|
43523
43555
|
else {
|
|
43556
|
+
this._oldFloorPosition = this.shape.position.clone();
|
|
43557
|
+
this._oldFloorElevation = this.shape.elevation;
|
|
43524
43558
|
var metadata = Object.assign(Object.assign({}, this.shape.metadata), { itemType: ItemType.CustomShapeWall });
|
|
43525
|
-
metadata.position = undefined;
|
|
43559
|
+
metadata.position = this._oldWallPosition ? this._oldWallPosition.clone() : undefined;
|
|
43526
43560
|
metadata.centerPivot = false;
|
|
43527
43561
|
var geometry = this.shape.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z);
|
|
43528
43562
|
var shapeWall = new CustomShapeWallItem(metadata, new THREE.Mesh(geometry, this.shape.customMesh.material));
|
|
43563
|
+
shapeWall.buildFinished();
|
|
43529
43564
|
shapeWall.scaleGeometry(this.shape.scale.x, this.shape.scale.y, this.shape.scale.z);
|
|
43530
43565
|
shapeWall.calculateHalfSize();
|
|
43531
43566
|
shapeWall.skin = this.shape.skin;
|
|
@@ -43798,6 +43833,7 @@
|
|
|
43798
43833
|
var geometry = this.shape.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z);
|
|
43799
43834
|
geometry.rotateX(-Math.PI / 2);
|
|
43800
43835
|
var shapeFloor = new CustomCylinderFloorItem(metadata, new THREE.Mesh(geometry, this.shape.customMesh.material));
|
|
43836
|
+
shapeFloor.buildFinished();
|
|
43801
43837
|
shapeFloor.scaleGeometry(this.shape.scale.x, this.shape.scale.y, this.shape.scale.z);
|
|
43802
43838
|
shapeFloor.calculateHalfSize();
|
|
43803
43839
|
shapeFloor.skin = this.shape.skin;
|
|
@@ -43819,6 +43855,7 @@
|
|
|
43819
43855
|
var position = this.shape.position.clone();
|
|
43820
43856
|
var geometry = this.shape.customMesh.geometry.clone().scale(origScale.x, origScale.y, origScale.z);
|
|
43821
43857
|
var shapeWall = new CustomCylinderWallItem(metadata, new THREE.Mesh(geometry, this.shape.customMesh.material));
|
|
43858
|
+
shapeWall.buildFinished();
|
|
43822
43859
|
shapeWall.scaleGeometry(this.shape.scale.x, this.shape.scale.y, this.shape.scale.z);
|
|
43823
43860
|
shapeWall.customMesh.geometry.rotateX(Math.PI / 2);
|
|
43824
43861
|
shapeWall.calculateHalfSize();
|
|
@@ -45915,6 +45952,7 @@
|
|
|
45915
45952
|
itemSelected: this.itemSelected.bind(this),
|
|
45916
45953
|
itemUnselected: this.itemUnselected.bind(this)
|
|
45917
45954
|
});
|
|
45955
|
+
item.buildFinished();
|
|
45918
45956
|
this._itemService.addItem(item);
|
|
45919
45957
|
return [2 /*return*/, item];
|
|
45920
45958
|
}
|
|
@@ -46027,6 +46065,7 @@
|
|
|
46027
46065
|
};
|
|
46028
46066
|
metadata.scale = model.scale;
|
|
46029
46067
|
item = new FloorItem(metadata, model.object, null, handlers);
|
|
46068
|
+
item.buildFinished();
|
|
46030
46069
|
if (object.itemGroup) {
|
|
46031
46070
|
this._groupService.reattachToItemGroup(item, object.itemGroup, position);
|
|
46032
46071
|
}
|
|
@@ -46072,6 +46111,7 @@
|
|
|
46072
46111
|
return [7 /*endfinally*/];
|
|
46073
46112
|
case 12:
|
|
46074
46113
|
item = new CustomShapeFloorItem(metadata, new THREE.Mesh(geometry, materials), object.texture);
|
|
46114
|
+
item.buildFinished();
|
|
46075
46115
|
if (object.itemGroup) {
|
|
46076
46116
|
this._groupService.reattachToItemGroup(item, object.itemGroup, position);
|
|
46077
46117
|
}
|
|
@@ -46111,6 +46151,7 @@
|
|
|
46111
46151
|
return [7 /*endfinally*/];
|
|
46112
46152
|
case 21:
|
|
46113
46153
|
item = new CustomShapeWallItem(metadata, new THREE.Mesh(geometry, materials), object.texture);
|
|
46154
|
+
item.buildFinished();
|
|
46114
46155
|
closestWallEdge = this._roomService.getClosestWallEdge(position.x, position.z);
|
|
46115
46156
|
item.placeOnEdge(closestWallEdge);
|
|
46116
46157
|
if (object.itemGroup) {
|
|
@@ -46152,6 +46193,7 @@
|
|
|
46152
46193
|
return [7 /*endfinally*/];
|
|
46153
46194
|
case 30:
|
|
46154
46195
|
item = new CustomCylinderFloorItem(metadata, new THREE.Mesh(geometry, materials), object.texture);
|
|
46196
|
+
item.buildFinished();
|
|
46155
46197
|
if (object.itemGroup) {
|
|
46156
46198
|
this._groupService.reattachToItemGroup(item, object.itemGroup, position);
|
|
46157
46199
|
}
|
|
@@ -46192,6 +46234,7 @@
|
|
|
46192
46234
|
return [7 /*endfinally*/];
|
|
46193
46235
|
case 39:
|
|
46194
46236
|
item = new CustomCylinderWallItem(metadata, new THREE.Mesh(geometry, materials), object.texture);
|
|
46237
|
+
item.buildFinished();
|
|
46195
46238
|
closestWallEdge = this._roomService.getClosestWallEdge(position.x, position.z);
|
|
46196
46239
|
item.placeOnEdge(closestWallEdge);
|
|
46197
46240
|
if (object.itemGroup) {
|