a3js 0.0.4 → 0.0.5
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/dist/a3js.cjs.js +4 -3
- package/dist/a3js.es.js +467 -44
- package/package.json +1 -1
package/dist/a3js.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("three");function Fe(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const p=Fe(Z);class B{object;needsUpdate;constructor(e){this.object=this.initObject(e),this.needsUpdate=this.initNeedsUpdate()}initNeedsUpdate(){return!1}update(e){}setLoc(e,t,n){this.object.position.set(e,t,n)}}class de{scene;objects;constructor(){this.scene=new p.Scene,this.objects=[]}add(e){this.scene.add(e.object),this.objects.push(e)}update(e){for(const t of this.objects)t.needsUpdate&&t.update(e)}}class ve extends B{}class _{scene;camera;constructor(e){this.scene=new de,this.camera=e,this.scene.scene.add(this.camera.object),this.camera.setLoc(0,0,3)}replaceScene(e){this.scene.scene.remove(this.camera.object),e.scene.add(this.camera.object);const t=this.scene;return this.scene=e,t}updateScene(e){this.scene.update(e)}}class ee extends ve{camera;headLight;constructor(e){super(e),this.camera=e,this.headLight=new p.SpotLight(16777215,1,0,Math.PI/3,0,0),this.headLight.rotation.x=3.14/2,this.object.add(this.camera),this.object.add(this.headLight)}initObject(){return new p.Object3D}getHeadLight(){return this.headLight}setAspect(e){Te(this.camera)&&(this.camera.aspect=e,this.camera.updateProjectionMatrix())}setHeadLightEnable(e){e?this.headLight.intensity=1:this.headLight.intensity=0}}function Te(r){return r.isPerspectiveCamera===!0}class me extends HTMLElement{ro;base;renderer;scene;camera;camera3js;clock;constructor(e){super(),e||(e=new p.PerspectiveCamera(75,300/150,.1,1e3)),this.camera3js=e;const t=new ee(e);this.base=new _(t),this.scene=this.base.scene,this.camera=this.base.camera,this.renderer=new p.WebGLRenderer,this.clock=new p.Clock,this.style="display: block;",this.renderer.domElement.style="display: block; width: 100%; height: 100%; margin: 0; padding: 0;",this.appendChild(this.renderer.domElement),this.animationFrameId=requestAnimationFrame(this.renderingLoop)}connectedCallback(){this.ro=new ResizeObserver(()=>{const{width:e,height:t}=this.renderer.domElement.getBoundingClientRect();Me(this.camera3js)&&(this.camera3js.aspect=e/t),this.renderer.setSize(e,t)}),this.ro.observe(this)}disconnectedCallback(){this.ro?.disconnect()}replaceScene(e){return this.base.replaceScene(e)}animationFrameId=-1;renderingLoop=()=>{this.animationFrameId=requestAnimationFrame(this.renderingLoop);const e=this.clock.getDelta();this.base.updateScene(e),this.renderer.render(this.scene.scene,this.camera3js)}}customElements.define("a3-canvas",me);function Me(r){return r.isPerspectiveCamera===!0}const Oe=`
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 100px;
|
|
4
4
|
left: 100px;
|
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
border: 1px solid #555;
|
|
7
7
|
background: white;
|
|
8
8
|
box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.3);
|
|
9
|
-
`,
|
|
9
|
+
`,ze=`
|
|
10
10
|
background: #444;
|
|
11
11
|
color: white;
|
|
12
12
|
padding: 8px;
|
|
13
13
|
cursor: move;
|
|
14
14
|
user-select: none; /* 文字選択を防ぐ */
|
|
15
|
-
`;class
|
|
15
|
+
`;class pe extends HTMLElement{ro;base;renderer;scene;camera;camera3js;clock;isDragging=!1;offsetX=0;offsetY=0;constructor(e,t){super(),this.camera3js=new p.PerspectiveCamera(75,e/t,.1,1e3);const n=new ee(this.camera3js);this.base=new _(n),this.scene=this.base.scene,this.camera=this.base.camera,this.renderer=new p.WebGLRenderer,this.clock=new p.Clock,this.camera3js.aspect=e/t,this.renderer.setSize(e,t),this.style=Oe,document.body?document.body.appendChild(this):document.addEventListener("DOMContentLoaded",()=>{document.body.append(this)},{once:!0});const i=document.createElement("div");i.textContent="A3Window",i.style=ze,this.appendChild(i),i.addEventListener("mousedown",this.mouseDownListener),document.addEventListener("mousemove",this.mouseMoveListener),document.addEventListener("mouseup",this.mouseUpListener),this.renderer.domElement.style=`display: block; width: ${e}px; height: ${t}px; margin: 0; padding: 0;`,this.renderer.domElement.width=e,this.renderer.domElement.width=t,this.appendChild(this.renderer.domElement),this.animationFrameId=requestAnimationFrame(this.renderingLoop)}connectedCallback(){this.ro=new ResizeObserver(()=>{const{width:e,height:t}=this.renderer.domElement.getBoundingClientRect();this.camera3js.aspect=e/t,this.renderer.setSize(e,t)}),this.ro.observe(this)}disconnectedCallback(){this.ro?.disconnect()}mouseDownListener=e=>{this.isDragging=!0,this.offsetX=e.clientX-this.offsetLeft,this.offsetY=e.clientY-this.offsetTop};mouseMoveListener=e=>{this.isDragging&&(this.style.left=e.clientX-this.offsetX+"px",this.style.top=e.clientY-this.offsetY+"px")};mouseUpListener=()=>{this.isDragging=!1};replaceScene(e){return this.base.replaceScene(e)}animationFrameId=-1;renderingLoop=()=>{this.animationFrameId=requestAnimationFrame(this.renderingLoop);const e=this.clock.getDelta();this.scene&&(this.scene.update(e),this.renderer.render(this.scene.scene,this.camera3js))}}customElements.define("a3-window",pe);class De extends B{initObject(){const e=new p.BoxGeometry,t=new p.MeshStandardMaterial({color:65280});return new p.Mesh(e,t)}initNeedsUpdate(){return!0}update(e){this.object.rotation.x+=e,this.object.rotation.y+=e,this.object.rotation.z+=e}}class Pe{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100,n="ltr"){const i=[],a=Ue(e,t,this.data,n);for(let c=0,h=a.length;c<h;c++)i.push(...a[c].toShapes());return i}}function Ue(r,e,t,n){const i=Array.from(r),a=e/t.resolution,c=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*a,h=[];let m=0,d=0;(n=="rtl"||n=="tb")&&i.reverse();for(let v=0;v<i.length;v++){const s=i[v];if(s===`
|
|
16
|
+
`)m=0,d-=c;else{const o=Re(s,a,m,d,t);n=="tb"?(m=0,d+=t.ascender*a):m+=o.offsetX,h.push(o.path)}}return h}function Re(r,e,t,n,i){const a=i.glyphs[r]||i.glyphs["?"];if(!a){console.error('THREE.Font: character "'+r+'" does not exists in font family '+i.familyName+".");return}const c=new Z.ShapePath;let h,m,d,v,s,o,g,j;if(a.o){const u=a._cachedOutline||(a._cachedOutline=a.o.split(" "));for(let l=0,M=u.length;l<M;)switch(u[l++]){case"m":h=u[l++]*e+t,m=u[l++]*e+n,c.moveTo(h,m);break;case"l":h=u[l++]*e+t,m=u[l++]*e+n,c.lineTo(h,m);break;case"q":d=u[l++]*e+t,v=u[l++]*e+n,s=u[l++]*e+t,o=u[l++]*e+n,c.quadraticCurveTo(s,o,d,v);break;case"b":d=u[l++]*e+t,v=u[l++]*e+n,s=u[l++]*e+t,o=u[l++]*e+n,g=u[l++]*e+t,j=u[l++]*e+n,c.bezierCurveTo(s,o,g,j,d,v);break}}return{offsetX:a.ha*e,path:c}}class Be extends Z.ExtrudeGeometry{constructor(e,t={}){const n=t.font;if(n===void 0)super();else{const i=n.generateShapes(e,t.size,t.direction);t.depth===void 0&&(t.depth=50),t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(i,t)}this.type="TextGeometry"}}function Ge(r){return typeof r=="string"}var b=Uint8Array,T=Uint16Array,Ie=Int32Array,ge=new b([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),be=new b([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),qe=new b([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),we=function(r,e){for(var t=new T(31),n=0;n<31;++n)t[n]=e+=1<<r[n-1];for(var i=new Ie(t[30]),n=1;n<30;++n)for(var a=t[n];a<t[n+1];++a)i[a]=a-t[n]<<5|n;return{b:t,r:i}},ye=we(ge,2),xe=ye.b,He=ye.r;xe[28]=258,He[258]=28;var Ne=we(be,0),We=Ne.b,K=new T(32768);for(var f=0;f<32768;++f){var E=(f&43690)>>1|(f&21845)<<1;E=(E&52428)>>2|(E&13107)<<2,E=(E&61680)>>4|(E&3855)<<4,K[f]=((E&65280)>>8|(E&255)<<8)>>1}var D=(function(r,e,t){for(var n=r.length,i=0,a=new T(e);i<n;++i)r[i]&&++a[r[i]-1];var c=new T(e);for(i=1;i<e;++i)c[i]=c[i-1]+a[i-1]<<1;var h;if(t){h=new T(1<<e);var m=15-e;for(i=0;i<n;++i)if(r[i])for(var d=i<<4|r[i],v=e-r[i],s=c[r[i]-1]++<<v,o=s|(1<<v)-1;s<=o;++s)h[K[s]>>m]=d}else for(h=new T(n),i=0;i<n;++i)r[i]&&(h[i]=K[c[r[i]-1]++]>>15-r[i]);return h}),P=new b(288);for(var f=0;f<144;++f)P[f]=8;for(var f=144;f<256;++f)P[f]=9;for(var f=256;f<280;++f)P[f]=7;for(var f=280;f<288;++f)P[f]=8;var Ce=new b(32);for(var f=0;f<32;++f)Ce[f]=5;var $e=D(P,9,1),Ve=D(Ce,5,1),V=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},x=function(r,e,t){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(e&7)&t},X=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(e&7)},Xe=function(r){return(r+7)/8|0},re=function(r,e,t){return(e==null||e<0)&&(e=0),(t==null||t>r.length)&&(t=r.length),new b(r.subarray(e,t))},Je=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],y=function(r,e,t){var n=new Error(e||Je[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,y),!t)throw n;return n},Ke=function(r,e,t,n){var i=r.length,a=n?n.length:0;if(!i||e.f&&!e.l)return t||new b(0);var c=!t,h=c||e.i!=2,m=e.i;c&&(t=new b(i*3));var d=function(le){var fe=t.length;if(le>fe){var ue=new b(Math.max(fe*2,le));ue.set(t),t=ue}},v=e.f||0,s=e.p||0,o=e.b||0,g=e.l,j=e.d,u=e.m,l=e.n,M=i*8;do{if(!g){v=x(r,s,1);var U=x(r,s+1,3);if(s+=3,U)if(U==1)g=$e,j=Ve,u=9,l=5;else if(U==2){var q=x(r,s,31)+257,te=x(r,s+10,15)+4,ne=q+x(r,s+5,31)+1;s+=14;for(var O=new b(ne),H=new b(19),w=0;w<te;++w)H[qe[w]]=x(r,s+w*3,7);s+=te*3;for(var ie=V(H),ke=(1<<ie)-1,je=D(H,ie,1),w=0;w<ne;){var se=je[x(r,s,ke)];s+=se&15;var S=se>>4;if(S<16)O[w++]=S;else{var L=0,R=0;for(S==16?(R=3+x(r,s,3),s+=2,L=O[w-1]):S==17?(R=3+x(r,s,7),s+=3):S==18&&(R=11+x(r,s,127),s+=7);R--;)O[w++]=L}}var ae=O.subarray(0,q),A=O.subarray(q);u=V(ae),l=V(A),g=D(ae,u,1),j=D(A,l,1)}else y(1);else{var S=Xe(s)+4,G=r[S-4]|r[S-3]<<8,I=S+G;if(I>i){m&&y(0);break}h&&d(o+G),t.set(r.subarray(S,I),o),e.b=o+=G,e.p=s=I*8,e.f=v;continue}if(s>M){m&&y(0);break}}h&&d(o+131072);for(var Ae=(1<<u)-1,Ee=(1<<l)-1,N=s;;N=s){var L=g[X(r,s)&Ae],F=L>>4;if(s+=L&15,s>M){m&&y(0);break}if(L||y(2),F<256)t[o++]=F;else if(F==256){N=s,g=null;break}else{var oe=F-254;if(F>264){var w=F-257,z=ge[w];oe=x(r,s,(1<<z)-1)+xe[w],s+=z}var W=j[X(r,s)&Ee],$=W>>4;W||y(3),s+=W&15;var A=We[$];if($>3){var z=be[$];A+=X(r,s)&(1<<z)-1,s+=z}if(s>M){m&&y(0);break}h&&d(o+131072);var ce=o+oe;if(o<A){var he=a-A,Le=Math.min(A,ce);for(he+o<0&&y(3);o<Le;++o)t[o]=n[he+o]}for(;o<ce;++o)t[o]=t[o-A]}}e.l=g,e.p=N,e.b=o,e.f=v,g&&(v=1,e.m=u,e.d=j,e.n=l)}while(!v);return o!=t.length&&c?re(t,0,o):t.subarray(0,o)},Qe=new b(0),k=function(r,e){return r[e]|r[e+1]<<8},C=function(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0},J=function(r,e){return C(r,e)+C(r,e+4)*4294967296};function Ye(r,e){return Ke(r,{i:2},e&&e.out,e&&e.dictionary)}var Q=typeof TextDecoder<"u"&&new TextDecoder,Ze=0;try{Q.decode(Qe,{stream:!0}),Ze=1}catch{}var _e=function(r){for(var e="",t=0;;){var n=r[t++],i=(n>127)+(n>223)+(n>239);if(t+i>r.length)return{s:e,r:re(r,t-1)};i?i==3?(n=((n&15)<<18|(r[t++]&63)<<12|(r[t++]&63)<<6|r[t++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):i&1?e+=String.fromCharCode((n&31)<<6|r[t++]&63):e+=String.fromCharCode((n&15)<<12|(r[t++]&63)<<6|r[t++]&63):e+=String.fromCharCode(n)}};function Se(r,e){if(e){for(var t="",n=0;n<r.length;n+=16384)t+=String.fromCharCode.apply(null,r.subarray(n,n+16384));return t}else{if(Q)return Q.decode(r);var i=_e(r),a=i.s,t=i.r;return t.length&&y(8),a}}var er=function(r,e){return e+30+k(r,e+26)+k(r,e+28)},rr=function(r,e,t){var n=k(r,e+28),i=Se(r.subarray(e+46,e+46+n),!(k(r,e+8)&2048)),a=e+46+n,c=C(r,e+20),h=t&&c==4294967295?tr(r,a):[c,C(r,e+24),C(r,e+42)],m=h[0],d=h[1],v=h[2];return[k(r,e+10),m,d,i,a+k(r,e+30)+k(r,e+32),v]},tr=function(r,e){for(;k(r,e)!=1;e+=4+k(r,e+2));return[J(r,e+12),J(r,e+4),J(r,e+20)]};function nr(r,e){for(var t={},n=r.length-22;C(r,n)!=101010256;--n)(!n||r.length-n>65558)&&y(13);var i=k(r,n+8);if(!i)return{};var a=C(r,n+16),c=a==4294967295||i==65535;if(c){var h=C(r,n-12);c=C(r,h)==101075792,c&&(i=C(r,h+32),a=C(r,h+48))}for(var m=0;m<i;++m){var d=rr(r,a,c),v=d[0],s=d[1],o=d[2],g=d[3],j=d[4],u=d[5],l=er(r,u);a=j,v?v==8?t[g]=Ye(r.subarray(l,l+s),{out:new b(o)}):y(14,"unknown compression type "+v):t[g]=re(r,l,l+s)}return t}let Y=null;async function ir(r){const e=r.substring(0,r.length-4),t=new p.FileLoader;t.setResponseType("arraybuffer");const n=await t.loadAsync(r),i=nr(new Uint8Array(n)),a=Se(new Uint8Array(i[e].buffer));Y=new Pe(JSON.parse(a))}class sr extends B{initObject(e){let t;if(Ge(e)?t=e:t="ERROR",Y==null){const n=new p.BoxGeometry,i=new p.MeshStandardMaterial({color:16711680});return new p.Mesh(n,i)}else{const n={font:Y,size:1,depth:.5,curveSegments:12},i=new Be(t,n);i.center();const a=new p.MeshStandardMaterial({color:65280});return new p.Mesh(i,a)}}}function ar(r){return 2*r}exports.A3Camera=ve;exports.A3Canvas=me;exports.A3Object=B;exports.A3Scene=de;exports.A3Test=De;exports.A3Text3D=sr;exports.A3ViewBase=_;exports.A3Window=pe;exports.GeneralCamera=ee;exports.initFont=ir;exports.times2=ar;
|
package/dist/a3js.es.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
1
|
+
import * as p from "three";
|
|
2
|
+
import { ShapePath as ke, ExtrudeGeometry as Le } from "three";
|
|
3
|
+
class Y {
|
|
3
4
|
object;
|
|
4
5
|
needsUpdate;
|
|
5
6
|
constructor(e) {
|
|
@@ -16,11 +17,11 @@ class a {
|
|
|
16
17
|
this.object.position.set(e, t, n);
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
|
-
class
|
|
20
|
+
class Ee {
|
|
20
21
|
scene;
|
|
21
22
|
objects;
|
|
22
23
|
constructor() {
|
|
23
|
-
this.scene = new
|
|
24
|
+
this.scene = new p.Scene(), this.objects = [];
|
|
24
25
|
}
|
|
25
26
|
add(e) {
|
|
26
27
|
this.scene.add(e.object), this.objects.push(e);
|
|
@@ -30,13 +31,13 @@ class d {
|
|
|
30
31
|
t.needsUpdate && t.update(e);
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
|
-
class
|
|
34
|
+
class je extends Y {
|
|
34
35
|
}
|
|
35
|
-
class
|
|
36
|
+
class le {
|
|
36
37
|
scene;
|
|
37
38
|
camera;
|
|
38
39
|
constructor(e) {
|
|
39
|
-
this.scene = new
|
|
40
|
+
this.scene = new Ee(), this.camera = e, this.scene.scene.add(this.camera.object), this.camera.setLoc(0, 0, 3);
|
|
40
41
|
}
|
|
41
42
|
replaceScene(e) {
|
|
42
43
|
this.scene.scene.remove(this.camera.object), e.scene.add(this.camera.object);
|
|
@@ -47,29 +48,29 @@ class c {
|
|
|
47
48
|
this.scene.update(e);
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
class
|
|
51
|
+
class fe extends je {
|
|
51
52
|
camera;
|
|
52
53
|
headLight;
|
|
53
54
|
constructor(e) {
|
|
54
|
-
super(e), this.camera = e, this.headLight = new
|
|
55
|
+
super(e), this.camera = e, this.headLight = new p.SpotLight(16777215, 1, 0, Math.PI / 3, 0, 0), this.headLight.rotation.x = 3.14 / 2, this.object.add(this.camera), this.object.add(this.headLight);
|
|
55
56
|
}
|
|
56
57
|
initObject() {
|
|
57
|
-
return new
|
|
58
|
+
return new p.Object3D();
|
|
58
59
|
}
|
|
59
60
|
getHeadLight() {
|
|
60
61
|
return this.headLight;
|
|
61
62
|
}
|
|
62
63
|
setAspect(e) {
|
|
63
|
-
|
|
64
|
+
Fe(this.camera) && (this.camera.aspect = e, this.camera.updateProjectionMatrix());
|
|
64
65
|
}
|
|
65
66
|
setHeadLightEnable(e) {
|
|
66
67
|
e ? this.headLight.intensity = 1 : this.headLight.intensity = 0;
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
-
return
|
|
70
|
+
function Fe(r) {
|
|
71
|
+
return r.isPerspectiveCamera === !0;
|
|
71
72
|
}
|
|
72
|
-
class
|
|
73
|
+
class Ae extends HTMLElement {
|
|
73
74
|
ro;
|
|
74
75
|
base;
|
|
75
76
|
renderer;
|
|
@@ -78,14 +79,14 @@ class l extends HTMLElement {
|
|
|
78
79
|
camera3js;
|
|
79
80
|
clock;
|
|
80
81
|
constructor(e) {
|
|
81
|
-
super(), e || (e = new
|
|
82
|
-
const t = new
|
|
83
|
-
this.base = new
|
|
82
|
+
super(), e || (e = new p.PerspectiveCamera(75, 300 / 150, 0.1, 1e3)), this.camera3js = e;
|
|
83
|
+
const t = new fe(e);
|
|
84
|
+
this.base = new le(t), this.scene = this.base.scene, this.camera = this.base.camera, this.renderer = new p.WebGLRenderer(), this.clock = new p.Clock(), this.style = "display: block;", this.renderer.domElement.style = "display: block; width: 100%; height: 100%; margin: 0; padding: 0;", this.appendChild(this.renderer.domElement), this.animationFrameId = requestAnimationFrame(this.renderingLoop);
|
|
84
85
|
}
|
|
85
86
|
connectedCallback() {
|
|
86
87
|
this.ro = new ResizeObserver(() => {
|
|
87
88
|
const { width: e, height: t } = this.renderer.domElement.getBoundingClientRect();
|
|
88
|
-
|
|
89
|
+
Te(this.camera3js) && (this.camera3js.aspect = e / t), this.renderer.setSize(e, t);
|
|
89
90
|
}), this.ro.observe(this);
|
|
90
91
|
}
|
|
91
92
|
disconnectedCallback() {
|
|
@@ -101,11 +102,11 @@ class l extends HTMLElement {
|
|
|
101
102
|
this.base.updateScene(e), this.renderer.render(this.scene.scene, this.camera3js);
|
|
102
103
|
};
|
|
103
104
|
}
|
|
104
|
-
customElements.define("a3-canvas",
|
|
105
|
-
function
|
|
106
|
-
return
|
|
105
|
+
customElements.define("a3-canvas", Ae);
|
|
106
|
+
function Te(r) {
|
|
107
|
+
return r.isPerspectiveCamera === !0;
|
|
107
108
|
}
|
|
108
|
-
const
|
|
109
|
+
const Me = `
|
|
109
110
|
position: absolute;
|
|
110
111
|
top: 100px;
|
|
111
112
|
left: 100px;
|
|
@@ -113,14 +114,14 @@ const u = `
|
|
|
113
114
|
border: 1px solid #555;
|
|
114
115
|
background: white;
|
|
115
116
|
box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.3);
|
|
116
|
-
`,
|
|
117
|
+
`, ze = `
|
|
117
118
|
background: #444;
|
|
118
119
|
color: white;
|
|
119
120
|
padding: 8px;
|
|
120
121
|
cursor: move;
|
|
121
122
|
user-select: none; /* 文字選択を防ぐ */
|
|
122
123
|
`;
|
|
123
|
-
class
|
|
124
|
+
class Oe extends HTMLElement {
|
|
124
125
|
ro;
|
|
125
126
|
base;
|
|
126
127
|
renderer;
|
|
@@ -132,13 +133,13 @@ class g extends HTMLElement {
|
|
|
132
133
|
offsetX = 0;
|
|
133
134
|
offsetY = 0;
|
|
134
135
|
constructor(e, t) {
|
|
135
|
-
super(), this.camera3js = new
|
|
136
|
-
const n = new
|
|
137
|
-
this.base = new
|
|
136
|
+
super(), this.camera3js = new p.PerspectiveCamera(75, e / t, 0.1, 1e3);
|
|
137
|
+
const n = new fe(this.camera3js);
|
|
138
|
+
this.base = new le(n), this.scene = this.base.scene, this.camera = this.base.camera, this.renderer = new p.WebGLRenderer(), this.clock = new p.Clock(), this.camera3js.aspect = e / t, this.renderer.setSize(e, t), this.style = Me, document.body ? document.body.appendChild(this) : document.addEventListener("DOMContentLoaded", () => {
|
|
138
139
|
document.body.append(this);
|
|
139
140
|
}, { once: !0 });
|
|
140
|
-
const
|
|
141
|
-
|
|
141
|
+
const i = document.createElement("div");
|
|
142
|
+
i.textContent = "A3Window", i.style = ze, this.appendChild(i), i.addEventListener("mousedown", this.mouseDownListener), document.addEventListener("mousemove", this.mouseMoveListener), document.addEventListener("mouseup", this.mouseUpListener), this.renderer.domElement.style = `display: block; width: ${e}px; height: ${t}px; margin: 0; padding: 0;`, this.renderer.domElement.width = e, this.renderer.domElement.width = t, this.appendChild(this.renderer.domElement), this.animationFrameId = requestAnimationFrame(this.renderingLoop);
|
|
142
143
|
}
|
|
143
144
|
connectedCallback() {
|
|
144
145
|
this.ro = new ResizeObserver(() => {
|
|
@@ -168,11 +169,11 @@ class g extends HTMLElement {
|
|
|
168
169
|
this.scene && (this.scene.update(e), this.renderer.render(this.scene.scene, this.camera3js));
|
|
169
170
|
};
|
|
170
171
|
}
|
|
171
|
-
customElements.define("a3-window",
|
|
172
|
-
class
|
|
172
|
+
customElements.define("a3-window", Oe);
|
|
173
|
+
class ir extends Y {
|
|
173
174
|
initObject() {
|
|
174
|
-
const e = new
|
|
175
|
-
return new
|
|
175
|
+
const e = new p.BoxGeometry(), t = new p.MeshStandardMaterial({ color: 65280 });
|
|
176
|
+
return new p.Mesh(e, t);
|
|
176
177
|
}
|
|
177
178
|
initNeedsUpdate() {
|
|
178
179
|
return !0;
|
|
@@ -181,17 +182,439 @@ class f extends a {
|
|
|
181
182
|
this.object.rotation.x += e, this.object.rotation.y += e, this.object.rotation.z += e;
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
|
-
|
|
185
|
-
|
|
185
|
+
class Ue {
|
|
186
|
+
/**
|
|
187
|
+
* Constructs a new font.
|
|
188
|
+
*
|
|
189
|
+
* @param {Object} data - The font data as JSON.
|
|
190
|
+
*/
|
|
191
|
+
constructor(e) {
|
|
192
|
+
this.isFont = !0, this.type = "Font", this.data = e;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Generates geometry shapes from the given text and size. The result of this method
|
|
196
|
+
* should be used with {@link ShapeGeometry} to generate the actual geometry data.
|
|
197
|
+
*
|
|
198
|
+
* @param {string} text - The text.
|
|
199
|
+
* @param {number} [size=100] - The text size.
|
|
200
|
+
* @param {string} [direction='ltr'] - Char direction: ltr(left to right), rtl(right to left) & tb(top bottom).
|
|
201
|
+
* @return {Array<Shape>} An array of shapes representing the text.
|
|
202
|
+
*/
|
|
203
|
+
generateShapes(e, t = 100, n = "ltr") {
|
|
204
|
+
const i = [], a = De(e, t, this.data, n);
|
|
205
|
+
for (let c = 0, h = a.length; c < h; c++)
|
|
206
|
+
i.push(...a[c].toShapes());
|
|
207
|
+
return i;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
function De(r, e, t, n) {
|
|
211
|
+
const i = Array.from(r), a = e / t.resolution, c = (t.boundingBox.yMax - t.boundingBox.yMin + t.underlineThickness) * a, h = [];
|
|
212
|
+
let m = 0, v = 0;
|
|
213
|
+
(n == "rtl" || n == "tb") && i.reverse();
|
|
214
|
+
for (let d = 0; d < i.length; d++) {
|
|
215
|
+
const s = i[d];
|
|
216
|
+
if (s === `
|
|
217
|
+
`)
|
|
218
|
+
m = 0, v -= c;
|
|
219
|
+
else {
|
|
220
|
+
const o = Re(s, a, m, v, t);
|
|
221
|
+
n == "tb" ? (m = 0, v += t.ascender * a) : m += o.offsetX, h.push(o.path);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return h;
|
|
225
|
+
}
|
|
226
|
+
function Re(r, e, t, n, i) {
|
|
227
|
+
const a = i.glyphs[r] || i.glyphs["?"];
|
|
228
|
+
if (!a) {
|
|
229
|
+
console.error('THREE.Font: character "' + r + '" does not exists in font family ' + i.familyName + ".");
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const c = new ke();
|
|
233
|
+
let h, m, v, d, s, o, g, L;
|
|
234
|
+
if (a.o) {
|
|
235
|
+
const u = a._cachedOutline || (a._cachedOutline = a.o.split(" "));
|
|
236
|
+
for (let l = 0, M = u.length; l < M; )
|
|
237
|
+
switch (u[l++]) {
|
|
238
|
+
case "m":
|
|
239
|
+
h = u[l++] * e + t, m = u[l++] * e + n, c.moveTo(h, m);
|
|
240
|
+
break;
|
|
241
|
+
case "l":
|
|
242
|
+
h = u[l++] * e + t, m = u[l++] * e + n, c.lineTo(h, m);
|
|
243
|
+
break;
|
|
244
|
+
case "q":
|
|
245
|
+
v = u[l++] * e + t, d = u[l++] * e + n, s = u[l++] * e + t, o = u[l++] * e + n, c.quadraticCurveTo(s, o, v, d);
|
|
246
|
+
break;
|
|
247
|
+
case "b":
|
|
248
|
+
v = u[l++] * e + t, d = u[l++] * e + n, s = u[l++] * e + t, o = u[l++] * e + n, g = u[l++] * e + t, L = u[l++] * e + n, c.bezierCurveTo(s, o, g, L, v, d);
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return { offsetX: a.ha * e, path: c };
|
|
253
|
+
}
|
|
254
|
+
class Pe extends Le {
|
|
255
|
+
/**
|
|
256
|
+
* Constructs a new text geometry.
|
|
257
|
+
*
|
|
258
|
+
* @param {string} text - The text that should be transformed into a geometry.
|
|
259
|
+
* @param {TextGeometry~Options} [parameters] - The text settings.
|
|
260
|
+
*/
|
|
261
|
+
constructor(e, t = {}) {
|
|
262
|
+
const n = t.font;
|
|
263
|
+
if (n === void 0)
|
|
264
|
+
super();
|
|
265
|
+
else {
|
|
266
|
+
const i = n.generateShapes(e, t.size, t.direction);
|
|
267
|
+
t.depth === void 0 && (t.depth = 50), t.bevelThickness === void 0 && (t.bevelThickness = 10), t.bevelSize === void 0 && (t.bevelSize = 8), t.bevelEnabled === void 0 && (t.bevelEnabled = !1), super(i, t);
|
|
268
|
+
}
|
|
269
|
+
this.type = "TextGeometry";
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function Be(r) {
|
|
273
|
+
return typeof r == "string";
|
|
274
|
+
}
|
|
275
|
+
var w = Uint8Array, T = Uint16Array, Ge = Int32Array, ue = new w([
|
|
276
|
+
0,
|
|
277
|
+
0,
|
|
278
|
+
0,
|
|
279
|
+
0,
|
|
280
|
+
0,
|
|
281
|
+
0,
|
|
282
|
+
0,
|
|
283
|
+
0,
|
|
284
|
+
1,
|
|
285
|
+
1,
|
|
286
|
+
1,
|
|
287
|
+
1,
|
|
288
|
+
2,
|
|
289
|
+
2,
|
|
290
|
+
2,
|
|
291
|
+
2,
|
|
292
|
+
3,
|
|
293
|
+
3,
|
|
294
|
+
3,
|
|
295
|
+
3,
|
|
296
|
+
4,
|
|
297
|
+
4,
|
|
298
|
+
4,
|
|
299
|
+
4,
|
|
300
|
+
5,
|
|
301
|
+
5,
|
|
302
|
+
5,
|
|
303
|
+
5,
|
|
304
|
+
0,
|
|
305
|
+
/* unused */
|
|
306
|
+
0,
|
|
307
|
+
0,
|
|
308
|
+
/* impossible */
|
|
309
|
+
0
|
|
310
|
+
]), ve = new w([
|
|
311
|
+
0,
|
|
312
|
+
0,
|
|
313
|
+
0,
|
|
314
|
+
0,
|
|
315
|
+
1,
|
|
316
|
+
1,
|
|
317
|
+
2,
|
|
318
|
+
2,
|
|
319
|
+
3,
|
|
320
|
+
3,
|
|
321
|
+
4,
|
|
322
|
+
4,
|
|
323
|
+
5,
|
|
324
|
+
5,
|
|
325
|
+
6,
|
|
326
|
+
6,
|
|
327
|
+
7,
|
|
328
|
+
7,
|
|
329
|
+
8,
|
|
330
|
+
8,
|
|
331
|
+
9,
|
|
332
|
+
9,
|
|
333
|
+
10,
|
|
334
|
+
10,
|
|
335
|
+
11,
|
|
336
|
+
11,
|
|
337
|
+
12,
|
|
338
|
+
12,
|
|
339
|
+
13,
|
|
340
|
+
13,
|
|
341
|
+
/* unused */
|
|
342
|
+
0,
|
|
343
|
+
0
|
|
344
|
+
]), Ie = new w([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), de = function(r, e) {
|
|
345
|
+
for (var t = new T(31), n = 0; n < 31; ++n)
|
|
346
|
+
t[n] = e += 1 << r[n - 1];
|
|
347
|
+
for (var i = new Ge(t[30]), n = 1; n < 30; ++n)
|
|
348
|
+
for (var a = t[n]; a < t[n + 1]; ++a)
|
|
349
|
+
i[a] = a - t[n] << 5 | n;
|
|
350
|
+
return { b: t, r: i };
|
|
351
|
+
}, me = de(ue, 2), pe = me.b, qe = me.r;
|
|
352
|
+
pe[28] = 258, qe[258] = 28;
|
|
353
|
+
var He = de(ve, 0), Ne = He.b, V = new T(32768);
|
|
354
|
+
for (var f = 0; f < 32768; ++f) {
|
|
355
|
+
var j = (f & 43690) >> 1 | (f & 21845) << 1;
|
|
356
|
+
j = (j & 52428) >> 2 | (j & 13107) << 2, j = (j & 61680) >> 4 | (j & 3855) << 4, V[f] = ((j & 65280) >> 8 | (j & 255) << 8) >> 1;
|
|
357
|
+
}
|
|
358
|
+
var U = (function(r, e, t) {
|
|
359
|
+
for (var n = r.length, i = 0, a = new T(e); i < n; ++i)
|
|
360
|
+
r[i] && ++a[r[i] - 1];
|
|
361
|
+
var c = new T(e);
|
|
362
|
+
for (i = 1; i < e; ++i)
|
|
363
|
+
c[i] = c[i - 1] + a[i - 1] << 1;
|
|
364
|
+
var h;
|
|
365
|
+
if (t) {
|
|
366
|
+
h = new T(1 << e);
|
|
367
|
+
var m = 15 - e;
|
|
368
|
+
for (i = 0; i < n; ++i)
|
|
369
|
+
if (r[i])
|
|
370
|
+
for (var v = i << 4 | r[i], d = e - r[i], s = c[r[i] - 1]++ << d, o = s | (1 << d) - 1; s <= o; ++s)
|
|
371
|
+
h[V[s] >> m] = v;
|
|
372
|
+
} else
|
|
373
|
+
for (h = new T(n), i = 0; i < n; ++i)
|
|
374
|
+
r[i] && (h[i] = V[c[r[i] - 1]++] >> 15 - r[i]);
|
|
375
|
+
return h;
|
|
376
|
+
}), D = new w(288);
|
|
377
|
+
for (var f = 0; f < 144; ++f)
|
|
378
|
+
D[f] = 8;
|
|
379
|
+
for (var f = 144; f < 256; ++f)
|
|
380
|
+
D[f] = 9;
|
|
381
|
+
for (var f = 256; f < 280; ++f)
|
|
382
|
+
D[f] = 7;
|
|
383
|
+
for (var f = 280; f < 288; ++f)
|
|
384
|
+
D[f] = 8;
|
|
385
|
+
var ge = new w(32);
|
|
386
|
+
for (var f = 0; f < 32; ++f)
|
|
387
|
+
ge[f] = 5;
|
|
388
|
+
var We = /* @__PURE__ */ U(D, 9, 1), $e = /* @__PURE__ */ U(ge, 5, 1), $ = function(r) {
|
|
389
|
+
for (var e = r[0], t = 1; t < r.length; ++t)
|
|
390
|
+
r[t] > e && (e = r[t]);
|
|
391
|
+
return e;
|
|
392
|
+
}, x = function(r, e, t) {
|
|
393
|
+
var n = e / 8 | 0;
|
|
394
|
+
return (r[n] | r[n + 1] << 8) >> (e & 7) & t;
|
|
395
|
+
}, X = function(r, e) {
|
|
396
|
+
var t = e / 8 | 0;
|
|
397
|
+
return (r[t] | r[t + 1] << 8 | r[t + 2] << 16) >> (e & 7);
|
|
398
|
+
}, Xe = function(r) {
|
|
399
|
+
return (r + 7) / 8 | 0;
|
|
400
|
+
}, Z = function(r, e, t) {
|
|
401
|
+
return (e == null || e < 0) && (e = 0), (t == null || t > r.length) && (t = r.length), new w(r.subarray(e, t));
|
|
402
|
+
}, Je = [
|
|
403
|
+
"unexpected EOF",
|
|
404
|
+
"invalid block type",
|
|
405
|
+
"invalid length/literal",
|
|
406
|
+
"invalid distance",
|
|
407
|
+
"stream finished",
|
|
408
|
+
"no stream handler",
|
|
409
|
+
,
|
|
410
|
+
"no callback",
|
|
411
|
+
"invalid UTF-8 data",
|
|
412
|
+
"extra field too long",
|
|
413
|
+
"date not in range 1980-2099",
|
|
414
|
+
"filename too long",
|
|
415
|
+
"stream finishing",
|
|
416
|
+
"invalid zip data"
|
|
417
|
+
// determined by unknown compression method
|
|
418
|
+
], y = function(r, e, t) {
|
|
419
|
+
var n = new Error(e || Je[r]);
|
|
420
|
+
if (n.code = r, Error.captureStackTrace && Error.captureStackTrace(n, y), !t)
|
|
421
|
+
throw n;
|
|
422
|
+
return n;
|
|
423
|
+
}, Ve = function(r, e, t, n) {
|
|
424
|
+
var i = r.length, a = n ? n.length : 0;
|
|
425
|
+
if (!i || e.f && !e.l)
|
|
426
|
+
return t || new w(0);
|
|
427
|
+
var c = !t, h = c || e.i != 2, m = e.i;
|
|
428
|
+
c && (t = new w(i * 3));
|
|
429
|
+
var v = function(oe) {
|
|
430
|
+
var ce = t.length;
|
|
431
|
+
if (oe > ce) {
|
|
432
|
+
var he = new w(Math.max(ce * 2, oe));
|
|
433
|
+
he.set(t), t = he;
|
|
434
|
+
}
|
|
435
|
+
}, d = e.f || 0, s = e.p || 0, o = e.b || 0, g = e.l, L = e.d, u = e.m, l = e.n, M = i * 8;
|
|
436
|
+
do {
|
|
437
|
+
if (!g) {
|
|
438
|
+
d = x(r, s, 1);
|
|
439
|
+
var R = x(r, s + 1, 3);
|
|
440
|
+
if (s += 3, R)
|
|
441
|
+
if (R == 1)
|
|
442
|
+
g = We, L = $e, u = 9, l = 5;
|
|
443
|
+
else if (R == 2) {
|
|
444
|
+
var I = x(r, s, 31) + 257, _ = x(r, s + 10, 15) + 4, ee = I + x(r, s + 5, 31) + 1;
|
|
445
|
+
s += 14;
|
|
446
|
+
for (var z = new w(ee), q = new w(19), b = 0; b < _; ++b)
|
|
447
|
+
q[Ie[b]] = x(r, s + b * 3, 7);
|
|
448
|
+
s += _ * 3;
|
|
449
|
+
for (var re = $(q), be = (1 << re) - 1, ye = U(q, re, 1), b = 0; b < ee; ) {
|
|
450
|
+
var te = ye[x(r, s, be)];
|
|
451
|
+
s += te & 15;
|
|
452
|
+
var S = te >> 4;
|
|
453
|
+
if (S < 16)
|
|
454
|
+
z[b++] = S;
|
|
455
|
+
else {
|
|
456
|
+
var F = 0, P = 0;
|
|
457
|
+
for (S == 16 ? (P = 3 + x(r, s, 3), s += 2, F = z[b - 1]) : S == 17 ? (P = 3 + x(r, s, 7), s += 3) : S == 18 && (P = 11 + x(r, s, 127), s += 7); P--; )
|
|
458
|
+
z[b++] = F;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
var ne = z.subarray(0, I), E = z.subarray(I);
|
|
462
|
+
u = $(ne), l = $(E), g = U(ne, u, 1), L = U(E, l, 1);
|
|
463
|
+
} else
|
|
464
|
+
y(1);
|
|
465
|
+
else {
|
|
466
|
+
var S = Xe(s) + 4, B = r[S - 4] | r[S - 3] << 8, G = S + B;
|
|
467
|
+
if (G > i) {
|
|
468
|
+
m && y(0);
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
h && v(o + B), t.set(r.subarray(S, G), o), e.b = o += B, e.p = s = G * 8, e.f = d;
|
|
472
|
+
continue;
|
|
473
|
+
}
|
|
474
|
+
if (s > M) {
|
|
475
|
+
m && y(0);
|
|
476
|
+
break;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
h && v(o + 131072);
|
|
480
|
+
for (var xe = (1 << u) - 1, Ce = (1 << l) - 1, H = s; ; H = s) {
|
|
481
|
+
var F = g[X(r, s) & xe], A = F >> 4;
|
|
482
|
+
if (s += F & 15, s > M) {
|
|
483
|
+
m && y(0);
|
|
484
|
+
break;
|
|
485
|
+
}
|
|
486
|
+
if (F || y(2), A < 256)
|
|
487
|
+
t[o++] = A;
|
|
488
|
+
else if (A == 256) {
|
|
489
|
+
H = s, g = null;
|
|
490
|
+
break;
|
|
491
|
+
} else {
|
|
492
|
+
var ie = A - 254;
|
|
493
|
+
if (A > 264) {
|
|
494
|
+
var b = A - 257, O = ue[b];
|
|
495
|
+
ie = x(r, s, (1 << O) - 1) + pe[b], s += O;
|
|
496
|
+
}
|
|
497
|
+
var N = L[X(r, s) & Ce], W = N >> 4;
|
|
498
|
+
N || y(3), s += N & 15;
|
|
499
|
+
var E = Ne[W];
|
|
500
|
+
if (W > 3) {
|
|
501
|
+
var O = ve[W];
|
|
502
|
+
E += X(r, s) & (1 << O) - 1, s += O;
|
|
503
|
+
}
|
|
504
|
+
if (s > M) {
|
|
505
|
+
m && y(0);
|
|
506
|
+
break;
|
|
507
|
+
}
|
|
508
|
+
h && v(o + 131072);
|
|
509
|
+
var se = o + ie;
|
|
510
|
+
if (o < E) {
|
|
511
|
+
var ae = a - E, Se = Math.min(E, se);
|
|
512
|
+
for (ae + o < 0 && y(3); o < Se; ++o)
|
|
513
|
+
t[o] = n[ae + o];
|
|
514
|
+
}
|
|
515
|
+
for (; o < se; ++o)
|
|
516
|
+
t[o] = t[o - E];
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
e.l = g, e.p = H, e.b = o, e.f = d, g && (d = 1, e.m = u, e.d = L, e.n = l);
|
|
520
|
+
} while (!d);
|
|
521
|
+
return o != t.length && c ? Z(t, 0, o) : t.subarray(0, o);
|
|
522
|
+
}, Ke = /* @__PURE__ */ new w(0), k = function(r, e) {
|
|
523
|
+
return r[e] | r[e + 1] << 8;
|
|
524
|
+
}, C = function(r, e) {
|
|
525
|
+
return (r[e] | r[e + 1] << 8 | r[e + 2] << 16 | r[e + 3] << 24) >>> 0;
|
|
526
|
+
}, J = function(r, e) {
|
|
527
|
+
return C(r, e) + C(r, e + 4) * 4294967296;
|
|
528
|
+
};
|
|
529
|
+
function Qe(r, e) {
|
|
530
|
+
return Ve(r, { i: 2 }, e && e.out, e && e.dictionary);
|
|
531
|
+
}
|
|
532
|
+
var K = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), Ye = 0;
|
|
533
|
+
try {
|
|
534
|
+
K.decode(Ke, { stream: !0 }), Ye = 1;
|
|
535
|
+
} catch {
|
|
536
|
+
}
|
|
537
|
+
var Ze = function(r) {
|
|
538
|
+
for (var e = "", t = 0; ; ) {
|
|
539
|
+
var n = r[t++], i = (n > 127) + (n > 223) + (n > 239);
|
|
540
|
+
if (t + i > r.length)
|
|
541
|
+
return { s: e, r: Z(r, t - 1) };
|
|
542
|
+
i ? i == 3 ? (n = ((n & 15) << 18 | (r[t++] & 63) << 12 | (r[t++] & 63) << 6 | r[t++] & 63) - 65536, e += String.fromCharCode(55296 | n >> 10, 56320 | n & 1023)) : i & 1 ? e += String.fromCharCode((n & 31) << 6 | r[t++] & 63) : e += String.fromCharCode((n & 15) << 12 | (r[t++] & 63) << 6 | r[t++] & 63) : e += String.fromCharCode(n);
|
|
543
|
+
}
|
|
544
|
+
};
|
|
545
|
+
function we(r, e) {
|
|
546
|
+
if (e) {
|
|
547
|
+
for (var t = "", n = 0; n < r.length; n += 16384)
|
|
548
|
+
t += String.fromCharCode.apply(null, r.subarray(n, n + 16384));
|
|
549
|
+
return t;
|
|
550
|
+
} else {
|
|
551
|
+
if (K)
|
|
552
|
+
return K.decode(r);
|
|
553
|
+
var i = Ze(r), a = i.s, t = i.r;
|
|
554
|
+
return t.length && y(8), a;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
var _e = function(r, e) {
|
|
558
|
+
return e + 30 + k(r, e + 26) + k(r, e + 28);
|
|
559
|
+
}, er = function(r, e, t) {
|
|
560
|
+
var n = k(r, e + 28), i = we(r.subarray(e + 46, e + 46 + n), !(k(r, e + 8) & 2048)), a = e + 46 + n, c = C(r, e + 20), h = t && c == 4294967295 ? rr(r, a) : [c, C(r, e + 24), C(r, e + 42)], m = h[0], v = h[1], d = h[2];
|
|
561
|
+
return [k(r, e + 10), m, v, i, a + k(r, e + 30) + k(r, e + 32), d];
|
|
562
|
+
}, rr = function(r, e) {
|
|
563
|
+
for (; k(r, e) != 1; e += 4 + k(r, e + 2))
|
|
564
|
+
;
|
|
565
|
+
return [J(r, e + 12), J(r, e + 4), J(r, e + 20)];
|
|
566
|
+
};
|
|
567
|
+
function tr(r, e) {
|
|
568
|
+
for (var t = {}, n = r.length - 22; C(r, n) != 101010256; --n)
|
|
569
|
+
(!n || r.length - n > 65558) && y(13);
|
|
570
|
+
var i = k(r, n + 8);
|
|
571
|
+
if (!i)
|
|
572
|
+
return {};
|
|
573
|
+
var a = C(r, n + 16), c = a == 4294967295 || i == 65535;
|
|
574
|
+
if (c) {
|
|
575
|
+
var h = C(r, n - 12);
|
|
576
|
+
c = C(r, h) == 101075792, c && (i = C(r, h + 32), a = C(r, h + 48));
|
|
577
|
+
}
|
|
578
|
+
for (var m = 0; m < i; ++m) {
|
|
579
|
+
var v = er(r, a, c), d = v[0], s = v[1], o = v[2], g = v[3], L = v[4], u = v[5], l = _e(r, u);
|
|
580
|
+
a = L, d ? d == 8 ? t[g] = Qe(r.subarray(l, l + s), { out: new w(o) }) : y(14, "unknown compression type " + d) : t[g] = Z(r, l, l + s);
|
|
581
|
+
}
|
|
582
|
+
return t;
|
|
583
|
+
}
|
|
584
|
+
let Q = null;
|
|
585
|
+
async function sr(r) {
|
|
586
|
+
const e = r.substring(0, r.length - 4), t = new p.FileLoader();
|
|
587
|
+
t.setResponseType("arraybuffer");
|
|
588
|
+
const n = await t.loadAsync(r), i = tr(new Uint8Array(n)), a = we(new Uint8Array(i[e].buffer));
|
|
589
|
+
Q = new Ue(JSON.parse(a));
|
|
590
|
+
}
|
|
591
|
+
class ar extends Y {
|
|
592
|
+
initObject(e) {
|
|
593
|
+
let t;
|
|
594
|
+
if (Be(e) ? t = e : t = "ERROR", Q == null) {
|
|
595
|
+
const n = new p.BoxGeometry(), i = new p.MeshStandardMaterial({ color: 16711680 });
|
|
596
|
+
return new p.Mesh(n, i);
|
|
597
|
+
} else {
|
|
598
|
+
const n = { font: Q, size: 1, depth: 0.5, curveSegments: 12 }, i = new Pe(t, n);
|
|
599
|
+
i.center();
|
|
600
|
+
const a = new p.MeshStandardMaterial({ color: 65280 });
|
|
601
|
+
return new p.Mesh(i, a);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
function or(r) {
|
|
606
|
+
return 2 * r;
|
|
186
607
|
}
|
|
187
608
|
export {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
609
|
+
je as A3Camera,
|
|
610
|
+
Ae as A3Canvas,
|
|
611
|
+
Y as A3Object,
|
|
612
|
+
Ee as A3Scene,
|
|
613
|
+
ir as A3Test,
|
|
614
|
+
ar as A3Text3D,
|
|
615
|
+
le as A3ViewBase,
|
|
616
|
+
Oe as A3Window,
|
|
617
|
+
fe as GeneralCamera,
|
|
618
|
+
sr as initFont,
|
|
619
|
+
or as times2
|
|
197
620
|
};
|