@reall3d/reall3dviewer 0.0.1 → 0.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reall3d/reall3dviewer",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -15,6 +15,11 @@
15
15
  "types": "./dist/pkg.d.ts"
16
16
  }
17
17
  },
18
+ "dependencies": {
19
+ "@gotoeasy/three-tile": "^0.8.7",
20
+ "@tweenjs/tween.js": "^25.0.0",
21
+ "three": "^0.171.0"
22
+ },
18
23
  "description": "reall3dviewer",
19
24
  "license": "MIT",
20
25
  "homepage": "https://github.com/reall3d-com/Reall3dViewer"
@@ -1 +0,0 @@
1
- (function(){"use strict";let i=0;i++;const D=`$${i++}`;i++,i++,i++;const W=`$${i++}`,p=`$${i++}`,S=`$${i++}`,y=`$${i++}`,C=`$${i++}`,A=`$${i++}`,R=`$${i++}`,G=`$${i++}`;i++;const H=`$${i++}`,J=`$${i++}`;i++;const T=`$${i++}`;i++;const K=`$${i++}`;i++;const L=`$${i++}`,N=`$${i++}`,O=`$${i++}`,Q=`$${i++}`,_=`$${i++}`,V=`$${i++}`,j=`$${i++}`,P=`$${i++}`;i++;const nn=navigator.userAgent.includes("Mobi"),b=self;let X={index:0,version:0},Y={index:1,version:0},w=!1,Z;const tn=.2;let k,f=[],M,z=0,B;function an(n){if(!w)return;let a=X.version>Y.version?X:Y;if(!a.version)return;const{xyz:t,renderSplatCount:o,visibleSplatCount:m,modelSplatCount:E,watermarkCount:x,index:F,version:u}=a;if(z===u&&Math.abs(f[2]-n[2])+Math.abs(f[6]-n[6])+Math.abs(f[10]-n[10])+Math.abs(f[14]-n[14])<tn)return;f=n,z=u;let I=Date.now(),l;if(!o){l=new Uint32Array(0),b.postMessage({[D]:l,[S]:o,[y]:m,[C]:E,[W]:F,[p]:u,[R]:0,[A]:I},[l.buffer]);return}let q=0;const r=o-x;l=new Uint32Array(o);const{maxDepth:v,minDepth:d}=en(a,k);if(v-d<=1e-5)for(let s=0;s<o;s++)l[s]=s;else{let s=Math.min(r,65535),g=(s-1)/(v-d),c=new Int32Array(s);for(let e=0,h=0;e<r;e++)h=($(n,t[3*e],t[3*e+1],t[3*e+2])-d)*g|0,c[M[e]=h]++;for(let e=1;e<s;e++)c[e]+=c[e-1];for(let e=0;e<r;e++)l[--c[M[e]]]=e;if(x){s=Math.min(Math.max(x/8|0,512),65535),g=(s-1)/(v-d),c=new Int32Array(s);for(let e=r,h=0;e<o;e++)h=($(n,t[3*e],t[3*e+1],t[3*e+2])-d)*g|0,c[M[e-r]=h]++;for(let e=1;e<s;e++)c[e]+=c[e-1];for(let e=0;e<x;e++)l[r+--c[M[e]]]=r+e}}q=Date.now()-I,b.postMessage({[D]:l,[S]:o,[y]:m,[C]:E,[W]:F,[p]:u,[A]:I,[R]:q},[l.buffer])}function $(n,a,t,o){return-(n[2]*a+n[6]*t+n[10]*o)}function en(n,a){let t=-1/0,o=1/0,m=0;return m=$(a,n.minX,n.minY,n.minZ),t=Math.max(t,m),o=Math.min(o,m),m=$(a,n.minX,n.minY,n.maxZ),t=Math.max(t,m),o=Math.min(o,m),m=$(a,n.minX,n.maxY,n.minZ),t=Math.max(t,m),o=Math.min(o,m),m=$(a,n.minX,n.maxY,n.maxZ),t=Math.max(t,m),o=Math.min(o,m),m=$(a,n.maxX,n.minY,n.minZ),t=Math.max(t,m),o=Math.min(o,m),m=$(a,n.maxX,n.minY,n.maxZ),t=Math.max(t,m),o=Math.min(o,m),m=$(a,n.maxX,n.maxY,n.minZ),t=Math.max(t,m),o=Math.min(o,m),m=$(a,n.maxX,n.maxY,n.maxZ),t=Math.max(t,m),o=Math.min(o,m),{maxDepth:t,minDepth:o}}const U=()=>{if(!Z){Z=!0;const n=k;an(n),setTimeout(()=>!(Z=!1)&&n!==k&&U())}};b.onmessage=n=>{const a=n.data;if(a[G]){let t=!B||a[W]===0?X:Y;t.minX=a[L],t.maxX=a[N],t.minY=a[O],t.maxY=a[Q],t.minZ=a[_],t.maxZ=a[V],t.xyz=new Float32Array(a[K].buffer),t.watermarkCount=a[P],t.version=a[p],t.renderSplatCount=a[S],t.visibleSplatCount=a[y],t.modelSplatCount=a[C],t.textureReady=!0,t.textureReadyTime=Date.now()}else a[T]?(k=a[T],U()):a[j]&&(B=a[H],M=new Int32Array(a[J]),w=!0)}})();
File without changes