@smarterplan/ngx-smarterplan-core 1.2.34 → 1.2.36
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 +37 -6
- package/fesm2015/smarterplan-ngx-smarterplan-core.mjs +37 -5
- package/fesm2015/smarterplan-ngx-smarterplan-core.mjs.map +1 -1
- package/fesm2020/smarterplan-ngx-smarterplan-core.mjs +35 -5
- package/fesm2020/smarterplan-ngx-smarterplan-core.mjs.map +1 -1
- package/lib/services/matterport.service.d.ts +1 -0
- package/package.json +1 -1
|
@@ -3908,9 +3908,9 @@ class MatterportService {
|
|
|
3908
3908
|
var node = sceneObject.addNode();
|
|
3909
3909
|
// TODO change this 🤮
|
|
3910
3910
|
node.addComponent('mp.lights');
|
|
3911
|
-
node.addComponent('mp.lights');
|
|
3912
|
-
node.addComponent('mp.lights');
|
|
3913
|
-
node.addComponent('mp.lights')
|
|
3911
|
+
//node.addComponent('mp.lights');
|
|
3912
|
+
/*node.addComponent('mp.lights');
|
|
3913
|
+
node.addComponent('mp.lights');*/
|
|
3914
3914
|
node.start();
|
|
3915
3915
|
const nodeControl = sceneObject.addNode();
|
|
3916
3916
|
this.objectControl = nodeControl.addComponent('mp.transformControls');
|
|
@@ -3983,6 +3983,16 @@ class MatterportService {
|
|
|
3983
3983
|
console.log('Format not supported');
|
|
3984
3984
|
break;
|
|
3985
3985
|
}
|
|
3986
|
+
//cache system (i'll try to make it work later ...)
|
|
3987
|
+
/*let objContentsJSON = JSON.stringify(modelNode);
|
|
3988
|
+
console.log(modelNode);
|
|
3989
|
+
console.log(objContentsJSON);
|
|
3990
|
+
console.log(JSON.stringify(modelNode));
|
|
3991
|
+
localStorage.setItem(`testObj_${obj.object}`, objContentsJSON);
|
|
3992
|
+
console.log("stored ?!");
|
|
3993
|
+
console.log(typeof modelNode);*/
|
|
3994
|
+
//let dataS = serialijse.serialize(modelNode);
|
|
3995
|
+
//console.log(dataS);
|
|
3986
3996
|
// Use 3 ?! Ambient lightings
|
|
3987
3997
|
if (this.noLightForObjects) {
|
|
3988
3998
|
const lightsNode = sceneObject.addNode();
|
|
@@ -4016,8 +4026,8 @@ class MatterportService {
|
|
|
4016
4026
|
}
|
|
4017
4027
|
this.lastObject3D = modelNode.obj3D;
|
|
4018
4028
|
// Store this in memory Map dictionnary
|
|
4019
|
-
console.log("Adding object: ");
|
|
4020
|
-
console.log(modelNode);
|
|
4029
|
+
//console.log("Adding object: ");
|
|
4030
|
+
//console.log(modelNode);
|
|
4021
4031
|
this.dictionnaryObjects3D.set(modelNode.obj3D.uuid, modelNode);
|
|
4022
4032
|
this.dictionnarySceneObjects3D.set(modelNode.obj3D.uuid, sceneObject);
|
|
4023
4033
|
/*this.sdk.Camera.pose.subscribe(
|
|
@@ -4114,6 +4124,28 @@ class MatterportService {
|
|
|
4114
4124
|
obj.obj3D.visible = !obj.obj3D.visible;
|
|
4115
4125
|
//return obj.obj3D.visible;
|
|
4116
4126
|
}
|
|
4127
|
+
pointCameraTo3DObject(objectId) {
|
|
4128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4129
|
+
let obj = this.dictionnaryObjects3D.get(objectId);
|
|
4130
|
+
//We create a temporary Tag
|
|
4131
|
+
const poiObject = {
|
|
4132
|
+
coordinate: JSON.stringify(obj.obj3D.position),
|
|
4133
|
+
type: PoiType.OBJECT3D,
|
|
4134
|
+
elementID: objectId, //todo: be careful with this
|
|
4135
|
+
};
|
|
4136
|
+
const objectDb = { id: objectId };
|
|
4137
|
+
try {
|
|
4138
|
+
yield this.createMattertagFromPOI(PoiType.OBJECT3D, objectDb, poiObject);
|
|
4139
|
+
}
|
|
4140
|
+
catch (err) { }
|
|
4141
|
+
//Not really necessary anymore since the tag will disappear quick
|
|
4142
|
+
//this.sdk.Tag.editOpacity(mattertagID, 0.0);//opacity);
|
|
4143
|
+
//this.sdk.Tag.allowAction(mattertagID, {}); //disables every action
|
|
4144
|
+
let result = this.getTagFromElementId(objectId);
|
|
4145
|
+
yield this.goToTag(result.tag);
|
|
4146
|
+
this.deleteLastMattertag();
|
|
4147
|
+
});
|
|
4148
|
+
}
|
|
4117
4149
|
getSceneNodeFromObject3DId(uuid) {
|
|
4118
4150
|
return this.dictionnarySceneObjects3D.get(uuid);
|
|
4119
4151
|
}
|