@smarterplan/ngx-smarterplan-core 1.2.31 → 1.2.32
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 +34 -1
- package/fesm2015/smarterplan-ngx-smarterplan-core.mjs +35 -0
- package/fesm2015/smarterplan-ngx-smarterplan-core.mjs.map +1 -1
- package/fesm2020/smarterplan-ngx-smarterplan-core.mjs +33 -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,10 @@ 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
|
+
modelNode.obj3D.scale.set(obj.scale.x / 5000, obj.scale.y / 5000, obj.scale.z / 5000);
|
|
4000
|
+
this.azimuthalCrown = modelNode;
|
|
4001
|
+
}
|
|
3991
4002
|
// By defaut, during creation, object has translation gizmo
|
|
3992
4003
|
// => User has to click on lateral panel, and save its position after playing with it!
|
|
3993
4004
|
if (mode && !isNestThermostat) {
|
|
@@ -4004,6 +4015,21 @@ class MatterportService {
|
|
|
4004
4015
|
// Store this in memory Map dictionnary
|
|
4005
4016
|
this.dictionnaryObjects3D.set(modelNode.obj3D.uuid, modelNode);
|
|
4006
4017
|
this.dictionnarySceneObjects3D.set(modelNode.obj3D.uuid, sceneObject);
|
|
4018
|
+
/*this.sdk.Camera.pose.subscribe(
|
|
4019
|
+
function (pose: any) {
|
|
4020
|
+
//console.log("in callback")
|
|
4021
|
+
//console.log(this.lastCameraPosition)
|
|
4022
|
+
//console.log(pose.position)
|
|
4023
|
+
if((pose.position.x == this.lastCameraPosition.x && pose.position.y == this.lastCameraPosition.y && pose.position.z == this.lastCameraPosition.z) || this.inTransitionMode || this.inTransitionSweep){
|
|
4024
|
+
//console.log("returning")
|
|
4025
|
+
return;
|
|
4026
|
+
}
|
|
4027
|
+
console.log("camera pos:",pose.position);
|
|
4028
|
+
this.lastCameraPosition = {...pose.position};
|
|
4029
|
+
if(this.lastObject3D){
|
|
4030
|
+
this.lastObject3D.position.set(pose.position.x+.5,pose.position.y+.5,pose.position.z+.5);
|
|
4031
|
+
}
|
|
4032
|
+
}.bind(this));*/
|
|
4007
4033
|
if (isAnimatedSecurityCamera) {
|
|
4008
4034
|
const animator = modelNode.addComponent('mp.securityCamera', {
|
|
4009
4035
|
"nearPlane": 0.1,
|
|
@@ -4081,6 +4107,15 @@ class MatterportService {
|
|
|
4081
4107
|
getSceneNodeFromObject3DId(uuid) {
|
|
4082
4108
|
return this.dictionnarySceneObjects3D.get(uuid);
|
|
4083
4109
|
}
|
|
4110
|
+
displayAzimutalCrown() {
|
|
4111
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4112
|
+
//this.azimutalCrown.position.set(this.poseCamera.position.x+.5,this.poseCamera.position.y+.5,this.poseCamera.position.z+.5)
|
|
4113
|
+
console.log("helooooooo!!!!");
|
|
4114
|
+
if (this.azimuthalCrown) {
|
|
4115
|
+
this.azimuthalCrown.obj3D.position.set(this.poseCamera.position.x, this.poseCamera.position.y, this.poseCamera.position.z);
|
|
4116
|
+
}
|
|
4117
|
+
});
|
|
4118
|
+
}
|
|
4084
4119
|
attachGizmoControlTo3DObject(modelNode, sceneObject, mode, visible) {
|
|
4085
4120
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4086
4121
|
// Create a scene node with a transform control component.
|