three-low-poly 0.9.5 → 0.9.7
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/index.cjs.js +57 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1648 -696
- package/dist/index.es.js.map +1 -1
- package/dist/index.iife.js +57 -5
- package/dist/index.iife.js.map +1 -1
- package/dist/index.umd.js +57 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("three"),S=require("three/addons/utils/BufferGeometryUtils.js"),j=require("three/addons/objects/Sky.js");class H extends e.Group{constructor(){super();const t=[],s=20,o=new e.SphereGeometry(.1,6,6),n=new e.MeshStandardMaterial({color:16777215,transparent:!0,opacity:.6,roughness:.3,metalness:.3});for(let a=0;a<s;a++){const i=new e.Mesh(o,n);i.position.set((Math.random()-.5)*1.5,Math.random()*3,(Math.random()-.5)*1.5),t.push(i),this.add(i)}function c(){t.forEach(a=>{a.position.y+=.02,a.position.y>3&&(a.position.y=0,a.position.x=(Math.random()-.5)*1.5,a.position.z=(Math.random()-.5)*1.5)})}function r(){requestAnimationFrame(r),c()}r()}}class O extends e.BufferGeometry{constructor(t=2,s=.3,o=.6,n=5,c=5,r=Math.PI/4){super();const a=[],i=[];for(let f=0;f<n;f++){const u=f*s,p=u+s,d=f*o,w=d+o;a.push(-t/2,u,d,t/2,u,d,t/2,p,d,-t/2,p,d,-t/2,p,d,t/2,p,d,t/2,p,w,-t/2,p,w);const G=f*8;i.push(G,G+1,G+2,G,G+2,G+3),i.push(G+4,G+5,G+6,G+4,G+6,G+7)}const l=n*s,m=n*o,M=t*2;a.push(-M/2,l,m,M/2,l,m,M/2,l,m+o,-M/2,l,m+o);const y=n*8;i.push(y,y+1,y+2,y,y+2,y+3);for(let f=0;f<2;f++){const u=f===0?1:-1;for(let p=0;p<c;p++){const d=l+p*s,w=d+s,G=u*(M/4),g=m+o,I=p*o*Math.cos(r),U=p*o*Math.sin(r),b=G+u*I-t/2*Math.cos(r),B=G+u*I+t/2*Math.cos(r),v=g+U,_=b+u*o*Math.cos(r),z=B+u*o*Math.cos(r),T=v+o*Math.sin(r);a.push(b,d,v,B,d,v,B,w,v,b,w,v,b,w,v,B,w,v,z,w,T,_,w,T);const x=y+4+f*c*8+p*8;i.push(x,x+1,x+2,x,x+2,x+3),i.push(x+4,x+5,x+6,x+4,x+6,x+7)}}this.setIndex(i),this.setAttribute("position",new e.Float32BufferAttribute(a,3)),this.computeVertexNormals()}}class Y extends e.BufferGeometry{constructor(t=5,s=3,o=5,n=.2){super();const c=[-t/2,0,-o/2,t/2,0,-o/2,t/2,0,o/2,-t/2,0,o/2,-t/2,0,-o/2,t/2,0,-o/2,t/2,s,-o/2,-t/2,s,-o/2,-t/2,0,-o/2,-t/2,0,o/2,-t/2,s,o/2,-t/2,s,-o/2],r=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11];this.setIndex(r),this.setAttribute("position",new e.Float32BufferAttribute(c,3)),this.computeVertexNormals()}}class Z extends e.BufferGeometry{constructor(t=2,s=.3,o=.5,n=5,c=2){super();const r=[],a=[];for(let M=0;M<n;M++){const y=M*s,f=y+s,u=M*o,p=u+o;r.push(-t/2,y,u,t/2,y,u,t/2,f,u,-t/2,f,u,-t/2,f,u,t/2,f,u,t/2,f,p,-t/2,f,p);const d=M*8;a.push(d,d+1,d+2,d,d+2,d+3),a.push(d+4,d+5,d+6,d+4,d+6,d+7)}const i=n*s,l=n*o;r.push(-t/2,i,l,t/2,i,l,t/2,i,l+c,-t/2,i,l+c);const m=n*8;a.push(m,m+1,m+2,m,m+2,m+3);for(let M=0;M<n;M++){const y=i+M*s,f=y+s,u=-t/2-M*o,p=u-o;r.push(u,y,l+c,u,y,l+c-t,u,f,l+c-t,u,f,l+c,u,f,l+c,u,f,l+c-t,p,f,l+c-t,p,f,l+c);const d=m+4+M*8;a.push(d,d+1,d+2,d,d+2,d+3),a.push(d+4,d+5,d+6,d+4,d+6,d+7)}this.setIndex(a),this.setAttribute("position",new e.Float32BufferAttribute(r,3)),this.computeVertexNormals()}}class X extends e.BufferGeometry{constructor(t=1,s=.4,o=.2,n=20,c=2,r=Math.PI/8){super();const a=[],i=[];let l=0;for(let m=0;m<n;m++){const M=c*Math.cos(l),y=c*Math.sin(l),f=m*o,u=f+o;a.push(M-t/2*Math.cos(l),f,y-t/2*Math.sin(l),M+t/2*Math.cos(l),f,y+t/2*Math.sin(l),M+t/2*Math.cos(l),u,y+t/2*Math.sin(l),M-t/2*Math.cos(l),u,y-t/2*Math.sin(l)),a.push(M-t/2*Math.cos(l),u,y-t/2*Math.sin(l),M+t/2*Math.cos(l),u,y+t/2*Math.sin(l),M+t/2*Math.cos(l)-s*Math.sin(l),u,y+t/2*Math.sin(l)+s*Math.cos(l),M-t/2*Math.cos(l)-s*Math.sin(l),u,y-t/2*Math.sin(l)+s*Math.cos(l));const p=m*8;i.push(p,p+1,p+2,p,p+2,p+3),i.push(p+4,p+5,p+6,p+4,p+6,p+7),l+=r}this.setIndex(i),this.setAttribute("position",new e.Float32BufferAttribute(a,3)),this.computeVertexNormals()}}class J extends e.BufferGeometry{constructor(t=2,s=.3,o=.5,n=10){super();const c=[],r=[];for(let a=0;a<n;a++){const i=a*s,l=i+s,m=a*o,M=m+o;c.push(-t/2,i,m,t/2,i,m,t/2,l,m,-t/2,l,m,-t/2,l,m,t/2,l,m,t/2,l,M,-t/2,l,M);const y=a*8;r.push(y,y+1,y+2,y,y+2,y+3),r.push(y+4,y+6,y+5,y+4,y+7,y+6)}this.setIndex(r),this.setAttribute("position",new e.Float32BufferAttribute(c,3)),this.computeVertexNormals()}}class K extends e.BufferGeometry{constructor(t=.4,s=1.2,o=.2){super();const n=s*.6,c=new e.BoxGeometry(t/2,n,o);c.translate(0,n/2,0);const r=t*1.5,a=new e.BoxGeometry(r,t/4,o);a.translate(0,n*.75,0),this.copy(S.mergeGeometries([c,a],!1))}}class Q extends e.BufferGeometry{constructor(t=1.75,s=.75){super();const o=t*.05,n=t*.15,c=t*.15,r=t*.75;let a=0;const i=new e.BoxGeometry(s,o,s);i.translate(0,a+o/2,0),a+=o;const l=new e.BoxGeometry(s*.8,n,s*.8);l.translate(0,a+n/2,0),a+=n;const m=new e.BoxGeometry(s*.6,c,s*.6);m.translate(0,a+c/2,0),a+=c;const M=new e.BoxGeometry(s*.4,r,s*.4);M.translate(0,a+r/2,0),a+=r;const y=new e.ConeGeometry(s*.4/Math.sqrt(2),.1,4,1,!1,Math.PI/4);y.translate(0,a+.1/2,0),this.copy(S.mergeGeometries([i,l,m,M,y],!1))}}class $ extends e.BufferGeometry{constructor(t=.6,s=1,o=.2){super();const n=s*.7,c=new e.BoxGeometry(t,n,o);c.translate(0,n/2,0);const r=s-n,a=new e.CylinderGeometry(t/2,t/2,o,16,1,!1,0,Math.PI);a.rotateY(Math.PI/2),a.rotateX(Math.PI/2),a.translate(0,n+r/2-o/2-.05,0),this.copy(S.mergeGeometries([c,a],!1))}}class D extends e.BufferGeometry{constructor(t=.5,s=.8,o=.15){super();const n=new e.BoxGeometry(t,s,o);n.translate(0,s/2,0),this.copy(n)}}class R extends e.BufferGeometry{constructor(t=2.25){super();const s=new e.BoxGeometry(1.2,.5,1.2);s.translate(0,.25,0);const o=new e.BoxGeometry(1,t,1);o.translate(0,.5+t/2,0);const n=new e.BoxGeometry(1.4,.3,1.4);n.translate(0,.5+t+.15,0),this.copy(S.mergeGeometries([s,o,n],!1))}}class W extends e.BufferGeometry{constructor(t=2,s=.05,o=.3){super();const n=new e.CylinderGeometry(s,s,t,8);n.translate(0,t/2,0);const c=new e.ConeGeometry(s*1.5,o,8);c.translate(0,t+o/2,0),this.copy(S.mergeGeometries([n,c],!1))}}class ee extends e.BufferGeometry{constructor(t=.1){super();const s=[],o=[],n=[[0,1],[.5,.75],[.75,.25],[.5,-.5],[0,-1],[-.5,-.5],[-.75,.25],[-.5,.75]];for(let r=0;r<n.length;r++){const[a,i]=n[r];s.push(a*t,i*t,0)}for(let r=1;r<n.length-1;r++)o.push(0,r,r+1);o.push(0,n.length-1,1);const c=new e.Float32BufferAttribute(s,3);this.setAttribute("position",c),this.setIndex(o),this.computeVertexNormals()}}class te extends e.BufferGeometry{constructor(t=.1,s=.1,o=.4,n=8){super();const c=new e.CylinderGeometry(t*.6,s*.6,o,n);c.translate(0,0,0);const r=new e.SphereGeometry(t,n,n),a=r.clone(),i=r.clone(),l=r.clone(),m=r.clone();a.translate(0,o/2+t*.6,-t*.6),i.translate(0,o/2+t*.6,t*.6),l.translate(0,-o/2-s*.6,-s*.6),m.translate(0,-o/2-s*.6,s*.6),this.copy(S.mergeGeometries([c,a,i,l,m],!1))}}class V extends e.BufferGeometry{constructor(){super();const t=new e.SphereGeometry(1,16,16),s=new e.CylinderGeometry(.2,.2,2,16,1,!0);s.translate(0,1.5,0),s.rotateX(Math.PI/2),this.copy(S.mergeGeometries([t,s],!1))}}class F extends e.BufferGeometry{constructor(){super();const t=[new e.Vector2(1,0),new e.Vector2(1.2,.5),new e.Vector2(1.4,1.5),new e.Vector2(1.3,1.8),new e.Vector2(.8,1.8)],s=new e.LatheGeometry(t,12),o=new e.CircleGeometry(1,12);o.rotateX(-Math.PI/2),o.translate(0,0,0),this.copy(S.mergeGeometries([s,o],!1))}}class P extends e.BufferGeometry{constructor(t=.2,s=.2,o=3,n=32,c=!0){super();const r=new e.CylinderGeometry(t,s,o,n,1,c),a=new e.SphereGeometry(s,n,n/2,0,Math.PI*2,Math.PI/2,Math.PI/2);a.translate(0,-(o/2),0),this.copy(S.mergeGeometries([r,a],!1))}}class L extends e.BufferGeometry{constructor({radius:t=.5,neckRadius:s=.2,height:o=3,neckHeight:n=1,segments:c=16}={}){super();const r=o-n,a=new e.CylinderGeometry(t,t,r,c);a.translate(0,r/2,0);const i=.3,l=new e.CylinderGeometry(s,t,i,c);l.translate(0,r+i/2,0);const m=new e.CylinderGeometry(s,s,n,c);m.translate(0,r+i+n/2,0),this.copy(S.mergeGeometries([a,l,m],!1))}}class oe extends e.Group{constructor(){super();const t=new e.SphereGeometry(5,32,32),s=new e.ShaderMaterial({uniforms:{time:{value:0}},vertexShader:`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("three"),G=require("three/addons/utils/BufferGeometryUtils.js"),W=require("three/addons/objects/Sky.js"),ee=require("three/addons/postprocessing/EffectComposer.js"),N=require("three/addons/postprocessing/RenderPass.js"),te=require("three/addons/postprocessing/ShaderPass.js"),v={UP:new e.Vector3(0,1,0),DOWN:new e.Vector3(0,-1,0),LEFT:new e.Vector3(-1,0,0),RIGHT:new e.Vector3(1,0,0),FORWARD:new e.Vector3(0,0,1),BACKWARD:new e.Vector3(0,0,-1),X:new e.Vector3(1,0,0),Y:new e.Vector3(0,1,0),Z:new e.Vector3(0,0,1),XY:new e.Vector3(1,1,0).normalize(),XZ:new e.Vector3(1,0,1).normalize(),YZ:new e.Vector3(0,1,1).normalize(),XYZ:new e.Vector3(1,1,1).normalize()},I={LINEAR:(m,t)=>1-m/t,QUADRATIC:(m,t)=>Math.pow(1-m/t,2),SQUARE_ROOT:(m,t)=>Math.pow(1-m/t,.5),LOGARITHMIC:(m,t)=>Math.log(1+(t-m))/Math.log(1+t),SINE:(m,t)=>Math.cos(m/t*Math.PI/2),EXPONENTIAL:(m,t)=>Math.exp(-m/t),CUBIC:(m,t)=>Math.pow(1-m/t,3),GAUSSIAN:(m,t)=>Math.exp(-Math.pow(m,2)/(2*Math.pow(t/3,2))),INVERSE:(m,t)=>t/(t+m),SMOOTHSTEP:(m,t)=>{const o=Math.max(0,Math.min(1,1-m/t));return o*o*(3-2*o)}},oe=(m,t,o,s,c=v.UP,l=I.LINEAR)=>{const n=m.attributes.position;for(let r=0;r<n.count;r++){const i=new e.Vector3;i.fromBufferAttribute(n,r);const a=i.distanceTo(t);if(a<o){const h=l(a,o)*s;i.add(c.clone().multiplyScalar(h)),n.setXYZ(r,i.x,i.y,i.z)}}n.needsUpdate=!0},se=(m,t,o,s,c,l=v.UP,n=I.LINEAR)=>{const r=m.attributes.position;for(let i=0;i<r.count;i++){const a=new e.Vector3;a.fromBufferAttribute(r,i);const u=a.distanceTo(t);if(u<o){const d=n(u,o)*c,M=a.dot(l.normalize()),f=s-M;a.add(l.clone().multiplyScalar(f*d)),r.setXYZ(i,a.x,a.y,a.z)}}r.needsUpdate=!0},ne=(m,t,o,s,c=v.UP,l=I.LINEAR)=>{const n=m.attributes.position;for(let r=0;r<n.count;r++){const i=new e.Vector3;i.fromBufferAttribute(n,r);const a=i.distanceTo(t);if(a<o){const u=l(a,o),h=s*u,d=c.clone().normalize();d.x!==0&&(i.x+=e.MathUtils.randFloatSpread(h)*d.x),d.y!==0&&(i.y+=e.MathUtils.randFloatSpread(h)*d.y),d.z!==0&&(i.z+=e.MathUtils.randFloatSpread(h)*d.z),n.setXYZ(r,i.x,i.y,i.z)}}n.needsUpdate=!0},re=(m,t,o,s)=>{const c=m.attributes.position,l=new e.Vector3;for(let n=0;n<c.count;n++){const r=new e.Vector3;if(r.fromBufferAttribute(c,n),r.distanceTo(t)<o){let a=new e.Vector3,u=0;for(let h=0;h<c.count;h++)l.fromBufferAttribute(c,h),l.distanceTo(r)<o&&(a.add(l),u++);u>0&&(a.divideScalar(u),r.lerp(a,s),c.setXYZ(n,r.x,r.y,r.z))}}c.needsUpdate=!0},ae=(m,t,o,s,c=!1,l=I.LINEAR)=>{const n=m.attributes.position;for(let r=0;r<n.count;r++){const i=new e.Vector3;i.fromBufferAttribute(n,r);const a=i.distanceTo(t);if(a<o){const h=l(a,o)*s*(c?-1:1),d=i.clone().sub(t).normalize();i.add(d.multiplyScalar(h)),n.setXYZ(r,i.x,i.y,i.z)}}n.needsUpdate=!0},ce=(m,t,o,s,c=v.UP,l=I.LINEAR)=>{const n=m.attributes.position,r=new e.Quaternion;for(let i=0;i<n.count;i++){const a=new e.Vector3;a.fromBufferAttribute(n,i);const u=a.distanceTo(t);if(u<o){const d=l(u,o)*s;r.setFromAxisAngle(c,d),a.sub(t).applyQuaternion(r).add(t),n.setXYZ(i,a.x,a.y,a.z)}}n.needsUpdate=!0},ie={LINEAR:m=>m,QUADRATIC_EASE_IN:m=>m*m,QUADRATIC_EASE_OUT:m=>1-Math.pow(1-m,2),SQUARE_ROOT_EASING:m=>Math.sqrt(m),LOGARITHMIC_EASING:m=>Math.log(1+m)/Math.log(2),SINE_EASE_IN:m=>1-Math.cos(m*Math.PI/2),SINE_EASE_OUT:m=>Math.sin(m*Math.PI/2),EXPONENTIAL_EASE_IN:m=>Math.pow(2,10*(m-1)),EXPONENTIAL_EASE_OUT:m=>1-Math.pow(2,-10*m),CUBIC_EASE_IN:m=>m*m*m,CUBIC_EASE_OUT:m=>1-Math.pow(1-m,3),GAUSSIAN_EASING:m=>Math.exp(-Math.pow(m-.5,2)/(2*.1)),INVERSE_EASING:m=>1/(1+m),SMOOTHSTEP_EASING:m=>m*m*(3-2*m)};class le extends e.Group{constructor(){super();const t=[],o=20,s=new e.SphereGeometry(.1,6,6),c=new e.MeshStandardMaterial({color:16777215,transparent:!0,opacity:.6,roughness:.3,metalness:.3});for(let r=0;r<o;r++){const i=new e.Mesh(s,c);i.position.set((Math.random()-.5)*1.5,Math.random()*3,(Math.random()-.5)*1.5),t.push(i),this.add(i)}function l(){t.forEach(r=>{r.position.y+=.02,r.position.y>3&&(r.position.y=0,r.position.x=(Math.random()-.5)*1.5,r.position.z=(Math.random()-.5)*1.5)})}function n(){requestAnimationFrame(n),l()}n()}}class me extends e.BufferGeometry{constructor(t=2,o=.3,s=.6,c=5,l=5,n=Math.PI/4){super();const r=[],i=[];for(let M=0;M<c;M++){const f=M*o,p=f+o,y=M*s,w=y+s;r.push(-t/2,f,y,t/2,f,y,t/2,p,y,-t/2,p,y,-t/2,p,y,t/2,p,y,t/2,p,w,-t/2,p,w);const x=M*8;i.push(x,x+1,x+2,x,x+2,x+3),i.push(x+4,x+5,x+6,x+4,x+6,x+7)}const a=c*o,u=c*s,h=t*2;r.push(-h/2,a,u,h/2,a,u,h/2,a,u+s,-h/2,a,u+s);const d=c*8;i.push(d,d+1,d+2,d,d+2,d+3);for(let M=0;M<2;M++){const f=M===0?1:-1;for(let p=0;p<l;p++){const y=a+p*o,w=y+o,x=f*(h/4),k=u+s,P=p*s*Math.cos(n),g=p*s*Math.sin(n),b=x+f*P-t/2*Math.cos(n),A=x+f*P+t/2*Math.cos(n),B=k+g,J=b+f*s*Math.cos(n),$=A+f*s*Math.cos(n),E=B+s*Math.sin(n);r.push(b,y,B,A,y,B,A,w,B,b,w,B,b,w,B,A,w,B,$,w,E,J,w,E);const S=d+4+M*l*8+p*8;i.push(S,S+1,S+2,S,S+2,S+3),i.push(S+4,S+5,S+6,S+4,S+6,S+7)}}this.setIndex(i),this.setAttribute("position",new e.Float32BufferAttribute(r,3)),this.computeVertexNormals()}}class ue extends e.BufferGeometry{constructor(t=5,o=3,s=5,c=.2){super();const l=[-t/2,0,-s/2,t/2,0,-s/2,t/2,0,s/2,-t/2,0,s/2,-t/2,0,-s/2,t/2,0,-s/2,t/2,o,-s/2,-t/2,o,-s/2,-t/2,0,-s/2,-t/2,0,s/2,-t/2,o,s/2,-t/2,o,-s/2],n=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11];this.setIndex(n),this.setAttribute("position",new e.Float32BufferAttribute(l,3)),this.computeVertexNormals()}}class he extends e.BufferGeometry{constructor(t=2,o=.3,s=.5,c=5,l=2){super();const n=[],r=[];for(let h=0;h<c;h++){const d=h*o,M=d+o,f=h*s,p=f+s;n.push(-t/2,d,f,t/2,d,f,t/2,M,f,-t/2,M,f,-t/2,M,f,t/2,M,f,t/2,M,p,-t/2,M,p);const y=h*8;r.push(y,y+1,y+2,y,y+2,y+3),r.push(y+4,y+5,y+6,y+4,y+6,y+7)}const i=c*o,a=c*s;n.push(-t/2,i,a,t/2,i,a,t/2,i,a+l,-t/2,i,a+l);const u=c*8;r.push(u,u+1,u+2,u,u+2,u+3);for(let h=0;h<c;h++){const d=i+h*o,M=d+o,f=-t/2-h*s,p=f-s;n.push(f,d,a+l,f,d,a+l-t,f,M,a+l-t,f,M,a+l,f,M,a+l,f,M,a+l-t,p,M,a+l-t,p,M,a+l);const y=u+4+h*8;r.push(y,y+1,y+2,y,y+2,y+3),r.push(y+4,y+5,y+6,y+4,y+6,y+7)}this.setIndex(r),this.setAttribute("position",new e.Float32BufferAttribute(n,3)),this.computeVertexNormals()}}class de extends e.BufferGeometry{constructor(t=1,o=.4,s=.2,c=20,l=2,n=Math.PI/8){super();const r=[],i=[];let a=0;for(let u=0;u<c;u++){const h=l*Math.cos(a),d=l*Math.sin(a),M=u*s,f=M+s;r.push(h-t/2*Math.cos(a),M,d-t/2*Math.sin(a),h+t/2*Math.cos(a),M,d+t/2*Math.sin(a),h+t/2*Math.cos(a),f,d+t/2*Math.sin(a),h-t/2*Math.cos(a),f,d-t/2*Math.sin(a)),r.push(h-t/2*Math.cos(a),f,d-t/2*Math.sin(a),h+t/2*Math.cos(a),f,d+t/2*Math.sin(a),h+t/2*Math.cos(a)-o*Math.sin(a),f,d+t/2*Math.sin(a)+o*Math.cos(a),h-t/2*Math.cos(a)-o*Math.sin(a),f,d-t/2*Math.sin(a)+o*Math.cos(a));const p=u*8;i.push(p,p+1,p+2,p,p+2,p+3),i.push(p+4,p+5,p+6,p+4,p+6,p+7),a+=n}this.setIndex(i),this.setAttribute("position",new e.Float32BufferAttribute(r,3)),this.computeVertexNormals()}}class fe extends e.BufferGeometry{constructor(t=2,o=.3,s=.5,c=10){super();const l=[],n=[];for(let r=0;r<c;r++){const i=r*o,a=i+o,u=r*s,h=u+s;l.push(-t/2,i,u,t/2,i,u,t/2,a,u,-t/2,a,u,-t/2,a,u,t/2,a,u,t/2,a,h,-t/2,a,h);const d=r*8;n.push(d,d+1,d+2,d,d+2,d+3),n.push(d+4,d+6,d+5,d+4,d+7,d+6)}this.setIndex(n),this.setAttribute("position",new e.Float32BufferAttribute(l,3)),this.computeVertexNormals()}}class F extends e.BufferGeometry{constructor(t=1,o=1.5,s=.5,c=.05,l=.05){super();const n=t,r=o,i=s,a=c,u=l,h=[0,0,0,n,0,0,n,r,0,0,r,0,n,0,-i,0,0,-i,0,r,-i,n,r,-i,0,0,-i,0,0,0,0,r,0,0,r,-i,n,0,-a,a,0,-a,a,r,-a,n,r,-a,a,0,-i+a,n,0,-i+a,n,r,-i+a,a,r,-i+a,a,0,-a,a,0,-i+a,a,r,-i+a,a,r,-a,0,r,0,n,r,0,n,r,-a,a,r,-a,0,r,-i,a,r,-i+a,n,r,-i+a,n,r,-i,0,r,0,a,r,-a,a,r,-i+a,0,r,-i,0,0,0,a,0,-a,n,0,-a,n,0,0,0,0,-i,n,0,-i,n,0,-i+a,a,0,-i+a,0,0,0,0,0,-i,a,0,-i+a,a,0,-a,n,0,0,n,0,-a,n,r,-a,n,r,0,n,0,-i,n,r,-i,n,r,-i+a,n,0,-i+a],d=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0],M=t/(t*2+s),f=(t+s)/(t*2+s),p=[f,0,1,0,1,1,f,1,0,0,M,0,M,1,0,1,M,0,f,0,f,1,M,1,1,0,f,0,f,1,1,1,M,0,0,0,0,1,M,1,f,0,M,0,M,1,f,1,f,0,1,0,1,1,f,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1],y=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23,24,25,26,24,26,27,28,29,30,28,30,31,32,33,34,32,34,35,36,37,38,36,38,39,40,41,42,40,42,43,44,45,46,44,46,47,48,49,50,48,50,51,52,53,54,52,54,55],w=new Float32Array(h),x=new Float32Array(d),k=new Float32Array(p),P=new Uint16Array(y),g=new e.BufferGeometry;g.setAttribute("position",new e.BufferAttribute(w,3)),g.setAttribute("normal",new e.BufferAttribute(x,3)),g.setAttribute("uv",new e.BufferAttribute(k,2)),g.setIndex(new e.BufferAttribute(P,1));const b=new e.BoxGeometry(t-a-u,r-u*2,i-a*2);b.translate((t-a-u)/2+a,r/2,-i/2),this.copy(G.mergeGeometries([g,b],!0))}}class U extends e.BufferGeometry{constructor(t=.4,o=1.2,s=.2){super();const c=o*.6,l=new e.BoxGeometry(t/2,c,s);l.translate(0,c/2,0);const n=t*1.5,r=new e.BoxGeometry(n,t/4,s);r.translate(0,c*.75,0),this.copy(G.mergeGeometries([l,r],!1)),this.computeVertexNormals()}}class L extends e.BufferGeometry{constructor(t=1.75,o=.75){super();const s=t*.05,c=t*.15,l=t*.15,n=t*.75;let r=0;const i=new e.BoxGeometry(o,s,o);i.translate(0,r+s/2,0),r+=s;const a=new e.BoxGeometry(o*.8,c,o*.8);a.translate(0,r+c/2,0),r+=c;const u=new e.BoxGeometry(o*.6,l,o*.6);u.translate(0,r+l/2,0),r+=l;const h=new e.BoxGeometry(o*.4,n,o*.4);h.translate(0,r+n/2,0),r+=n;const d=new e.ConeGeometry(o*.4/Math.sqrt(2),.1,4,1,!1,Math.PI/4);d.translate(0,r+.1/2,0),this.copy(G.mergeGeometries([i,a,u,h,d],!1)),this.computeVertexNormals()}}class _ extends e.BufferGeometry{constructor(t=.6,o=1,s=.2,c=.6){super();const l=o-c/2,n=new e.BoxGeometry(t,l,s);n.translate(0,l/2,0);const r=new e.CylinderGeometry(c/2,c/2,s,16,1,!1,0,Math.PI);r.rotateY(Math.PI/2),r.rotateX(Math.PI/2),r.translate(0,l,0),this.copy(G.mergeGeometries([n,r],!1)),this.computeVertexNormals()}}class z extends e.BufferGeometry{constructor(t=.5,o=.8,s=.15){super();const c=new e.BoxGeometry(t,o,s);c.translate(0,o/2,0),this.copy(c)}}class Me extends e.BufferGeometry{constructor(t=2.25){super();const o=new e.BoxGeometry(1.2,.5,1.2);o.translate(0,.25,0);const s=new e.BoxGeometry(1,t,1);s.translate(0,.5+t/2,0);const c=new e.BoxGeometry(1.4,.3,1.4);c.translate(0,.5+t+.15,0),this.copy(G.mergeGeometries([o,s,c],!1))}}class ye extends e.BufferGeometry{constructor(t=2,o=.05,s=.3){super();const c=new e.CylinderGeometry(o,o,t,8);c.translate(0,t/2,0);const l=new e.ConeGeometry(o*1.5,s,8);l.translate(0,t+s/2,0),this.copy(G.mergeGeometries([c,l],!1))}}class pe extends e.BufferGeometry{constructor(t=.1){super();const o=[],s=[],c=[[0,1],[.5,.75],[.75,.25],[.5,-.5],[0,-1],[-.5,-.5],[-.75,.25],[-.5,.75]];for(let n=0;n<c.length;n++){const[r,i]=c[n];o.push(r*t,i*t,0)}for(let n=1;n<c.length-1;n++)s.push(0,n,n+1);s.push(0,c.length-1,1);const l=new e.Float32BufferAttribute(o,3);this.setAttribute("position",l),this.setIndex(s),this.computeVertexNormals()}}function q(m,t=v.XYZ,o=.5,s=2){m.deleteAttribute("uv"),m.deleteAttribute("normal"),m=G.mergeVertices(m),m.computeVertexNormals();const c=m.getAttribute("position");for(let l=0;l<c.count;l++){const n=new e.Vector3().fromBufferAttribute(c,l),r=Math.random()*(s-o)+o,i=t.clone().multiplyScalar(r);n.add(i),c.setXYZ(l,n.x,n.y,n.z)}return c.needsUpdate=!0,m.computeVertexNormals(),m}class O extends e.BufferGeometry{constructor(t=1,o=4,s=4){super();const c=new e.SphereGeometry(t,o,s);this.copy(q(c,v.XYZ,.5,1)),this.computeVertexNormals(),this.center()}}class xe extends e.BufferGeometry{constructor(t=.1,o=.1,s=.4,c=8){super();const l=new e.CylinderGeometry(t*.6,o*.6,s,c);l.translate(0,0,0);const n=new e.SphereGeometry(t,c,c),r=n.clone(),i=n.clone(),a=n.clone(),u=n.clone();r.translate(0,s/2+t*.6,-t*.6),i.translate(0,s/2+t*.6,t*.6),a.translate(0,-s/2-o*.6,-o*.6),u.translate(0,-s/2-o*.6,o*.6),this.copy(G.mergeGeometries([l,r,i,a,u],!1))}}class D extends e.BufferGeometry{constructor(){super();const t=new e.SphereGeometry(1,16,16),o=new e.CylinderGeometry(.2,.2,2,16,1,!0);o.translate(0,1.5,0),o.rotateX(Math.PI/2),this.copy(G.mergeGeometries([t,o],!1))}}class X extends e.BufferGeometry{constructor(){super();const t=[new e.Vector2(1,0),new e.Vector2(1.2,.5),new e.Vector2(1.4,1.5),new e.Vector2(1.3,1.8),new e.Vector2(.8,1.8)],o=new e.LatheGeometry(t,12),s=new e.CircleGeometry(1,12);s.rotateX(-Math.PI/2),s.translate(0,0,0),this.copy(G.mergeGeometries([o,s],!1))}}class C extends e.BufferGeometry{constructor(t=.2,o=.2,s=3,c=32,l=!0){super();const n=new e.CylinderGeometry(t,o,s,c,1,l),r=new e.SphereGeometry(o,c,c/2,0,Math.PI*2,Math.PI/2,Math.PI/2);r.translate(0,-(s/2),0),this.copy(G.mergeGeometries([n,r],!1))}}class Y extends e.BufferGeometry{constructor({radius:t=.5,neckRadius:o=.2,height:s=3,neckHeight:c=1,segments:l=16}={}){super();const n=s-c,r=new e.CylinderGeometry(t,t,n,l);r.translate(0,n/2,0);const i=.3,a=new e.CylinderGeometry(o,t,i,l);a.translate(0,n+i/2,0);const u=new e.CylinderGeometry(o,o,c,l);u.translate(0,n+i+c/2,0),this.copy(G.mergeGeometries([r,a,u],!1))}}class H extends e.BufferGeometry{constructor({trunkRadiusTop:t=.25,trunkRadiusBottom:o=.4,trunkHeight:s=2.5,trunkSegments:c=14,leafSize:l=.8,leafCount:n=6,leafDetail:r=0,leafSpreadRadius:i=1.5}={}){super();const a=new e.CylinderGeometry(t,o,s,c);a.translate(0,s/2,0);const u=[];for(let h=0;h<n;h++){const d=new e.DodecahedronGeometry(l,r);d.translate((Math.random()-.5)*i,(Math.random()-.5)*l+s,(Math.random()-.5)*i),u.push(d)}this.copy(G.mergeGeometries([a.toNonIndexed(),G.mergeGeometries(u,!1)],!0)),this.computeVertexNormals()}}class we extends e.Group{constructor(){super();const t=new e.SphereGeometry(5,32,32),o=new e.ShaderMaterial({uniforms:{time:{value:0}},vertexShader:`
|
|
2
2
|
varying vec3 vNormal;
|
|
3
3
|
varying vec3 vPosition;
|
|
4
4
|
void main() {
|
|
@@ -35,7 +35,59 @@
|
|
|
35
35
|
color *= 0.8 + 0.2 * n; // Modulate color by noise
|
|
36
36
|
gl_FragColor = vec4(color, 1.0);
|
|
37
37
|
}
|
|
38
|
-
`}),o=new e.Mesh(t,s);this.add(o)}}class se extends e.Group{constructor(){super();const t=new e.BoxGeometry(5,1,5),s=new e.MeshStandardMaterial({color:8421504,flatShading:!0}),o=new e.Mesh(t,s);o.position.set(0,.5,0),this.add(o);const n=new e.BoxGeometry(4,3,4),c=new e.MeshStandardMaterial({color:6908265,flatShading:!0}),r=new e.Mesh(n,c);r.position.set(0,2.5,0),this.add(r);const a=new e.ConeGeometry(3.5,2,4),i=new e.MeshStandardMaterial({color:5263440,flatShading:!0}),l=new e.Mesh(a,i);l.rotation.y=Math.PI/4,l.position.set(0,5,0),this.add(l);const m=new e.CylinderGeometry(.2,.2,3.5,16),M=new e.MeshStandardMaterial({color:6908265,flatShading:!0});[[-1.8,2.3,-2.2],[1.8,2.3,-2.2],[-1.8,2.3,2.2],[1.8,2.3,2.2]].forEach(G=>{const g=new e.Mesh(m,M);g.position.set(...G),this.add(g)});const f=new e.Shape;f.moveTo(-1,0),f.lineTo(-1,2),f.absarc(0,2,1,Math.PI,0,!0),f.lineTo(1,0);const u={depth:.5,bevelEnabled:!1},p=new e.ExtrudeGeometry(f,u),d=new e.MeshStandardMaterial({color:4210752,flatShading:!0}),w=new e.Mesh(p,d);w.position.set(0,.5,1.7),this.add(w)}}class ne extends e.Group{constructor(){super();const t=new e.BoxGeometry(5,.3,3),s=new e.MeshStandardMaterial({color:9132587}),o=new e.Mesh(t,s);o.position.set(0,3.15,0);const n=[];n.push(new e.Vector2(.2,0)),n.push(new e.Vector2(.25,.5)),n.push(new e.Vector2(.15,1.5)),n.push(new e.Vector2(.3,3));const c=new e.LatheGeometry(n,32),r=new e.MeshStandardMaterial({color:4929057});[[2.2,0,1.2],[-2.2,0,1.2],[2.2,0,-1.2],[-2.2,0,-1.2]].forEach(i=>{const l=new e.Mesh(c,r);l.position.set(...i),this.add(l)}),this.add(o)}}class re extends e.Group{constructor(t=1,s=.2){super(),this.height=t,this.radius=s,this.createCandle(),this.animateFlicker()}createCandle(){const t=new e.CylinderGeometry(this.radius,this.radius,this.height,32),s=new e.MeshStandardMaterial({color:16777215});this.candle=new e.Mesh(t,s),this.candle.position.set(0,this.height/2,0),this.add(this.candle);const o=new e.SphereGeometry(.05,16,16),n=new e.MeshBasicMaterial({color:16753920});this.flame=new e.Mesh(o,n),this.flame.position.set(0,this.height+.05,0),this.add(this.flame),this.candleLight=new e.PointLight(16753920,1,5),this.candleLight.position.set(0,this.height+.05,0),this.candleLight.castShadow=!0,this.add(this.candleLight)}animateFlicker(){const t=()=>{this.candleLight.intensity=1+(Math.random()*.4-.2),this.candleLight.position.x=Math.random()*.02-.01,this.candleLight.position.z=Math.random()*.02-.01,requestAnimationFrame(t)};t()}}class ae extends e.Group{constructor(t=1.3,s=.5){super();const o=new e.CylinderGeometry(s,s,.2,16),n=new e.MeshStandardMaterial({color:9127187,flatShading:!0}),c=new e.Mesh(o,n);c.position.set(0,0,0),this.add(c);const r=new e.CylinderGeometry(s*.9,s*.9,t),a=new e.MeshStandardMaterial({color:16766720,flatShading:!0,transparent:!0,opacity:.6}),i=new e.Mesh(r,a);i.position.set(0,t/2+.1,0),this.add(i);const l=new e.ConeGeometry(s*1.1,.5,8),m=new e.MeshStandardMaterial({color:9127187,flatShading:!0}),M=new e.Mesh(l,m);M.position.set(0,t+.35,0),this.add(M);const y=new e.TorusGeometry(s*.8,.05,8,16),f=new e.MeshStandardMaterial({color:9127187,flatShading:!0}),u=new e.Mesh(y,f);u.position.set(0,t+.85,0),this.add(u);const p=new e.PointLight(16755200,1.5,15);p.position.set(0,t/2+.1,0),p.castShadow=!0,this.add(p)}}class ce extends e.Group{constructor(){super();const t=new e.DodecahedronGeometry(1,0),s=new e.MeshStandardMaterial({color:8421504,flatShading:!0}),o=new e.MeshStandardMaterial({color:4950843,flatShading:!0,opacity:.8,transparent:!0});for(let n=0;n<5;n++){const c=new e.Mesh(t,s);c.scale.set(.8+Math.random()*.4,.8+Math.random()*.4,.8+Math.random()*.4),c.rotation.set(Math.random()*Math.PI,Math.random()*Math.PI,Math.random()*Math.PI),c.position.set((Math.random()-.5)*4,0,(Math.random()-.5)*4),this.add(c);const r=new e.Mesh(t,o);r.scale.set(c.scale.x*.9,c.scale.y*.5,c.scale.z*.9),r.rotation.copy(c.rotation),r.position.copy(c.position),r.position.y+=.3,this.add(r)}}}class ie extends e.Group{constructor(){super();const t=new e.DodecahedronGeometry(1,0),s=new e.MeshStandardMaterial({color:8421504,flatShading:!0});for(let o=0;o<5;o++){const n=new e.Mesh(t,s);n.scale.set(.8+Math.random()*.4,.8+Math.random()*.4,.8+Math.random()*.4),n.rotation.set(Math.random()*Math.PI,Math.random()*Math.PI,Math.random()*Math.PI),n.position.set((Math.random()-.5)*4,0,(Math.random()-.5)*4),this.add(n)}}}class le extends e.Group{constructor(){super();const t=new V,s=new e.MeshPhysicalMaterial({color:8965375,transparent:!0,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,side:e.DoubleSide}),o=new e.Mesh(t,s);o.rotation.x=-Math.PI/2,this.add(o)}}class me extends e.Group{constructor(){super();const t=new e.BoxGeometry(1.6,.05,2.1),s=new e.MeshStandardMaterial({color:9109504}),o=new e.Mesh(t,s),n=new e.Mesh(t,s);o.position.set(0,.125,0),n.position.set(0,-.125,0);const c=new e.BoxGeometry(1.55,.2,2),r=new e.MeshStandardMaterial({color:16777215}),a=new e.Mesh(c,r);a.position.set(-.025,0,0);const i=new e.BoxGeometry(.05,.25,2.1),l=new e.MeshStandardMaterial({color:4915200}),m=new e.Mesh(i,l);m.position.set(-.8,0,0),this.add(o),this.add(n),this.add(a),this.add(m)}}class he extends e.Group{constructor(){super();const t=[new e.Vector2(0,0),new e.Vector2(.8,0),new e.Vector2(1,1.5),new e.Vector2(.5,2.2),new e.Vector2(.6,2.5)],s=new e.LatheGeometry(t,10),o=new e.CylinderGeometry(.3,.4,.2,8),n=new e.MeshStandardMaterial({color:8965375,transparent:!0,opacity:.5,roughness:.1,metalness:.3}),c=new e.MeshStandardMaterial({color:16724838,transparent:!0,opacity:.6}),r=new e.MeshStandardMaterial({color:9127187,roughness:1}),a=new e.Mesh(s,n),i=new e.Mesh(s,c),l=new e.Mesh(o,r);i.scale.set(.8,.8,.8),i.position.y=.1,l.position.y=2.5;const m=new e.Group;m.add(a,i,l),this.add(m)}}class Me extends e.Group{constructor(){super();const t=new e.CylinderGeometry(.3,.4,.1,16),s=new e.MeshStandardMaterial({color:3355443,roughness:.6,metalness:.3}),o=new e.Mesh(t,s);o.position.y=.05;const n=new e.CylinderGeometry(.1,.1,.7,16),c=new e.MeshStandardMaterial({color:5592405,roughness:.5,metalness:.4}),r=new e.Mesh(n,c);r.position.y=.4;const a=new e.ConeGeometry(.075,.2,16),i=new e.MeshStandardMaterial({color:16733440,emissive:16733440,emissiveIntensity:.6,transparent:!0,opacity:.8}),l=new e.Mesh(a,i);l.position.y=.8,this.add(o,r,l)}}class ye extends e.Group{constructor(){super();const t=new e.BoxGeometry(3,4,.1),s=new e.MeshStandardMaterial({color:3026478,roughness:.8,metalness:.6}),o=new e.BoxGeometry(.2,.5,.2),n=new e.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7}),c=new e.CylinderGeometry(.3,.3,.1,16),r=new e.MeshStandardMaterial({color:5592405,roughness:.7,metalness:.5}),a=new e.Mesh(t,s);for(let d=-1;d<=1;d++){const w=new e.Mesh(o,n);w.position.set(d,1.5,.1),a.add(w)}const i=new e.Mesh(c,r);i.rotation.x=Math.PI/2,i.position.set(0,.5,.15),a.add(i);const l=new e.SphereGeometry(.15,8,8),m=new e.MeshStandardMaterial({color:16711680,emissive:16711680,emissiveIntensity:.5}),M=new e.Mesh(l,m);M.position.set(0,-1,.1),a.add(M),this.add(a);let y=.015,f=.8,u=.2;function p(){requestAnimationFrame(p);const d=u+Math.abs(Math.sin(Date.now()*y))*(f-u);M.material.emissiveIntensity=d}p()}}class de extends e.Group{constructor(){super();const t=[new e.Vector2(0,0),new e.Vector2(1.2,0),new e.Vector2(1.5,1.5),new e.Vector2(1,3),new e.Vector2(.6,3.5)],s=new e.LatheGeometry(t,12),o=new e.CylinderGeometry(.6,.7,.3,8),n=new e.MeshStandardMaterial({color:8965290,transparent:!0,opacity:.4,roughness:.1,metalness:.5}),c=new e.MeshStandardMaterial({color:9127187,roughness:1}),r=new e.Mesh(s,n),a=new e.Mesh(o,c);a.position.y=3.5,this.add(r,a)}}class ue extends e.Group{constructor(){super();const t=new e.BoxGeometry(2,3,.1),s=new e.MeshStandardMaterial({color:3355443,roughness:.8,metalness:.5}),o=new e.Mesh(t,s),n=new e.CylinderGeometry(.1,.1,.2,8),c=new e.CylinderGeometry(.05,.05,1,8),r=new e.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7});for(let a=-.5;a<=.5;a+=.5){const i=new e.Mesh(n,r);i.position.set(a,1,.1);const l=new e.Mesh(c,r);l.position.y=.5,i.add(l),this.add(i)}this.add(o)}}class fe extends e.Group{constructor(){super();const t=new e.BoxGeometry(1,.2,.5),s=new e.MeshStandardMaterial({color:4473924,roughness:.6,metalness:.3}),o=new e.Mesh(t,s);o.position.y=.1;const n=new e.BoxGeometry(.2,1,.2),c=new e.Mesh(n,s);c.position.set(0,.6,-.2);const r=new e.CylinderGeometry(.1,.1,.4,8),a=new e.MeshStandardMaterial({color:3355443,roughness:.5,metalness:.6}),i=new e.Mesh(r,a);i.position.set(0,1.1,-.35),i.rotation.x=-Math.PI/4;const l=new e.BoxGeometry(.6,.1,.6),m=new e.MeshStandardMaterial({color:5592405,roughness:.8,metalness:.2}),M=new e.Mesh(l,m);M.position.set(0,.6,0),this.add(o,c,i,M)}}class pe extends e.Group{constructor(){super();const t=new F,s=new e.CylinderGeometry(.2,.3,1.5,8);s.translate(0,.75,0);const o=new e.MeshStandardMaterial({color:6045747,roughness:1,metalness:0,side:e.DoubleSide}),n=new e.MeshStandardMaterial({color:9132587,roughness:.8,metalness:.1}),c=new e.Mesh(t,o),r=new e.Mesh(s,n);r.position.set(.3,1.3,0),r.rotation.z=Math.PI/4,this.add(c,r)}}class Ge extends e.Group{constructor(){super();const t=100,s=.05,o=new e.CatmullRomCurve3(Array.from({length:t},(l,m)=>{const M=m*.2;return new e.Vector3(Math.cos(M)*.4,m*s,Math.sin(M)*.4)})),n=new e.TubeGeometry(o,200,.1,8,!1),c=new e.MeshStandardMaterial({color:8965375,transparent:!0,opacity:.3,roughness:.1,metalness:.2,emissive:8965375}),r=new e.Mesh(n,c);this.add(r);function a(){c.emissiveIntensity=.2+Math.sin(Date.now()*.005)*.1}function i(){requestAnimationFrame(i),a()}i()}}class we extends e.Group{constructor(){super();const t=new e.TorusGeometry(.3,.03,8,16),s=new e.MeshStandardMaterial({color:8947848,roughness:.7,metalness:.3}),o=new e.Mesh(t,s);o.rotation.x=Math.PI/2,o.position.y=.4;const n=new e.CylinderGeometry(.02,.02,.4,8),c=new e.MeshStandardMaterial({color:6710886,roughness:.8,metalness:.3}),r=[];for(let a=0;a<3;a++){const i=a/3*Math.PI*2,l=new e.Mesh(n,c);l.position.set(Math.cos(i)*.25,.2,Math.sin(i)*.25),r.push(l)}this.add(o,...r)}}class xe extends e.Group{constructor(){super();const t=new e.CylinderGeometry(.5,.6,.3,16),s=new e.MeshStandardMaterial({color:3355443,roughness:.6,metalness:.5}),o=new e.Mesh(t,s);o.position.y=.15;const n=new e.CylinderGeometry(.15,.15,2,12,1,!0),c=new e.MeshStandardMaterial({color:16737792,roughness:.5,metalness:.8,side:e.DoubleSide}),r=new e.Mesh(n,c);r.position.y=1.3;const a=new e.SphereGeometry(.3,16,16),i=new e.Mesh(a,c);i.position.y=2.4,this.add(o,r,i);const l=[];for(let y=0;y<5;y++){const f=new e.LineBasicMaterial({color:10079487}),u=[new e.Vector3(0,2.4,0),new e.Vector3((Math.random()-.5)*1.5,Math.random()*2.4,(Math.random()-.5)*1.5)],p=new e.BufferGeometry().setFromPoints(u),d=new e.Line(p,f);this.add(d),l.push(d)}function m(){l.forEach(y=>{const f=[new e.Vector3(0,2.4,0),new e.Vector3((Math.random()-.5)*1.5,Math.random()*2.4,(Math.random()-.5)*1.5)];y.geometry.setFromPoints(f)})}function M(){requestAnimationFrame(M),m()}M()}}class Se extends e.Group{constructor(t=.2,s=.2,o=3,n=32){super();const c=new P(t,s,o,n),r=new e.MeshPhysicalMaterial({color:8965375,transparent:!0,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,side:e.DoubleSide}),a=new e.Mesh(c,r);this.add(a)}}class ve extends e.Group{constructor(t=3,s=[65450,16711850,11141375]){super();const o=new e.BoxGeometry(3,.2,1),n=new e.MeshStandardMaterial({color:9127187,roughness:.7,metalness:.3}),c=new e.Mesh(o,n);c.position.y=.5;const r=new P(.1,.1,1,16),a=new e.MeshStandardMaterial({color:11184810,transparent:!0,opacity:.4,roughness:.1,metalness:.5,side:e.DoubleSide});for(let i=0;i<t;i++){const l=new e.Mesh(r,a),m=(i-(t-1)/2)*.8;l.position.set(m,1,0);const M=new P(.099,.099,.5,16,!1),y=s[i%s.length],f=new e.MeshStandardMaterial({color:y,emissive:y,emissiveIntensity:.5,transparent:!0,opacity:.6}),u=new e.Mesh(M,f);u.position.set(0,-.25,0),l.add(u),c.add(l)}this.add(c)}}class ge extends e.Mesh{constructor(){super();const t=new L,s=new e.MeshPhysicalMaterial({color:5597999,roughness:.1,transmission:.9,thickness:.2,metalness:0,clearcoat:1,clearcoatRoughness:.1});this.geometry=t,this.material=s}}class q extends e.Shape{constructor(t=5,s=.5,o=1){super();const n=Math.PI*2/t,c=n/2,r=n/4;this.moveTo(Math.cos(0)*o,-Math.sin(0)*o);for(let a=1;a<=t;++a){let i=Math.cos(n*a-r*3)*(s/Math.cos(r)),l=-Math.sin(n*a-r*3)*(s/Math.cos(r)),m=Math.cos(n*a-c)*s,M=-Math.sin(n*a-c)*s;this.quadraticCurveTo(i,l,m,M),i=Math.cos(n*a-r)*(s/Math.cos(r)),l=-Math.sin(n*a-r)*(s/Math.cos(r)),m=Math.cos(n*a)*o,M=-Math.sin(n*a)*o,this.quadraticCurveTo(i,l,m,M)}this.closePath()}}class be extends e.Mesh{constructor(t=5,s=.5,o=1,n=.25){super();const c=new q(t,s,o),r=new e.ExtrudeGeometry(c,{depth:n,bevelEnabled:n>0,bevelThickness:0,bevelSize:0}),a=new e.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});r.center(),this.geometry=r,this.material=a}}class A extends e.Shape{constructor(t=5,s=.5,o=1,n=5,c=.25){super();const r=Math.PI*2/t,a=r/4;this.moveTo(Math.cos(0)*o,-Math.sin(0)*o);for(let i=1;i<=t;++i)this.lineTo(Math.cos(r*i-a*3)*s,-Math.sin(r*i-a*3)*s),this.lineTo(Math.cos(r*i-a*2)*s,-Math.sin(r*i-a*2)*s),this.lineTo(Math.cos(r*i-a)*o,-Math.sin(r*i-a)*o),this.lineTo(Math.cos(r*i)*o,-Math.sin(r*i)*o);if(this.closePath(),c>0&&n>2){const i=new e.Path,l=Math.PI*2/n;i.moveTo(Math.cos(0)*c,-Math.sin(0)*c);for(let m=1;m<n;++m)i.lineTo(Math.cos(l*m)*c,-Math.sin(l*m)*c);i.lineTo(Math.cos(0)*c,-Math.sin(0)*c),this.holes.push(i)}}}class Be extends e.Mesh{constructor(t=5,s=.5,o=1,n=5,c=.25,r=.25){super();const a=new A(t,s,o,n,c),i=new e.ExtrudeGeometry(a,{depth:r,bevelEnabled:r>0,bevelThickness:0,bevelSize:0}),l=new e.MeshStandardMaterial({color:11184810,metalness:.8,roughness:.2,reflectivity:.5});i.center(),this.geometry=i,this.material=l}}class E extends e.Shape{constructor(t=1,s=2.1,o=1.4,n=1.6){super(),this.moveTo(0,o*t/3),this.bezierCurveTo(-s*.375*t,o*t,-s*t,o*t/3,0,-n*t),this.bezierCurveTo(s*t,o*t/3,s*.375*t,o*t,0,o*t/3)}}class ke extends e.Mesh{constructor(t=1,s=1,o=1,n=10,c=.25){super();const r=new E(t,s,o,n),a=new e.ExtrudeGeometry(r,{depth:c,bevelEnabled:c>0,bevelThickness:0,bevelSize:0}),i=new e.MeshStandardMaterial({color:12986408,emissive:12981270,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});a.center(),this.geometry=a,this.material=i}}class N extends e.Shape{constructor(t=5,s=.5,o=1){super();const n=Math.PI*2/t,c=n/2;this.moveTo(Math.cos(0)*o,Math.sin(0)*o);for(let r=1;r<=t;++r)this.lineTo(Math.cos(n*r-c)*s,Math.sin(n*r-c)*s),this.lineTo(Math.cos(n*r)*o,Math.sin(n*r)*o);this.closePath()}}class Pe extends e.Mesh{constructor(t=5,s=.5,o=1,n=.25){super();const c=new N(t,s,o),r=new e.ExtrudeGeometry(c,{depth:n,bevelEnabled:n>0,bevelThickness:0,bevelSize:0}),a=new e.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});r.center(),this.geometry=r,this.material=a}}const C={uniforms:{},vertexShader:`
|
|
38
|
+
`}),s=new e.Mesh(t,o);this.add(s)}}class Ge extends e.Mesh{constructor({width:t=1,height:o=1.5,depth:s=.5,coverThickness:c=.05,pageIndent:l=.05,coverColor:n=9109504,pageColor:r=16777215}={}){super(),this.geometry=new F(t,o,s,c,l),this.material=[new e.MeshStandardMaterial({color:n,metalness:.1,roughness:.7,flatShading:!0}),new e.MeshStandardMaterial({color:r,flatShading:!0})]}}class Se extends e.Mesh{constructor(t=.4,o=1.2,s=.2){super(),this.geometry=new U(t,o,s),this.material=new e.MeshStandardMaterial({color:7829367,roughness:.8})}}class ve extends e.Group{constructor(){super();const t=new e.BoxGeometry(5,1,5),o=new e.MeshStandardMaterial({color:8421504,flatShading:!0}),s=new e.Mesh(t,o);s.position.set(0,.5,0),this.add(s);const c=new e.BoxGeometry(4,3,4),l=new e.MeshStandardMaterial({color:6908265,flatShading:!0}),n=new e.Mesh(c,l);n.position.set(0,2.5,0),this.add(n);const r=new e.ConeGeometry(3.5,2,4),i=new e.MeshStandardMaterial({color:5263440,flatShading:!0}),a=new e.Mesh(r,i);a.rotation.y=Math.PI/4,a.position.set(0,5,0),this.add(a);const u=new e.CylinderGeometry(.2,.2,3.5,16),h=new e.MeshStandardMaterial({color:6908265,flatShading:!0});[[-1.8,2.3,-2.2],[1.8,2.3,-2.2],[-1.8,2.3,2.2],[1.8,2.3,2.2]].forEach(x=>{const k=new e.Mesh(u,h);k.position.set(...x),this.add(k)});const M=new e.Shape;M.moveTo(-1,0),M.lineTo(-1,2),M.absarc(0,2,1,Math.PI,0,!0),M.lineTo(1,0);const f={depth:.5,bevelEnabled:!1},p=new e.ExtrudeGeometry(M,f),y=new e.MeshStandardMaterial({color:4210752,flatShading:!0}),w=new e.Mesh(p,y);w.position.set(0,.5,1.7),this.add(w)}}class ge extends e.Mesh{constructor(t=1.75,o=.75){super(),this.geometry=new L(t,o),this.material=new e.MeshStandardMaterial({color:7829367,roughness:.8})}}class be extends e.Mesh{constructor(t=.6,o=1,s=.2,c=.6){super(),this.geometry=new _(t,o,s,c),this.material=new e.MeshStandardMaterial({color:7829367,roughness:.8})}}class Be extends e.Mesh{constructor(t=.5,o=.8,s=.15){super(),this.geometry=new z(t,o,s),this.material=new e.MeshStandardMaterial({color:7829367,roughness:.8})}}class ke extends e.Group{constructor(){super();const t=new e.BoxGeometry(5,.3,3),o=new e.MeshStandardMaterial({color:9132587}),s=new e.Mesh(t,o);s.position.set(0,3.15,0);const c=[];c.push(new e.Vector2(.2,0)),c.push(new e.Vector2(.25,.5)),c.push(new e.Vector2(.15,1.5)),c.push(new e.Vector2(.3,3));const l=new e.LatheGeometry(c,32),n=new e.MeshStandardMaterial({color:4929057});[[2.2,0,1.2],[-2.2,0,1.2],[2.2,0,-1.2],[-2.2,0,-1.2]].forEach(i=>{const a=new e.Mesh(l,n);a.position.set(...i),this.add(a)}),this.add(s)}}class Ie extends e.Group{constructor(t=1,o=.2){super(),this.height=t,this.radius=o,this.createCandle(),this.animateFlicker()}createCandle(){const t=new e.CylinderGeometry(this.radius,this.radius,this.height,32),o=new e.MeshStandardMaterial({color:16777215});this.candle=new e.Mesh(t,o),this.candle.position.set(0,this.height/2,0),this.add(this.candle);const s=new e.SphereGeometry(.05,16,16),c=new e.MeshBasicMaterial({color:16753920});this.flame=new e.Mesh(s,c),this.flame.position.set(0,this.height+.05,0),this.add(this.flame),this.candleLight=new e.PointLight(16753920,1,5),this.candleLight.position.set(0,this.height+.05,0),this.candleLight.castShadow=!0,this.add(this.candleLight)}animateFlicker(){const t=()=>{this.candleLight.intensity=1+(Math.random()*.4-.2),this.candleLight.position.x=Math.random()*.02-.01,this.candleLight.position.z=Math.random()*.02-.01,requestAnimationFrame(t)};t()}}class Pe extends e.Group{constructor(t=1.3,o=.5){super();const s=new e.CylinderGeometry(o,o,.2,16),c=new e.MeshStandardMaterial({color:9127187,flatShading:!0}),l=new e.Mesh(s,c);l.position.set(0,0,0),this.add(l);const n=new e.CylinderGeometry(o*.9,o*.9,t),r=new e.MeshStandardMaterial({color:16766720,flatShading:!0,transparent:!0,opacity:.6}),i=new e.Mesh(n,r);i.position.set(0,t/2+.1,0),this.add(i);const a=new e.ConeGeometry(o*1.1,.5,8),u=new e.MeshStandardMaterial({color:9127187,flatShading:!0}),h=new e.Mesh(a,u);h.position.set(0,t+.35,0),this.add(h);const d=new e.TorusGeometry(o*.8,.05,8,16),M=new e.MeshStandardMaterial({color:9127187,flatShading:!0}),f=new e.Mesh(d,M);f.position.set(0,t+.85,0),this.add(f);const p=new e.PointLight(16755200,1.5,15);p.position.set(0,t/2+.1,0),p.castShadow=!0,this.add(p)}}class Ae extends e.Group{constructor(){super();const t=new e.DodecahedronGeometry(1,0),o=new e.MeshStandardMaterial({color:8421504,flatShading:!0}),s=new e.MeshStandardMaterial({color:4950843,flatShading:!0,opacity:.8,transparent:!0});for(let c=0;c<5;c++){const l=new e.Mesh(t,o);l.scale.set(.8+Math.random()*.4,.8+Math.random()*.4,.8+Math.random()*.4),l.rotation.set(Math.random()*Math.PI,Math.random()*Math.PI,Math.random()*Math.PI),l.position.set((Math.random()-.5)*4,0,(Math.random()-.5)*4),this.add(l);const n=new e.Mesh(t,s);n.scale.set(l.scale.x*.9,l.scale.y*.5,l.scale.z*.9),n.rotation.copy(l.rotation),n.position.copy(l.position),n.position.y+=.3,this.add(n)}}}class Te extends e.Mesh{constructor(t=1,o=4,s=4){super(),this.geometry=new O(t,o,s),this.material=new e.MeshStandardMaterial({color:8421504,flatShading:!0})}}class Ce extends e.Group{constructor(){super();const t=new e.DodecahedronGeometry(1,0),o=new e.MeshStandardMaterial({color:8421504,flatShading:!0});for(let s=0;s<5;s++){const c=new e.Mesh(t,o);c.scale.set(.8+Math.random()*.4,.8+Math.random()*.4,.8+Math.random()*.4),c.rotation.set(Math.random()*Math.PI,Math.random()*Math.PI,Math.random()*Math.PI),c.position.set((Math.random()-.5)*4,0,(Math.random()-.5)*4),this.add(c)}}}class Ve extends e.Group{constructor(){super();const t=new D,o=new e.MeshPhysicalMaterial({color:8965375,transparent:!0,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,side:e.DoubleSide}),s=new e.Mesh(t,o);s.rotation.x=-Math.PI/2,this.add(s)}}class Ee extends e.Group{constructor(){super();const t=[new e.Vector2(0,0),new e.Vector2(.8,0),new e.Vector2(1,1.5),new e.Vector2(.5,2.2),new e.Vector2(.6,2.5)],o=new e.LatheGeometry(t,10),s=new e.CylinderGeometry(.3,.4,.2,8),c=new e.MeshStandardMaterial({color:8965375,transparent:!0,opacity:.5,roughness:.1,metalness:.3}),l=new e.MeshStandardMaterial({color:16724838,transparent:!0,opacity:.6}),n=new e.MeshStandardMaterial({color:9127187,roughness:1}),r=new e.Mesh(o,c),i=new e.Mesh(o,l),a=new e.Mesh(s,n);i.scale.set(.8,.8,.8),i.position.y=.1,a.position.y=2.5;const u=new e.Group;u.add(r,i,a),this.add(u)}}class Ne extends e.Group{constructor(){super();const t=new e.CylinderGeometry(.3,.4,.1,16),o=new e.MeshStandardMaterial({color:3355443,roughness:.6,metalness:.3}),s=new e.Mesh(t,o);s.position.y=.05;const c=new e.CylinderGeometry(.1,.1,.7,16),l=new e.MeshStandardMaterial({color:5592405,roughness:.5,metalness:.4}),n=new e.Mesh(c,l);n.position.y=.4;const r=new e.ConeGeometry(.075,.2,16),i=new e.MeshStandardMaterial({color:16733440,emissive:16733440,emissiveIntensity:.6,transparent:!0,opacity:.8}),a=new e.Mesh(r,i);a.position.y=.8,this.add(s,n,a)}}class Fe extends e.Group{constructor(){super();const t=new e.BoxGeometry(3,4,.1),o=new e.MeshStandardMaterial({color:3026478,roughness:.8,metalness:.6}),s=new e.BoxGeometry(.2,.5,.2),c=new e.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7}),l=new e.CylinderGeometry(.3,.3,.1,16),n=new e.MeshStandardMaterial({color:5592405,roughness:.7,metalness:.5}),r=new e.Mesh(t,o);for(let y=-1;y<=1;y++){const w=new e.Mesh(s,c);w.position.set(y,1.5,.1),r.add(w)}const i=new e.Mesh(l,n);i.rotation.x=Math.PI/2,i.position.set(0,.5,.15),r.add(i);const a=new e.SphereGeometry(.15,8,8),u=new e.MeshStandardMaterial({color:16711680,emissive:16711680,emissiveIntensity:.5}),h=new e.Mesh(a,u);h.position.set(0,-1,.1),r.add(h),this.add(r);let d=.015,M=.8,f=.2;function p(){requestAnimationFrame(p);const y=f+Math.abs(Math.sin(Date.now()*d))*(M-f);h.material.emissiveIntensity=y}p()}}class Ue extends e.Group{constructor(){super();const t=[new e.Vector2(0,0),new e.Vector2(1.2,0),new e.Vector2(1.5,1.5),new e.Vector2(1,3),new e.Vector2(.6,3.5)],o=new e.LatheGeometry(t,12),s=new e.CylinderGeometry(.6,.7,.3,8),c=new e.MeshStandardMaterial({color:8965290,transparent:!0,opacity:.4,roughness:.1,metalness:.5}),l=new e.MeshStandardMaterial({color:9127187,roughness:1}),n=new e.Mesh(o,c),r=new e.Mesh(s,l);r.position.y=3.5,this.add(n,r)}}class Le extends e.Group{constructor(){super();const t=new e.BoxGeometry(2,3,.1),o=new e.MeshStandardMaterial({color:3355443,roughness:.8,metalness:.5}),s=new e.Mesh(t,o),c=new e.CylinderGeometry(.1,.1,.2,8),l=new e.CylinderGeometry(.05,.05,1,8),n=new e.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7});for(let r=-.5;r<=.5;r+=.5){const i=new e.Mesh(c,n);i.position.set(r,1,.1);const a=new e.Mesh(l,n);a.position.y=.5,i.add(a),this.add(i)}this.add(s)}}class _e extends e.Group{constructor(){super();const t=new e.BoxGeometry(1,.2,.5),o=new e.MeshStandardMaterial({color:4473924,roughness:.6,metalness:.3}),s=new e.Mesh(t,o);s.position.y=.1;const c=new e.BoxGeometry(.2,1,.2),l=new e.Mesh(c,o);l.position.set(0,.6,-.2);const n=new e.CylinderGeometry(.1,.1,.4,8),r=new e.MeshStandardMaterial({color:3355443,roughness:.5,metalness:.6}),i=new e.Mesh(n,r);i.position.set(0,1.1,-.35),i.rotation.x=-Math.PI/4;const a=new e.BoxGeometry(.6,.1,.6),u=new e.MeshStandardMaterial({color:5592405,roughness:.8,metalness:.2}),h=new e.Mesh(a,u);h.position.set(0,.6,0),this.add(s,l,i,h)}}class ze extends e.Group{constructor(){super();const t=new X,o=new e.CylinderGeometry(.2,.3,1.5,8);o.translate(0,.75,0);const s=new e.MeshStandardMaterial({color:6045747,roughness:1,metalness:0,side:e.DoubleSide}),c=new e.MeshStandardMaterial({color:9132587,roughness:.8,metalness:.1}),l=new e.Mesh(t,s),n=new e.Mesh(o,c);n.position.set(.3,1.3,0),n.rotation.z=Math.PI/4,this.add(l,n)}}class qe extends e.Group{constructor(){super();const t=100,o=.05,s=new e.CatmullRomCurve3(Array.from({length:t},(a,u)=>{const h=u*.2;return new e.Vector3(Math.cos(h)*.4,u*o,Math.sin(h)*.4)})),c=new e.TubeGeometry(s,200,.1,8,!1),l=new e.MeshStandardMaterial({color:8965375,transparent:!0,opacity:.3,roughness:.1,metalness:.2,emissive:8965375}),n=new e.Mesh(c,l);this.add(n);function r(){l.emissiveIntensity=.2+Math.sin(Date.now()*.005)*.1}function i(){requestAnimationFrame(i),r()}i()}}class Oe extends e.Group{constructor(){super();const t=new e.TorusGeometry(.3,.03,8,16),o=new e.MeshStandardMaterial({color:8947848,roughness:.7,metalness:.3}),s=new e.Mesh(t,o);s.rotation.x=Math.PI/2,s.position.y=.4;const c=new e.CylinderGeometry(.02,.02,.4,8),l=new e.MeshStandardMaterial({color:6710886,roughness:.8,metalness:.3}),n=[];for(let r=0;r<3;r++){const i=r/3*Math.PI*2,a=new e.Mesh(c,l);a.position.set(Math.cos(i)*.25,.2,Math.sin(i)*.25),n.push(a)}this.add(s,...n)}}class De extends e.Group{constructor(){super();const t=new e.CylinderGeometry(.5,.6,.3,16),o=new e.MeshStandardMaterial({color:3355443,roughness:.6,metalness:.5}),s=new e.Mesh(t,o);s.position.y=.15;const c=new e.CylinderGeometry(.15,.15,2,12,1,!0),l=new e.MeshStandardMaterial({color:16737792,roughness:.5,metalness:.8,side:e.DoubleSide}),n=new e.Mesh(c,l);n.position.y=1.3;const r=new e.SphereGeometry(.3,16,16),i=new e.Mesh(r,l);i.position.y=2.4,this.add(s,n,i);const a=[];for(let d=0;d<5;d++){const M=new e.LineBasicMaterial({color:10079487}),f=[new e.Vector3(0,2.4,0),new e.Vector3((Math.random()-.5)*1.5,Math.random()*2.4,(Math.random()-.5)*1.5)],p=new e.BufferGeometry().setFromPoints(f),y=new e.Line(p,M);this.add(y),a.push(y)}function u(){a.forEach(d=>{const M=[new e.Vector3(0,2.4,0),new e.Vector3((Math.random()-.5)*1.5,Math.random()*2.4,(Math.random()-.5)*1.5)];d.geometry.setFromPoints(M)})}function h(){requestAnimationFrame(h),u()}h()}}class Xe extends e.Group{constructor(t=.2,o=.2,s=3,c=32){super();const l=new C(t,o,s,c),n=new e.MeshPhysicalMaterial({color:8965375,transparent:!0,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,side:e.DoubleSide}),r=new e.Mesh(l,n);this.add(r)}}class Ye extends e.Group{constructor(t=3,o=[65450,16711850,11141375]){super();const s=new e.BoxGeometry(3,.2,1),c=new e.MeshStandardMaterial({color:9127187,roughness:.7,metalness:.3}),l=new e.Mesh(s,c);l.position.y=.5;const n=new C(.1,.1,1,16),r=new e.MeshStandardMaterial({color:11184810,transparent:!0,opacity:.4,roughness:.1,metalness:.5,side:e.DoubleSide});for(let i=0;i<t;i++){const a=new e.Mesh(n,r),u=(i-(t-1)/2)*.8;a.position.set(u,1,0);const h=new C(.099,.099,.5,16,!1),d=o[i%o.length],M=new e.MeshStandardMaterial({color:d,emissive:d,emissiveIntensity:.5,transparent:!0,opacity:.6}),f=new e.Mesh(h,M);f.position.set(0,-.25,0),a.add(f),l.add(a)}this.add(l)}}class He extends e.Mesh{constructor(){super();const t=new Y,o=new e.MeshPhysicalMaterial({color:5597999,roughness:.1,transmission:.9,thickness:.2,metalness:0,clearcoat:1,clearcoatRoughness:.1});this.geometry=t,this.material=o}}class R extends e.Shape{constructor(t=5,o=.5,s=1){super();const c=Math.PI*2/t,l=c/2,n=c/4;this.moveTo(Math.cos(0)*s,-Math.sin(0)*s);for(let r=1;r<=t;++r){let i=Math.cos(c*r-n*3)*(o/Math.cos(n)),a=-Math.sin(c*r-n*3)*(o/Math.cos(n)),u=Math.cos(c*r-l)*o,h=-Math.sin(c*r-l)*o;this.quadraticCurveTo(i,a,u,h),i=Math.cos(c*r-n)*(o/Math.cos(n)),a=-Math.sin(c*r-n)*(o/Math.cos(n)),u=Math.cos(c*r)*s,h=-Math.sin(c*r)*s,this.quadraticCurveTo(i,a,u,h)}this.closePath()}}class Re extends e.Mesh{constructor(t=5,o=.5,s=1,c=.25){super();const l=new R(t,o,s),n=new e.ExtrudeGeometry(l,{depth:c,bevelEnabled:c>0,bevelThickness:0,bevelSize:0}),r=new e.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});n.center(),this.geometry=n,this.material=r}}class Z extends e.Shape{constructor(t=5,o=.5,s=1,c=5,l=.25){super();const n=Math.PI*2/t,r=n/4;this.moveTo(Math.cos(0)*s,-Math.sin(0)*s);for(let i=1;i<=t;++i)this.lineTo(Math.cos(n*i-r*3)*o,-Math.sin(n*i-r*3)*o),this.lineTo(Math.cos(n*i-r*2)*o,-Math.sin(n*i-r*2)*o),this.lineTo(Math.cos(n*i-r)*s,-Math.sin(n*i-r)*s),this.lineTo(Math.cos(n*i)*s,-Math.sin(n*i)*s);if(this.closePath(),l>0&&c>2){const i=new e.Path,a=Math.PI*2/c;i.moveTo(Math.cos(0)*l,-Math.sin(0)*l);for(let u=1;u<c;++u)i.lineTo(Math.cos(a*u)*l,-Math.sin(a*u)*l);i.lineTo(Math.cos(0)*l,-Math.sin(0)*l),this.holes.push(i)}}}class Ze extends e.Mesh{constructor(t=5,o=.5,s=1,c=5,l=.25,n=.25){super();const r=new Z(t,o,s,c,l),i=new e.ExtrudeGeometry(r,{depth:n,bevelEnabled:n>0,bevelThickness:0,bevelSize:0}),a=new e.MeshStandardMaterial({color:11184810,metalness:.8,roughness:.2,reflectivity:.5});i.center(),this.geometry=i,this.material=a}}class j extends e.Shape{constructor(t=1,o=2.1,s=1.4,c=1.6){super(),this.moveTo(0,s*t/3),this.bezierCurveTo(-o*.375*t,s*t,-o*t,s*t/3,0,-c*t),this.bezierCurveTo(o*t,s*t/3,o*.375*t,s*t,0,s*t/3)}}class je extends e.Mesh{constructor(t=1,o=1,s=1,c=10,l=.25){super();const n=new j(t,o,s,c),r=new e.ExtrudeGeometry(n,{depth:l,bevelEnabled:l>0,bevelThickness:0,bevelSize:0}),i=new e.MeshStandardMaterial({color:12986408,emissive:12981270,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});r.center(),this.geometry=r,this.material=i}}class Q extends e.Shape{constructor(t=5,o=.5,s=1){super();const c=Math.PI*2/t,l=c/2;this.moveTo(Math.cos(0)*s,Math.sin(0)*s);for(let n=1;n<=t;++n)this.lineTo(Math.cos(c*n-l)*o,Math.sin(c*n-l)*o),this.lineTo(Math.cos(c*n)*s,Math.sin(c*n)*s);this.closePath()}}class Qe extends e.Mesh{constructor(t=5,o=.5,s=1,c=.25){super();const l=new Q(t,o,s),n=new e.ExtrudeGeometry(l,{depth:c,bevelEnabled:c>0,bevelThickness:0,bevelSize:0}),r=new e.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});n.center(),this.geometry=n,this.material=r}}class Ke extends e.Mesh{constructor({trunkRadiusTop:t=.25,trunkRadiusBottom:o=.4,trunkHeight:s=2.5,trunkSegments:c=14,trunkColor:l=9127187,leafSize:n=.8,leafCount:r=6,leafDetail:i=0,leafSpreadRadius:a=1.5,leafColor:u=2263842}={}){super();const h=new H({trunkRadiusTop:t,trunkRadiusBottom:o,trunkHeight:s,trunkSegments:c,trunkColor:l,leafSize:n,leafCount:r,leafDetail:i,leafSpreadRadius:a,leafColor:u}),d=new e.MeshStandardMaterial({color:l,roughness:.9,metalness:0,flatShading:!0}),M=new e.MeshStandardMaterial({color:u,roughness:.8,metalness:0,flatShading:!0});this.geometry=h,this.material=[d,M]}}function Je(m,{time:t=0,waveFrequency:o=.2,waveAmplitude:s=.5}={}){m.onBeforeCompile=c=>{c.uniforms.time={value:t},c.uniforms.waveFrequency={value:o},c.uniforms.waveAmplitude={value:s},c.vertexShader=`
|
|
39
|
+
uniform float time;
|
|
40
|
+
uniform float waveFrequency;
|
|
41
|
+
uniform float waveAmplitude;
|
|
42
|
+
|
|
43
|
+
vec3 waterDisplacement(vec3 position, vec3 normal) {
|
|
44
|
+
vec3 displaced = position;
|
|
45
|
+
|
|
46
|
+
// Displace along the normal direction instead of local y-axis
|
|
47
|
+
displaced += normal * (sin(position.x * waveFrequency + time) * waveAmplitude);
|
|
48
|
+
displaced += normal * (cos(position.z * waveFrequency + time) * waveAmplitude);
|
|
49
|
+
|
|
50
|
+
return displaced;
|
|
51
|
+
}
|
|
52
|
+
`+c.vertexShader,c.vertexShader=c.vertexShader.replace("#include <begin_vertex>",`
|
|
53
|
+
vec3 transformed = waterDisplacement(position, normal);
|
|
54
|
+
`),m.userData.shader=c}}function $e(m,t){m.userData.shader&&(m.userData.shader.uniforms.time.value+=t)}function We(m,{time:t=0,intensity:o=1,direction:s=v.XYZ,scale:c=10}={}){m.onBeforeCompile=l=>{l.uniforms.time={value:t},l.uniforms.direction={value:s},l.uniforms.intensity={value:o},l.uniforms.scale={value:c},l.vertexShader=`
|
|
55
|
+
uniform float time;
|
|
56
|
+
uniform vec3 direction;
|
|
57
|
+
uniform float intensity;
|
|
58
|
+
uniform float scale;
|
|
59
|
+
|
|
60
|
+
float mod289(float x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
|
|
61
|
+
vec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
|
|
62
|
+
vec4 perm(vec4 x) { return mod289(((x * 34.0) + 1.0) * x); }
|
|
63
|
+
|
|
64
|
+
float noise(vec3 p) {
|
|
65
|
+
vec3 a = floor(p);
|
|
66
|
+
vec3 d = p - a;
|
|
67
|
+
d = d * d * (3.0 - 2.0 * d);
|
|
68
|
+
|
|
69
|
+
vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0);
|
|
70
|
+
vec4 k1 = perm(b.xyxy);
|
|
71
|
+
vec4 k2 = perm(k1.xyxy + b.zzww);
|
|
72
|
+
|
|
73
|
+
vec4 c = k2 + a.zzzz;
|
|
74
|
+
vec4 k3 = perm(c);
|
|
75
|
+
vec4 k4 = perm(c + 1.0);
|
|
76
|
+
|
|
77
|
+
vec4 o1 = fract(k3 * (1.0 / 41.0));
|
|
78
|
+
vec4 o2 = fract(k4 * (1.0 / 41.0));
|
|
79
|
+
|
|
80
|
+
vec4 o3 = o2 * d.z + o1 * (1.0 - d.z);
|
|
81
|
+
vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x);
|
|
82
|
+
|
|
83
|
+
return o4.y * d.y + o4.x * (1.0 - d.y);
|
|
84
|
+
}
|
|
85
|
+
`+l.vertexShader,l.vertexShader=l.vertexShader.replace("#include <begin_vertex>",`
|
|
86
|
+
vec3 transformed = vec3(position);
|
|
87
|
+
float n = noise(transformed * scale + time);
|
|
88
|
+
transformed += normalize(direction) * n * intensity;
|
|
89
|
+
vec3 transformedNormal = normal;
|
|
90
|
+
`),m.userData.shader=l}}function et(m,t){m.userData.shader&&(m.userData.shader.uniforms.time.value+=t)}const V={uniforms:{},vertexShader:`
|
|
39
91
|
varying vec3 vPosition;
|
|
40
92
|
void main() {
|
|
41
93
|
vPosition = position;
|
|
@@ -49,7 +101,7 @@
|
|
|
49
101
|
vec3 bottomColor = vec3(1.0, 1.0, 1.0); // Light white/gray for the horizon
|
|
50
102
|
gl_FragColor = vec4(mix(bottomColor, topColor, y), 1.0);
|
|
51
103
|
}
|
|
52
|
-
`},
|
|
104
|
+
`},K={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:`
|
|
53
105
|
varying vec2 vUv;
|
|
54
106
|
void main() {
|
|
55
107
|
vUv = uv;
|
|
@@ -63,7 +115,7 @@
|
|
|
63
115
|
vec4 texel = texture2D(tDiffuse, vUv);
|
|
64
116
|
gl_FragColor = opacity * texel;
|
|
65
117
|
}
|
|
66
|
-
`},
|
|
118
|
+
`},T={uniforms:{topColor:{value:new e.Color(51)},bottomColor:{value:new e.Color(17)},offset:{value:33},exponent:{value:.6}},vertexShader:`
|
|
67
119
|
varying vec3 vWorldPosition;
|
|
68
120
|
void main() {
|
|
69
121
|
vec4 worldPosition = modelMatrix * vec4(position, 1.0);
|
|
@@ -80,5 +132,5 @@
|
|
|
80
132
|
float h = normalize(vWorldPosition + offset).y;
|
|
81
133
|
gl_FragColor = vec4(mix(bottomColor, topColor, max(pow(max(h, 0.0), exponent), 0.0)), 1.0);
|
|
82
134
|
}
|
|
83
|
-
`};class
|
|
135
|
+
`};class tt extends e.Mesh{constructor(t=1e3){super(),this.geometry=new e.BoxGeometry(t,t,t),this.material=new e.ShaderMaterial({vertexShader:V.vertexShader,fragmentShader:V.fragmentShader,side:e.BackSide})}}class ot extends e.Mesh{constructor(t=1e3){super(),this.geometry=new e.SphereGeometry(t,32,15),this.material=new e.ShaderMaterial({vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,uniforms:T.uniforms,side:e.BackSide})}}class st extends e.Mesh{constructor(t=Math.PI*.49,o=2*Math.PI*.25,s=10,c=2,l=.005,n=.8){super();const r=new W.Sky;r.scale.setScalar(45e4),this.add(r);const i=r.material.uniforms;i.turbidity.value=s,i.rayleigh.value=c,i.mieCoefficient.value=l,i.mieDirectionalG.value=n,this.skyUniforms=i,this.sunPosition(t,o)}sunPosition(t,o){const s=new e.Vector3,c=this.skyUniforms;s.setFromSphericalCoords(1,t,o),c.sunPosition.value.copy(s)}}const nt=m=>{const t=new Uint8Array(4*m*m);for(let s=0;s<m*m;s++){const c=s*4,l=(s%m^Math.floor(s/m))&1?255:0;t[c]=l,t[c+1]=l,t[c+2]=l,t[c+3]=255}const o=new e.DataTexture(t,m,m,e.RGBAFormat,e.UnsignedByteType);return o.wrapS=e.RepeatWrapping,o.wrapT=e.RepeatWrapping,o.minFilter=e.NearestFilter,o.needsUpdate=!0,o};class rt{static dispose(t){t==null||t.traverse(o=>{o.geometry&&o.geometry.dispose(),o.material&&(Array.isArray(o.material)?o.material.forEach(s=>s.dispose()):o.material.dispose())})}static fadeBetween(t,o,s,c,l=1){const n=new ee.EffectComposer(t),r=new N.RenderPass(s,o);n.addPass(r);const i=new te.ShaderPass(K);i.uniforms.opacity.value=1,n.addPass(i);let a=null;function u(d){a||(a=d);const f=(d-a)/1e3/l;i.uniforms.opacity.value=Math.max(1-f,0),f<1?(n.render(),requestAnimationFrame(u)):(n.passes[0]=new N.RenderPass(c,o),a=null,requestAnimationFrame(h))}function h(d){a||(a=d);const f=(d-a)/1e3/l;i.uniforms.opacity.value=Math.min(f,1),f<1&&(n.render(),requestAnimationFrame(h))}requestAnimationFrame(u)}}exports.Beaker=Ve;exports.BeakerGeometry=D;exports.BifurcatedStaircaseGeometry=me;exports.BoneGeometry=xe;exports.Book=Ge;exports.BookGeometry=F;exports.Bottle=Ee;exports.Bubbling=le;exports.BunsenBurner=Ne;exports.Burst=Re;exports.BurstShape=R;exports.Candle=Ie;exports.CrossHeadstone=Se;exports.CrossHeadstoneGeometry=U;exports.DaySkybox=tt;exports.Desk=ke;exports.DioramaGeometry=ue;exports.Direction=v;exports.Easing=ie;exports.ElectricPanel=Fe;exports.Falloff=I;exports.FenceColumn=Me;exports.Flask=Ue;exports.Gear=Ze;exports.GearShape=Z;exports.Heart=je;exports.HeartShape=j;exports.LShapedStaircaseGeometry=he;exports.Lantern=Pe;exports.LeverPanel=Le;exports.Mausoleum=ve;exports.Microscope=_e;exports.Moon=we;exports.MortarAndPestle=ze;exports.MortarGeometry=X;exports.MossyRocks=Ae;exports.NightSkybox=ot;exports.ObeliskHeadstone=ge;exports.ObeliskHeadstoneGeometry=L;exports.Rock=Te;exports.RockGeometry=O;exports.Rocks=Ce;exports.RoundedHeadstone=be;exports.RoundedHeadstoneGeometry=_;exports.SceneUtils=rt;exports.SimpleLeafGeometry=pe;exports.SpiralStaircaseGeometry=de;exports.SpiralTube=qe;exports.SquareHeadstone=Be;exports.SquareHeadstoneGeometry=z;exports.StaircaseGeometry=fe;exports.Stand=Oe;exports.Star=Qe;exports.StarShape=Q;exports.TeslaCoil=De;exports.TestTube=Xe;exports.TestTubeGeometry=C;exports.TestTubeRack=Ye;exports.Tree=Ke;exports.TreeGeometry=H;exports.TwilightSkybox=st;exports.WineBottle=He;exports.WineBottleGeometry=Y;exports.WroughtIronBarGeometry=ye;exports.addNoiseDisplacement=We;exports.addWaterDisplacement=Je;exports.checkerboardTexture=nt;exports.daySkyShader=V;exports.displacementBrush=oe;exports.fadeShader=K;exports.flattenBrush=se;exports.nightSkyShader=T;exports.noiseBrush=ne;exports.randomTransformVertices=q;exports.smoothBrush=re;exports.spikeBrush=ae;exports.twistBrush=ce;exports.updateNoiseDisplacementTime=et;exports.updateWaterDisplacementTime=$e;
|
|
84
136
|
//# sourceMappingURL=index.cjs.js.map
|