@smarterplan/ngx-smarterplan-core 1.2.31 → 1.2.33
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 +35 -1
- package/fesm2015/smarterplan-ngx-smarterplan-core.mjs +36 -0
- package/fesm2015/smarterplan-ngx-smarterplan-core.mjs.map +1 -1
- package/fesm2020/smarterplan-ngx-smarterplan-core.mjs +34 -0
- package/fesm2020/smarterplan-ngx-smarterplan-core.mjs.map +1 -1
- package/lib/services/matterport.service.d.ts +3 -0
- package/package.json +1 -1
|
@@ -2610,6 +2610,7 @@ class MatterportService {
|
|
|
2610
2610
|
this.ngZone = ngZone;
|
|
2611
2611
|
this.slots = []; //SlotNode[] = [];
|
|
2612
2612
|
this.nodes = [];
|
|
2613
|
+
this.lastCameraPosition = { x: 0.0, y: 0.0, z: 0.0 };
|
|
2613
2614
|
this.cursorPositionButtonDisplayed = false;
|
|
2614
2615
|
// Measure mode
|
|
2615
2616
|
this.isMeasureModeOn = false;
|
|
@@ -2915,6 +2916,7 @@ class MatterportService {
|
|
|
2915
2916
|
// console.log('Leaving sweep ' + oldSweep);
|
|
2916
2917
|
// console.log('Entering sweep ' + newSweep);
|
|
2917
2918
|
this.inTransitionSweep = false;
|
|
2919
|
+
this.displayAzimutalCrown();
|
|
2918
2920
|
}.bind(this));
|
|
2919
2921
|
this.sdk.on(this.sdk.Sweep.Event.EXIT, function (fromSweep, toSweep) {
|
|
2920
2922
|
// console.log('Leaving sweep ' + fromSweep);
|
|
@@ -3913,6 +3915,7 @@ class MatterportService {
|
|
|
3913
3915
|
const nodeControl = sceneObject.addNode();
|
|
3914
3916
|
this.objectControl = nodeControl.addComponent('mp.transformControls');
|
|
3915
3917
|
nodeControl.start();
|
|
3918
|
+
//this.add3DObject({},null);
|
|
3916
3919
|
resolve();
|
|
3917
3920
|
}));
|
|
3918
3921
|
});
|
|
@@ -3928,6 +3931,7 @@ class MatterportService {
|
|
|
3928
3931
|
let isAnimatedSecurityCamera = false;
|
|
3929
3932
|
let isNestThermostat = false;
|
|
3930
3933
|
let isSmarterplanPromotionalVideo = false;
|
|
3934
|
+
let isAzimuthalCrown = false;
|
|
3931
3935
|
/**
|
|
3932
3936
|
* TODO: refacto with an enum or switch/case
|
|
3933
3937
|
*/
|
|
@@ -3940,6 +3944,9 @@ class MatterportService {
|
|
|
3940
3944
|
if (obj.object === 'video') {
|
|
3941
3945
|
isSmarterplanPromotionalVideo = true;
|
|
3942
3946
|
}
|
|
3947
|
+
if (obj.object === 'azimuth') {
|
|
3948
|
+
isAzimuthalCrown = true;
|
|
3949
|
+
}
|
|
3943
3950
|
const modelNode = sceneObject.addNode();
|
|
3944
3951
|
let component = null;
|
|
3945
3952
|
const initial = {
|
|
@@ -3988,6 +3995,13 @@ class MatterportService {
|
|
|
3988
3995
|
modelNode.obj3D.position.set(obj.position.x, obj.position.y, obj.position.z);
|
|
3989
3996
|
modelNode.obj3D.rotation.set(obj.rotation.x, obj.rotation.y, obj.rotation.z);
|
|
3990
3997
|
modelNode.obj3D.scale.set(obj.scale.x, obj.scale.y, obj.scale.z);
|
|
3998
|
+
if (isAzimuthalCrown) {
|
|
3999
|
+
/*if(modelNode.obj3D.scale.x >= 1.0){
|
|
4000
|
+
modelNode.obj3D.scale.set(obj.scale.x/5000, obj.scale.y/5000, obj.scale.z/5000);
|
|
4001
|
+
}*/
|
|
4002
|
+
this.azimuthalCrown = modelNode;
|
|
4003
|
+
this.displayAzimutalCrown();
|
|
4004
|
+
}
|
|
3991
4005
|
// By defaut, during creation, object has translation gizmo
|
|
3992
4006
|
// => User has to click on lateral panel, and save its position after playing with it!
|
|
3993
4007
|
if (mode && !isNestThermostat) {
|
|
@@ -4004,6 +4018,21 @@ class MatterportService {
|
|
|
4004
4018
|
// Store this in memory Map dictionnary
|
|
4005
4019
|
this.dictionnaryObjects3D.set(modelNode.obj3D.uuid, modelNode);
|
|
4006
4020
|
this.dictionnarySceneObjects3D.set(modelNode.obj3D.uuid, sceneObject);
|
|
4021
|
+
/*this.sdk.Camera.pose.subscribe(
|
|
4022
|
+
function (pose: any) {
|
|
4023
|
+
//console.log("in callback")
|
|
4024
|
+
//console.log(this.lastCameraPosition)
|
|
4025
|
+
//console.log(pose.position)
|
|
4026
|
+
if((pose.position.x == this.lastCameraPosition.x && pose.position.y == this.lastCameraPosition.y && pose.position.z == this.lastCameraPosition.z) || this.inTransitionMode || this.inTransitionSweep){
|
|
4027
|
+
//console.log("returning")
|
|
4028
|
+
return;
|
|
4029
|
+
}
|
|
4030
|
+
console.log("camera pos:",pose.position);
|
|
4031
|
+
this.lastCameraPosition = {...pose.position};
|
|
4032
|
+
if(this.lastObject3D){
|
|
4033
|
+
this.lastObject3D.position.set(pose.position.x+.5,pose.position.y+.5,pose.position.z+.5);
|
|
4034
|
+
}
|
|
4035
|
+
}.bind(this));*/
|
|
4007
4036
|
if (isAnimatedSecurityCamera) {
|
|
4008
4037
|
const animator = modelNode.addComponent('mp.securityCamera', {
|
|
4009
4038
|
"nearPlane": 0.1,
|
|
@@ -4081,6 +4110,13 @@ class MatterportService {
|
|
|
4081
4110
|
getSceneNodeFromObject3DId(uuid) {
|
|
4082
4111
|
return this.dictionnarySceneObjects3D.get(uuid);
|
|
4083
4112
|
}
|
|
4113
|
+
displayAzimutalCrown() {
|
|
4114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4115
|
+
if (this.azimuthalCrown) {
|
|
4116
|
+
this.azimuthalCrown.obj3D.position.set(this.poseCamera.position.x, this.poseCamera.position.y, this.poseCamera.position.z);
|
|
4117
|
+
}
|
|
4118
|
+
});
|
|
4119
|
+
}
|
|
4084
4120
|
attachGizmoControlTo3DObject(modelNode, sceneObject, mode, visible) {
|
|
4085
4121
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4086
4122
|
// Create a scene node with a transform control component.
|