@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.
@@ -2494,6 +2494,7 @@ class MatterportService {
2494
2494
  this.ngZone = ngZone;
2495
2495
  this.slots = []; //SlotNode[] = [];
2496
2496
  this.nodes = [];
2497
+ this.lastCameraPosition = { x: 0.0, y: 0.0, z: 0.0 };
2497
2498
  this.cursorPositionButtonDisplayed = false;
2498
2499
  // Measure mode
2499
2500
  this.isMeasureModeOn = false;
@@ -2797,6 +2798,7 @@ class MatterportService {
2797
2798
  // console.log('Leaving sweep ' + oldSweep);
2798
2799
  // console.log('Entering sweep ' + newSweep);
2799
2800
  this.inTransitionSweep = false;
2801
+ this.displayAzimutalCrown();
2800
2802
  }.bind(this));
2801
2803
  this.sdk.on(this.sdk.Sweep.Event.EXIT, function (fromSweep, toSweep) {
2802
2804
  // console.log('Leaving sweep ' + fromSweep);
@@ -3748,6 +3750,7 @@ class MatterportService {
3748
3750
  const nodeControl = sceneObject.addNode();
3749
3751
  this.objectControl = nodeControl.addComponent('mp.transformControls');
3750
3752
  nodeControl.start();
3753
+ //this.add3DObject({},null);
3751
3754
  resolve();
3752
3755
  });
3753
3756
  }
@@ -3761,6 +3764,7 @@ class MatterportService {
3761
3764
  let isAnimatedSecurityCamera = false;
3762
3765
  let isNestThermostat = false;
3763
3766
  let isSmarterplanPromotionalVideo = false;
3767
+ let isAzimuthalCrown = false;
3764
3768
  /**
3765
3769
  * TODO: refacto with an enum or switch/case
3766
3770
  */
@@ -3773,6 +3777,9 @@ class MatterportService {
3773
3777
  if (obj.object === 'video') {
3774
3778
  isSmarterplanPromotionalVideo = true;
3775
3779
  }
3780
+ if (obj.object === 'azimuth') {
3781
+ isAzimuthalCrown = true;
3782
+ }
3776
3783
  const modelNode = sceneObject.addNode();
3777
3784
  let component = null;
3778
3785
  const initial = {
@@ -3821,6 +3828,13 @@ class MatterportService {
3821
3828
  modelNode.obj3D.position.set(obj.position.x, obj.position.y, obj.position.z);
3822
3829
  modelNode.obj3D.rotation.set(obj.rotation.x, obj.rotation.y, obj.rotation.z);
3823
3830
  modelNode.obj3D.scale.set(obj.scale.x, obj.scale.y, obj.scale.z);
3831
+ if (isAzimuthalCrown) {
3832
+ /*if(modelNode.obj3D.scale.x >= 1.0){
3833
+ modelNode.obj3D.scale.set(obj.scale.x/5000, obj.scale.y/5000, obj.scale.z/5000);
3834
+ }*/
3835
+ this.azimuthalCrown = modelNode;
3836
+ this.displayAzimutalCrown();
3837
+ }
3824
3838
  // By defaut, during creation, object has translation gizmo
3825
3839
  // => User has to click on lateral panel, and save its position after playing with it!
3826
3840
  if (mode && !isNestThermostat) {
@@ -3837,6 +3851,21 @@ class MatterportService {
3837
3851
  // Store this in memory Map dictionnary
3838
3852
  this.dictionnaryObjects3D.set(modelNode.obj3D.uuid, modelNode);
3839
3853
  this.dictionnarySceneObjects3D.set(modelNode.obj3D.uuid, sceneObject);
3854
+ /*this.sdk.Camera.pose.subscribe(
3855
+ function (pose: any) {
3856
+ //console.log("in callback")
3857
+ //console.log(this.lastCameraPosition)
3858
+ //console.log(pose.position)
3859
+ if((pose.position.x == this.lastCameraPosition.x && pose.position.y == this.lastCameraPosition.y && pose.position.z == this.lastCameraPosition.z) || this.inTransitionMode || this.inTransitionSweep){
3860
+ //console.log("returning")
3861
+ return;
3862
+ }
3863
+ console.log("camera pos:",pose.position);
3864
+ this.lastCameraPosition = {...pose.position};
3865
+ if(this.lastObject3D){
3866
+ this.lastObject3D.position.set(pose.position.x+.5,pose.position.y+.5,pose.position.z+.5);
3867
+ }
3868
+ }.bind(this));*/
3840
3869
  if (isAnimatedSecurityCamera) {
3841
3870
  const animator = modelNode.addComponent('mp.securityCamera', {
3842
3871
  "nearPlane": 0.1,
@@ -3913,6 +3942,11 @@ class MatterportService {
3913
3942
  getSceneNodeFromObject3DId(uuid) {
3914
3943
  return this.dictionnarySceneObjects3D.get(uuid);
3915
3944
  }
3945
+ async displayAzimutalCrown() {
3946
+ if (this.azimuthalCrown) {
3947
+ this.azimuthalCrown.obj3D.position.set(this.poseCamera.position.x, this.poseCamera.position.y, this.poseCamera.position.z);
3948
+ }
3949
+ }
3916
3950
  async attachGizmoControlTo3DObject(modelNode, sceneObject, mode, visible) {
3917
3951
  // Create a scene node with a transform control component.
3918
3952
  let node = null;