@smarterplan/ngx-smarterplan-core 1.2.37 → 1.2.39
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/esm2020/lib/services/matterport.service.mjs +28 -10
- package/fesm2015/smarterplan-ngx-smarterplan-core.mjs +27 -9
- package/fesm2015/smarterplan-ngx-smarterplan-core.mjs.map +1 -1
- package/fesm2020/smarterplan-ngx-smarterplan-core.mjs +27 -9
- package/fesm2020/smarterplan-ngx-smarterplan-core.mjs.map +1 -1
- package/lib/services/matterport.service.d.ts +1 -1
- package/package.json +1 -1
|
@@ -3480,7 +3480,17 @@ class MatterportService {
|
|
|
3480
3480
|
});
|
|
3481
3481
|
}
|
|
3482
3482
|
getObject3DModelNodeFromDictionnary(uuid) {
|
|
3483
|
-
|
|
3483
|
+
let obj = this.dictionnaryObjects3D.get(uuid);
|
|
3484
|
+
if (!obj) {
|
|
3485
|
+
console.log("weird thing again");
|
|
3486
|
+
return null;
|
|
3487
|
+
}
|
|
3488
|
+
//might break things or fix everything ..?
|
|
3489
|
+
if (obj.obj3D.uuid != uuid) {
|
|
3490
|
+
console.log("we have THE problem");
|
|
3491
|
+
obj.obj3D.uuid = uuid; //not enugh to fix the pb
|
|
3492
|
+
}
|
|
3493
|
+
return obj;
|
|
3484
3494
|
}
|
|
3485
3495
|
/**
|
|
3486
3496
|
* Creates MattertagData and start repositioning (creates temporary mattertag that follows the cursor)
|
|
@@ -4015,7 +4025,7 @@ class MatterportService {
|
|
|
4015
4025
|
// By defaut, during creation, object has translation gizmo
|
|
4016
4026
|
// => User has to click on lateral panel, and save its position after playing with it!
|
|
4017
4027
|
if (mode && !isNestThermostat) {
|
|
4018
|
-
this.attachGizmoControlTo3DObject(modelNode, sceneObject, mode, true).catch((e) => console.log(e));
|
|
4028
|
+
this.attachGizmoControlTo3DObject(modelNode, sceneObject, mode, true, true).catch((e) => console.log(e));
|
|
4019
4029
|
}
|
|
4020
4030
|
if (this.lastObject3D && typeof this.lastObject3D.id === 'string') {
|
|
4021
4031
|
// prompt ThreeJS UUID to match our last generated object if new (not from Db)
|
|
@@ -4159,7 +4169,7 @@ class MatterportService {
|
|
|
4159
4169
|
}
|
|
4160
4170
|
});
|
|
4161
4171
|
}
|
|
4162
|
-
attachGizmoControlTo3DObject(modelNode, sceneObject, mode, visible) {
|
|
4172
|
+
attachGizmoControlTo3DObject(modelNode, sceneObject, mode, visible, isNewObject) {
|
|
4163
4173
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4164
4174
|
// Create a scene node with a transform control component.
|
|
4165
4175
|
let node = null;
|
|
@@ -4180,13 +4190,21 @@ class MatterportService {
|
|
|
4180
4190
|
// // set 'translate' mode to position the selection.
|
|
4181
4191
|
myControl.inputs.mode = mode;
|
|
4182
4192
|
modelNode.obj3D.controls = myControl; // store gizmoCtrl inside object
|
|
4183
|
-
if (
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4193
|
+
if (isNewObject) { //i keep the current solution for new objects
|
|
4194
|
+
if (!this.lastObject3D || !this.lastObject3D.controls) {
|
|
4195
|
+
try {
|
|
4196
|
+
modelNode.obj3D.uuid = this.lastObject3D.uuid || this.lastObject3D.id;
|
|
4197
|
+
}
|
|
4198
|
+
catch (e) {
|
|
4199
|
+
console.log(`id obj in Scene was not assigned to id from DB since`);
|
|
4200
|
+
}
|
|
4201
|
+
this.lastObject3D = modelNode.obj3D;
|
|
4189
4202
|
}
|
|
4203
|
+
}
|
|
4204
|
+
else { //objects already in place have to become the "lastObject" (i think?)
|
|
4205
|
+
console.log("in my solution !");
|
|
4206
|
+
console.log(modelNode);
|
|
4207
|
+
console.log(modelNode.obj3D.uuid);
|
|
4190
4208
|
this.lastObject3D = modelNode.obj3D;
|
|
4191
4209
|
}
|
|
4192
4210
|
return modelNode;
|