@smarterplan/ngx-smarterplan-core 1.2.15 → 1.2.16

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.
@@ -2809,79 +2809,80 @@ class MatterportService {
2809
2809
  // renderer.shadowMap.type = three.PCFSoftShadowMap;
2810
2810
  // });
2811
2811
  // Wait until Showcase is actually playing....
2812
- this.sdk.Tag.data.subscribe({
2813
- onAdded: async function (index, item, collection) {
2814
- let thisOpacity = 0.2;
2815
- this.sdk.Tag.editOpacity(index, thisOpacity);
2816
- let source = null;
2817
- try {
2818
- source = await Promise.all([
2819
- this.sdk.Sensor.createSource(this.sdk.Sensor.SourceType.SPHERE, {
2820
- origin: item.anchorPosition,
2821
- radius: Number(3),
2822
- userData: {
2823
- id: index + '-sphere-source',
2824
- },
2825
- })
2826
- ]);
2827
- }
2828
- catch (e) {
2829
- console.log('could not create Sphere sensor');
2830
- console.error(e);
2831
- }
2832
- if (!source) {
2833
- return;
2834
- }
2835
- let sensor = null;
2836
- try {
2837
- sensor = await this.sdk.Sensor.createSensor(this.sdk.Sensor.SensorType.CAMERA);
2838
- }
2839
- catch (e) {
2840
- console.log('could not create Camera sensor');
2841
- console.error(e);
2842
- }
2843
- if (!sensor) {
2844
- return;
2845
- }
2846
- sensor.addSource(...source);
2847
- sensor.readings.subscribe({
2848
- onUpdated(source, reading) {
2849
- console.log(thisOpacity);
2850
- let oldOpacity = thisOpacity;
2851
- if (reading.inRange) {
2852
- thisOpacity = 1;
2853
- console.log(index + ' is inRange');
2854
- }
2855
- else if (reading.inView) {
2856
- console.log(index + ' is inView but not inRange');
2857
- thisOpacity = 0.5;
2858
- }
2859
- else {
2860
- thisOpacity = 0.2;
2861
- console.log(index + ' is not inView or inRange');
2862
- }
2863
- this.sdk.Tag.editOpacity(index, thisOpacity);
2864
- /*
2865
- let inc = 0.01;
2866
- if (oldOpacity > thisOpacity) {
2867
- inc = -0.01;
2868
- }
2869
-
2870
- for(var i = oldOpacity; i != thisOpacity; i=i+inc) {
2871
- setTimeout(function() {
2872
- mpSdk.Tag.editOpacity(index, i);
2873
- console.log('Delay', i);
2874
- },10);
2875
- }
2876
- */
2877
- }
2878
- });
2879
- //sensor.showDebug(true);
2880
- }.bind(this),
2881
- onCollectionUpdated: function (collection) {
2882
- console.log('Collection received. There are ', Object.keys(collection).length, ' Tags in the collection', collection);
2883
- }
2884
- });
2812
+ // this.sdk.Tag.data.subscribe({
2813
+ // onAdded: async function (index, item, collection) {
2814
+ //
2815
+ // let thisOpacity = 0.2;
2816
+ // this.sdk.Tag.editOpacity(index, thisOpacity);
2817
+ //
2818
+ // let source = null;
2819
+ // try {
2820
+ // source = await Promise.all([
2821
+ // this.sdk.Sensor.createSource(this.sdk.Sensor.SourceType.SPHERE, {
2822
+ // origin: item.anchorPosition,
2823
+ // radius: Number(3),
2824
+ // userData: {
2825
+ // id: index + '-sphere-source',
2826
+ // },
2827
+ // })
2828
+ // ]);
2829
+ // } catch (e) {
2830
+ // console.log('could not create Sphere sensor')
2831
+ // console.error(e);
2832
+ // }
2833
+ // if (!source) {
2834
+ // return;
2835
+ // }
2836
+ //
2837
+ // let sensor = null;
2838
+ // try {
2839
+ // sensor = await this.sdk.Sensor.createSensor(this.sdk.Sensor.SensorType.CAMERA);
2840
+ // } catch (e) {
2841
+ // console.log('could not create Camera sensor')
2842
+ // console.error(e);
2843
+ // }
2844
+ // if (!sensor) {
2845
+ // return;
2846
+ // }
2847
+ //
2848
+ // sensor.addSource(...source);
2849
+ // sensor.readings.subscribe({
2850
+ // onUpdated(source, reading) {
2851
+ // console.log(thisOpacity);
2852
+ // let oldOpacity = thisOpacity;
2853
+ // if (reading.inRange) {
2854
+ // thisOpacity = 1;
2855
+ // console.log(index + ' is inRange');
2856
+ // } else if (reading.inView) {
2857
+ // console.log(index + ' is inView but not inRange');
2858
+ // thisOpacity = 0.5;
2859
+ // } else {
2860
+ // thisOpacity = 0.2;
2861
+ // console.log(index + ' is not inView or inRange');
2862
+ // }
2863
+ //
2864
+ // this.sdk.Tag.editOpacity(index, thisOpacity);
2865
+ // /*
2866
+ // let inc = 0.01;
2867
+ // if (oldOpacity > thisOpacity) {
2868
+ // inc = -0.01;
2869
+ // }
2870
+ //
2871
+ // for(var i = oldOpacity; i != thisOpacity; i=i+inc) {
2872
+ // setTimeout(function() {
2873
+ // mpSdk.Tag.editOpacity(index, i);
2874
+ // console.log('Delay', i);
2875
+ // },10);
2876
+ // }
2877
+ // */
2878
+ // }
2879
+ // });
2880
+ // //sensor.showDebug(true);
2881
+ // }.bind(this),
2882
+ // onCollectionUpdated: function (collection) {
2883
+ // console.log('Collection received. There are ', Object.keys(collection).length, ' Tags in the collection', collection);
2884
+ // }
2885
+ // });
2885
2886
  resolve(true);
2886
2887
  }.bind(this));
2887
2888
  });