@realsee/dnalogel 2.0.0-alpha.2 → 2.0.0-alpha.3

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.
@@ -737,7 +737,7 @@ function flush() {
737
737
  const component = dirty_components[flushidx];
738
738
  flushidx++;
739
739
  set_current_component(component);
740
- update(component.$$);
740
+ update$1(component.$$);
741
741
  }
742
742
  set_current_component(null);
743
743
  dirty_components.length = 0;
@@ -760,7 +760,7 @@ function flush() {
760
760
  seen_callbacks.clear();
761
761
  set_current_component(saved_component);
762
762
  }
763
- function update($$) {
763
+ function update$1($$) {
764
764
  if ($$.fragment !== null) {
765
765
  $$.update();
766
766
  run_all($$.before_update);
@@ -14099,7 +14099,7 @@ function WebGLAttributes(gl, capabilities) {
14099
14099
  attribute = attribute.data;
14100
14100
  return buffers.get(attribute);
14101
14101
  }
14102
- function remove(attribute) {
14102
+ function remove2(attribute) {
14103
14103
  if (attribute.isInterleavedBufferAttribute)
14104
14104
  attribute = attribute.data;
14105
14105
  var data = buffers.get(attribute);
@@ -14121,7 +14121,7 @@ function WebGLAttributes(gl, capabilities) {
14121
14121
  }
14122
14122
  return {
14123
14123
  get,
14124
- remove,
14124
+ remove: remove2,
14125
14125
  update: update2
14126
14126
  };
14127
14127
  }
@@ -16606,7 +16606,7 @@ function WebGLProperties() {
16606
16606
  }
16607
16607
  return map;
16608
16608
  }
16609
- function remove(object) {
16609
+ function remove2(object) {
16610
16610
  properties.delete(object);
16611
16611
  }
16612
16612
  function update2(object, key, value) {
@@ -16617,7 +16617,7 @@ function WebGLProperties() {
16617
16617
  }
16618
16618
  return {
16619
16619
  get,
16620
- remove,
16620
+ remove: remove2,
16621
16621
  update: update2,
16622
16622
  dispose
16623
16623
  };
@@ -25957,7 +25957,7 @@ CompressedTextureLoader.prototype = Object.assign(Object.create(Loader.prototype
25957
25957
  var loader = new FileLoader(this.manager);
25958
25958
  loader.setPath(this.path);
25959
25959
  loader.setResponseType("arraybuffer");
25960
- function loadTexture(i2) {
25960
+ function loadTexture2(i2) {
25961
25961
  loader.load(url[i2], function(buffer) {
25962
25962
  var texDatas = scope.parse(buffer, true);
25963
25963
  images[i2] = {
@@ -25980,7 +25980,7 @@ CompressedTextureLoader.prototype = Object.assign(Object.create(Loader.prototype
25980
25980
  if (Array.isArray(url)) {
25981
25981
  var loaded = 0;
25982
25982
  for (var i = 0, il = url.length; i < il; ++i) {
25983
- loadTexture(i);
25983
+ loadTexture2(i);
25984
25984
  }
25985
25985
  } else {
25986
25986
  loader.load(url, function(buffer) {
@@ -26119,7 +26119,7 @@ CubeTextureLoader.prototype = Object.assign(Object.create(Loader.prototype), {
26119
26119
  loader.setCrossOrigin(this.crossOrigin);
26120
26120
  loader.setPath(this.path);
26121
26121
  var loaded = 0;
26122
- function loadTexture(i2) {
26122
+ function loadTexture2(i2) {
26123
26123
  loader.load(urls[i2], function(image) {
26124
26124
  texture.images[i2] = image;
26125
26125
  loaded++;
@@ -26131,7 +26131,7 @@ CubeTextureLoader.prototype = Object.assign(Object.create(Loader.prototype), {
26131
26131
  }, void 0, onError);
26132
26132
  }
26133
26133
  for (var i = 0; i < urls.length; ++i) {
26134
- loadTexture(i);
26134
+ loadTexture2(i);
26135
26135
  }
26136
26136
  return texture;
26137
26137
  }
@@ -33730,12 +33730,12 @@ var FBXLoader = function() {
33730
33730
  }
33731
33731
  fbxTree = new TextParser().parse(FBXText);
33732
33732
  }
33733
- var textureLoader = new TextureLoader(this.manager).setPath(this.resourcePath || path).setCrossOrigin(this.crossOrigin);
33734
- return new FBXTreeParser(textureLoader, this.manager).parse(fbxTree);
33733
+ var textureLoader2 = new TextureLoader(this.manager).setPath(this.resourcePath || path).setCrossOrigin(this.crossOrigin);
33734
+ return new FBXTreeParser(textureLoader2, this.manager).parse(fbxTree);
33735
33735
  }
33736
33736
  });
33737
- function FBXTreeParser(textureLoader, manager) {
33738
- this.textureLoader = textureLoader;
33737
+ function FBXTreeParser(textureLoader2, manager) {
33738
+ this.textureLoader = textureLoader2;
33739
33739
  this.manager = manager;
33740
33740
  }
33741
33741
  FBXTreeParser.prototype = {
@@ -36934,12 +36934,29 @@ var Tween = function() {
36934
36934
  };
36935
36935
  return Tween2;
36936
36936
  }();
36937
+ var VERSION = "18.6.4";
36938
+ var nextId = Sequence.nextId;
36937
36939
  var TWEEN = mainGroup;
36938
- TWEEN.getAll.bind(TWEEN);
36939
- TWEEN.removeAll.bind(TWEEN);
36940
- TWEEN.add.bind(TWEEN);
36941
- TWEEN.remove.bind(TWEEN);
36942
- TWEEN.update.bind(TWEEN);
36940
+ var getAll = TWEEN.getAll.bind(TWEEN);
36941
+ var removeAll = TWEEN.removeAll.bind(TWEEN);
36942
+ var add = TWEEN.add.bind(TWEEN);
36943
+ var remove = TWEEN.remove.bind(TWEEN);
36944
+ var update = TWEEN.update.bind(TWEEN);
36945
+ var exports = {
36946
+ Easing: Easing$1,
36947
+ Group,
36948
+ Interpolation,
36949
+ now: now$1,
36950
+ Sequence,
36951
+ nextId,
36952
+ Tween,
36953
+ VERSION,
36954
+ getAll,
36955
+ removeAll,
36956
+ add,
36957
+ remove,
36958
+ update
36959
+ };
36943
36960
  const _requestAnimationFrame = window.requestAnimationFrame || ((fn) => setTimeout(fn, 16));
36944
36961
  const _cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;
36945
36962
  function nextFrame(fn, delay = 0) {
@@ -36995,7 +37012,7 @@ function tween(from, to2, duration, easing = Easing.Linear.None) {
36995
37012
  };
36996
37013
  return tween2;
36997
37014
  }
36998
- function tweenProgress(duration, easing) {
37015
+ function tweenProgress$1(duration, easing) {
36999
37016
  return tween({ progress: 0 }, { progress: 1 }, duration, easing);
37000
37017
  }
37001
37018
  var Rotation = /* @__PURE__ */ ((Rotation2) => {
@@ -37118,7 +37135,7 @@ const CameraMovementPlugin = (five) => {
37118
37135
  resolve(false);
37119
37136
  };
37120
37137
  const animeDuration = args.rotateSpeed ? Math.ceil(Math.abs(to2.longitude - from.longitude) / args.rotateSpeed * 1e3) : duration;
37121
- const tween2 = tweenProgress(animeDuration, Easing$1.Linear.None).onUpdate(onUpdate).onComplete(onComplete).onDestroy(onDestroy2);
37138
+ const tween2 = tweenProgress$1(animeDuration, Easing$1.Linear.None).onUpdate(onUpdate).onComplete(onComplete).onDestroy(onDestroy2);
37122
37139
  if (args.rotation === Rotation.Loop) {
37123
37140
  tween2.repeat(Infinity).yoyo(true);
37124
37141
  }
@@ -37142,4 +37159,130 @@ const CameraMovementPlugin = (five) => {
37142
37159
  rotate
37143
37160
  };
37144
37161
  };
37145
- export { CSS3DRenderPlugin, CameraMovementPlugin, ModelChassisCompassPlugin, ModelEntryDoorGuidePlugin, ModelFloorplanPlugin, ModelRoomLabelPlugin, ModelViewPlugin, PanoCursorRaycasterPlugin, PanoFloorplanRadarPlugin, TopviewFloorplanPlugin };
37162
+ const textureLoader = new THREE.TextureLoader();
37163
+ async function loadTexture(url) {
37164
+ return new Promise((resolve, reject) => {
37165
+ textureLoader.load(url, resolve, void 0, reject);
37166
+ }).then((texture) => {
37167
+ texture.encoding = THREE.sRGBEncoding;
37168
+ return texture;
37169
+ });
37170
+ }
37171
+ class BetterTween extends exports.Tween {
37172
+ constructor() {
37173
+ super(...arguments);
37174
+ __publicField(this, "disposeMethods", []);
37175
+ __publicField(this, "animationFrameDisposer");
37176
+ __publicField(this, "onDispose", (callback) => {
37177
+ this.disposeMethods.push(callback);
37178
+ return this;
37179
+ });
37180
+ __publicField(this, "play", () => {
37181
+ this.start(0);
37182
+ this.animationFrameDisposer = requestAnimationFrameInterval((time) => this.update(time));
37183
+ return this;
37184
+ });
37185
+ __publicField(this, "dispose", () => {
37186
+ var _a;
37187
+ this.stop();
37188
+ (_a = this.animationFrameDisposer) == null ? void 0 : _a.call(this);
37189
+ this.disposeMethods.forEach((fn) => fn());
37190
+ this.disposeMethods = [];
37191
+ exports.remove(this);
37192
+ });
37193
+ }
37194
+ }
37195
+ function tweenProgress(duration, easing = exports.Easing.Linear.None) {
37196
+ const tween2 = new BetterTween({ progress: 0 }).to({ progress: 1 });
37197
+ if (duration !== void 0)
37198
+ tween2.duration(duration);
37199
+ if (easing !== void 0)
37200
+ tween2.easing(easing);
37201
+ return tween2;
37202
+ }
37203
+ const PanoCompassPlugin = function(five, config) {
37204
+ return new PanoCompassController(five, config);
37205
+ };
37206
+ class PanoCompassController {
37207
+ constructor(five, config) {
37208
+ __publicField(this, "five");
37209
+ __publicField(this, "data");
37210
+ __publicField(this, "config");
37211
+ __publicField(this, "compassMeshTween");
37212
+ __publicField(this, "compassMesh");
37213
+ __publicField(this, "dispose", () => {
37214
+ this.five.off("panoArrived", this.onFivePanoArrived);
37215
+ this.five.off("panoWillArrive", this.onFivePanoWillArrive);
37216
+ this.five.off();
37217
+ });
37218
+ __publicField(this, "loadCompassMesh", async () => {
37219
+ var _a;
37220
+ const compassImageUrl = ((_a = this.config) == null ? void 0 : _a.compassImageUrl) || "//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png";
37221
+ const texture = await loadTexture(compassImageUrl);
37222
+ const compassGeometry = new THREE.CircleGeometry(0.7, 32);
37223
+ const compassMaterial = new THREE.MeshBasicMaterial({
37224
+ map: texture,
37225
+ transparent: true,
37226
+ opacity: 1,
37227
+ depthTest: false
37228
+ });
37229
+ const compassMesh = new THREE.Mesh(compassGeometry, compassMaterial);
37230
+ compassMesh.rotateX(-Math.PI / 2);
37231
+ compassMesh.name = "pano-compass-mesh";
37232
+ this.compassMesh = compassMesh;
37233
+ this.fixPosition(this.five.panoIndex || 0);
37234
+ if (!this.data)
37235
+ return;
37236
+ this.fixRotation(this.data.north_rad);
37237
+ this.five.scene.add(compassMesh);
37238
+ });
37239
+ __publicField(this, "onFivePanoWillArrive", (panoIndex) => {
37240
+ var _a, _b;
37241
+ if (panoIndex === this.five.panoIndex)
37242
+ return;
37243
+ (_a = this.compassMeshTween) == null ? void 0 : _a.dispose();
37244
+ (_b = this.compassMesh) == null ? void 0 : _b.material.setValues({ opacity: 0 });
37245
+ });
37246
+ __publicField(this, "onFivePanoArrived", (panoIndex) => {
37247
+ var _a, _b;
37248
+ if (((_a = this.compassMesh) == null ? void 0 : _a.material.opacity) !== 0)
37249
+ return;
37250
+ this.fixPosition(panoIndex);
37251
+ (_b = this.compassMeshTween) == null ? void 0 : _b.dispose();
37252
+ this.compassMeshTween = tweenProgress(1e3).onUpdate(({ progress }) => {
37253
+ var _a2;
37254
+ (_a2 = this.compassMesh) == null ? void 0 : _a2.material.setValues({ opacity: progress });
37255
+ this.five.needsRender = true;
37256
+ }).play();
37257
+ });
37258
+ this.five = five;
37259
+ this.config = config;
37260
+ five.once("panoLoaded", this.loadCompassMesh);
37261
+ five.once("dispose", this.dispose);
37262
+ this.five.on("panoArrived", this.onFivePanoArrived);
37263
+ this.five.on("panoWillArrive", this.onFivePanoWillArrive);
37264
+ }
37265
+ load(data) {
37266
+ this.data = data;
37267
+ if (this.compassMesh && !this.five.scene.children.includes(this.compassMesh)) {
37268
+ this.fixRotation(data.north_rad);
37269
+ this.fixPosition(this.five.panoIndex || 0);
37270
+ this.five.scene.add(this.compassMesh);
37271
+ }
37272
+ }
37273
+ fixPosition(panoIndex) {
37274
+ if (!this.compassMesh)
37275
+ return;
37276
+ const standingPosition = this.five.work.observers[panoIndex].standingPosition;
37277
+ const compassPosition = standingPosition.clone().add(new THREE.Vector3(0, 0.01, 0));
37278
+ this.compassMesh.position.copy(compassPosition);
37279
+ this.five.needsRender = true;
37280
+ }
37281
+ fixRotation(northRad) {
37282
+ if (!this.compassMesh)
37283
+ return;
37284
+ this.compassMesh.rotateZ(northRad - Math.PI / 2);
37285
+ this.five.needsRender = true;
37286
+ }
37287
+ }
37288
+ export { CSS3DRenderPlugin, CameraMovementPlugin, ModelChassisCompassPlugin, ModelEntryDoorGuidePlugin, ModelFloorplanPlugin, ModelRoomLabelPlugin, ModelViewPlugin, PanoCompassPlugin as PanoCompassPluginPlugin, PanoCursorRaycasterPlugin, PanoFloorplanRadarPlugin, TopviewFloorplanPlugin };