three-low-poly 0.9.6 → 0.9.8
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 -41
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1650 -813
- package/dist/index.es.js.map +1 -1
- package/dist/index.iife.js +57 -41
- package/dist/index.iife.js.map +1 -1
- package/dist/index.umd.js +57 -41
- 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"),G=require("three/addons/utils/BufferGeometryUtils.js"),j=require("three/addons/objects/Sky.js"),Q=require("three/addons/postprocessing/EffectComposer.js"),V=require("three/addons/postprocessing/RenderPass.js"),K=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()},b={LINEAR:(l,t)=>1-l/t,QUADRATIC:(l,t)=>Math.pow(1-l/t,2),SQUARE_ROOT:(l,t)=>Math.pow(1-l/t,.5),LOGARITHMIC:(l,t)=>Math.log(1+(t-l))/Math.log(1+t),SINE:(l,t)=>Math.cos(l/t*Math.PI/2),EXPONENTIAL:(l,t)=>Math.exp(-l/t),CUBIC:(l,t)=>Math.pow(1-l/t,3),GAUSSIAN:(l,t)=>Math.exp(-Math.pow(l,2)/(2*Math.pow(t/3,2))),INVERSE:(l,t)=>t/(t+l),SMOOTHSTEP:(l,t)=>{const o=Math.max(0,Math.min(1,1-l/t));return o*o*(3-2*o)}},J=(l,t,o,s,r=v.UP,c=b.LINEAR)=>{const n=l.attributes.position;for(let a=0;a<n.count;a++){const i=new e.Vector3;i.fromBufferAttribute(n,a);const m=i.distanceTo(t);if(m<o){const u=c(m,o)*s;i.add(r.clone().multiplyScalar(u)),n.setXYZ(a,i.x,i.y,i.z)}}n.needsUpdate=!0},$=(l,t,o,s,r,c=v.UP,n=b.LINEAR)=>{const a=l.attributes.position;for(let i=0;i<a.count;i++){const m=new e.Vector3;m.fromBufferAttribute(a,i);const h=m.distanceTo(t);if(h<o){const d=n(h,o)*r,f=m.dot(c.normalize()),M=s-f;m.add(c.clone().multiplyScalar(M*d)),a.setXYZ(i,m.x,m.y,m.z)}}a.needsUpdate=!0},W=(l,t,o,s,r=v.UP,c=b.LINEAR)=>{const n=l.attributes.position;for(let a=0;a<n.count;a++){const i=new e.Vector3;i.fromBufferAttribute(n,a);const m=i.distanceTo(t);if(m<o){const h=c(m,o),u=s*h,d=r.clone().normalize();d.x!==0&&(i.x+=e.MathUtils.randFloatSpread(u)*d.x),d.y!==0&&(i.y+=e.MathUtils.randFloatSpread(u)*d.y),d.z!==0&&(i.z+=e.MathUtils.randFloatSpread(u)*d.z),n.setXYZ(a,i.x,i.y,i.z)}}n.needsUpdate=!0},ee=(l,t,o,s)=>{const r=l.attributes.position,c=new e.Vector3;for(let n=0;n<r.count;n++){const a=new e.Vector3;if(a.fromBufferAttribute(r,n),a.distanceTo(t)<o){let m=new e.Vector3,h=0;for(let u=0;u<r.count;u++)c.fromBufferAttribute(r,u),c.distanceTo(a)<o&&(m.add(c),h++);h>0&&(m.divideScalar(h),a.lerp(m,s),r.setXYZ(n,a.x,a.y,a.z))}}r.needsUpdate=!0},te=(l,t,o,s,r=!1,c=b.LINEAR)=>{const n=l.attributes.position;for(let a=0;a<n.count;a++){const i=new e.Vector3;i.fromBufferAttribute(n,a);const m=i.distanceTo(t);if(m<o){const u=c(m,o)*s*(r?-1:1),d=i.clone().sub(t).normalize();i.add(d.multiplyScalar(u)),n.setXYZ(a,i.x,i.y,i.z)}}n.needsUpdate=!0},oe=(l,t,o,s,r=v.UP,c=b.LINEAR)=>{const n=l.attributes.position,a=new e.Quaternion;for(let i=0;i<n.count;i++){const m=new e.Vector3;m.fromBufferAttribute(n,i);const h=m.distanceTo(t);if(h<o){const d=c(h,o)*s;a.setFromAxisAngle(r,d),m.sub(t).applyQuaternion(a).add(t),n.setXYZ(i,m.x,m.y,m.z)}}n.needsUpdate=!0},se={LINEAR:l=>l,QUADRATIC_EASE_IN:l=>l*l,QUADRATIC_EASE_OUT:l=>1-Math.pow(1-l,2),SQUARE_ROOT_EASING:l=>Math.sqrt(l),LOGARITHMIC_EASING:l=>Math.log(1+l)/Math.log(2),SINE_EASE_IN:l=>1-Math.cos(l*Math.PI/2),SINE_EASE_OUT:l=>Math.sin(l*Math.PI/2),EXPONENTIAL_EASE_IN:l=>Math.pow(2,10*(l-1)),EXPONENTIAL_EASE_OUT:l=>1-Math.pow(2,-10*l),CUBIC_EASE_IN:l=>l*l*l,CUBIC_EASE_OUT:l=>1-Math.pow(1-l,3),GAUSSIAN_EASING:l=>Math.exp(-Math.pow(l-.5,2)/(2*.1)),INVERSE_EASING:l=>1/(1+l),SMOOTHSTEP_EASING:l=>l*l*(3-2*l)};class ne extends e.Group{constructor(){super();const t=[],o=20,s=new e.SphereGeometry(.1,6,6),r=new e.MeshStandardMaterial({color:16777215,transparent:!0,opacity:.6,roughness:.3,metalness:.3});for(let a=0;a<o;a++){const i=new e.Mesh(s,r);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 n(){requestAnimationFrame(n),c()}n()}}class re extends e.BufferGeometry{constructor(t=2,o=.3,s=.6,r=5,c=5,n=Math.PI/4){super();const a=[],i=[];for(let f=0;f<r;f++){const M=f*o,p=M+o,y=f*s,w=y+s;a.push(-t/2,M,y,t/2,M,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=f*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 m=r*o,h=r*s,u=t*2;a.push(-u/2,m,h,u/2,m,h,u/2,m,h+s,-u/2,m,h+s);const d=r*8;i.push(d,d+1,d+2,d,d+2,d+3);for(let f=0;f<2;f++){const M=f===0?1:-1;for(let p=0;p<c;p++){const y=m+p*o,w=y+o,x=M*(u/4),B=h+s,A=p*s*Math.cos(n),R=p*s*Math.sin(n),k=x+M*A-t/2*Math.cos(n),P=x+M*A+t/2*Math.cos(n),g=B+R,D=k+M*s*Math.cos(n),H=P+M*s*Math.cos(n),E=g+s*Math.sin(n);a.push(k,y,g,P,y,g,P,w,g,k,w,g,k,w,g,P,w,g,H,w,E,D,w,E);const S=d+4+f*c*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(a,3)),this.computeVertexNormals()}}class ae extends e.BufferGeometry{constructor(t=5,o=3,s=5,r=.2){super();const c=[-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(c,3)),this.computeVertexNormals()}}class ce extends e.BufferGeometry{constructor(t=2,o=.3,s=.5,r=5,c=2){super();const n=[],a=[];for(let u=0;u<r;u++){const d=u*o,f=d+o,M=u*s,p=M+s;n.push(-t/2,d,M,t/2,d,M,t/2,f,M,-t/2,f,M,-t/2,f,M,t/2,f,M,t/2,f,p,-t/2,f,p);const y=u*8;a.push(y,y+1,y+2,y,y+2,y+3),a.push(y+4,y+5,y+6,y+4,y+6,y+7)}const i=r*o,m=r*s;n.push(-t/2,i,m,t/2,i,m,t/2,i,m+c,-t/2,i,m+c);const h=r*8;a.push(h,h+1,h+2,h,h+2,h+3);for(let u=0;u<r;u++){const d=i+u*o,f=d+o,M=-t/2-u*s,p=M-s;n.push(M,d,m+c,M,d,m+c-t,M,f,m+c-t,M,f,m+c,M,f,m+c,M,f,m+c-t,p,f,m+c-t,p,f,m+c);const y=h+4+u*8;a.push(y,y+1,y+2,y,y+2,y+3),a.push(y+4,y+5,y+6,y+4,y+6,y+7)}this.setIndex(a),this.setAttribute("position",new e.Float32BufferAttribute(n,3)),this.computeVertexNormals()}}class ie extends e.BufferGeometry{constructor(t=1,o=.4,s=.2,r=20,c=2,n=Math.PI/8){super();const a=[],i=[];let m=0;for(let h=0;h<r;h++){const u=c*Math.cos(m),d=c*Math.sin(m),f=h*s,M=f+s;a.push(u-t/2*Math.cos(m),f,d-t/2*Math.sin(m),u+t/2*Math.cos(m),f,d+t/2*Math.sin(m),u+t/2*Math.cos(m),M,d+t/2*Math.sin(m),u-t/2*Math.cos(m),M,d-t/2*Math.sin(m)),a.push(u-t/2*Math.cos(m),M,d-t/2*Math.sin(m),u+t/2*Math.cos(m),M,d+t/2*Math.sin(m),u+t/2*Math.cos(m)-o*Math.sin(m),M,d+t/2*Math.sin(m)+o*Math.cos(m),u-t/2*Math.cos(m)-o*Math.sin(m),M,d-t/2*Math.sin(m)+o*Math.cos(m));const p=h*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),m+=n}this.setIndex(i),this.setAttribute("position",new e.Float32BufferAttribute(a,3)),this.computeVertexNormals()}}class le extends e.BufferGeometry{constructor(t=2,o=.3,s=.5,r=10){super();const c=[],n=[];for(let a=0;a<r;a++){const i=a*o,m=i+o,h=a*s,u=h+s;c.push(-t/2,i,h,t/2,i,h,t/2,m,h,-t/2,m,h,-t/2,m,h,t/2,m,h,t/2,m,u,-t/2,m,u);const d=a*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(c,3)),this.computeVertexNormals()}}class me extends e.BufferGeometry{constructor(t=.4,o=1.2,s=.2){super();const r=o*.6,c=new e.BoxGeometry(t/2,r,s);c.translate(0,r/2,0);const n=t*1.5,a=new e.BoxGeometry(n,t/4,s);a.translate(0,r*.75,0),this.copy(G.mergeGeometries([c,a],!1))}}class he extends e.BufferGeometry{constructor(t=1.75,o=.75){super();const s=t*.05,r=t*.15,c=t*.15,n=t*.75;let a=0;const i=new e.BoxGeometry(o,s,o);i.translate(0,a+s/2,0),a+=s;const m=new e.BoxGeometry(o*.8,r,o*.8);m.translate(0,a+r/2,0),a+=r;const h=new e.BoxGeometry(o*.6,c,o*.6);h.translate(0,a+c/2,0),a+=c;const u=new e.BoxGeometry(o*.4,n,o*.4);u.translate(0,a+n/2,0),a+=n;const d=new e.ConeGeometry(o*.4/Math.sqrt(2),.1,4,1,!1,Math.PI/4);d.translate(0,a+.1/2,0),this.copy(G.mergeGeometries([i,m,h,u,d],!1))}}class ue extends e.BufferGeometry{constructor(t=.6,o=1,s=.2){super();const r=o*.7,c=new e.BoxGeometry(t,r,s);c.translate(0,r/2,0);const n=o-r,a=new e.CylinderGeometry(t/2,t/2,s,16,1,!1,0,Math.PI);a.rotateY(Math.PI/2),a.rotateX(Math.PI/2),a.translate(0,r+n/2-s/2-.05,0),this.copy(G.mergeGeometries([c,a],!1))}}class de extends e.BufferGeometry{constructor(t=.5,o=.8,s=.15){super();const r=new e.BoxGeometry(t,o,s);r.translate(0,o/2,0),this.copy(r)}}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 r=new e.BoxGeometry(1.4,.3,1.4);r.translate(0,.5+t+.15,0),this.copy(G.mergeGeometries([o,s,r],!1))}}class fe extends e.BufferGeometry{constructor(t=2,o=.05,s=.3){super();const r=new e.CylinderGeometry(o,o,t,8);r.translate(0,t/2,0);const c=new e.ConeGeometry(o*1.5,s,8);c.translate(0,t+s/2,0),this.copy(G.mergeGeometries([r,c],!1))}}class ye extends e.BufferGeometry{constructor(t=.1){super();const o=[],s=[],r=[[0,1],[.5,.75],[.75,.25],[.5,-.5],[0,-1],[-.5,-.5],[-.75,.25],[-.5,.75]];for(let n=0;n<r.length;n++){const[a,i]=r[n];o.push(a*t,i*t,0)}for(let n=1;n<r.length-1;n++)s.push(0,n,n+1);s.push(0,r.length-1,1);const c=new e.Float32BufferAttribute(o,3);this.setAttribute("position",c),this.setIndex(s),this.computeVertexNormals()}}function N(l,t=v.XYZ,o=.5,s=2){l.deleteAttribute("uv"),l.deleteAttribute("normal"),l=G.mergeVertices(l),l.computeVertexNormals();const r=l.getAttribute("position");for(let c=0;c<r.count;c++){const n=new e.Vector3().fromBufferAttribute(r,c),a=Math.random()*(s-o)+o,i=t.clone().multiplyScalar(a);n.add(i),r.setXYZ(c,n.x,n.y,n.z)}return r.needsUpdate=!0,l.computeVertexNormals(),l}class F extends e.BufferGeometry{constructor(t=1,o=4,s=4){super();const r=new e.SphereGeometry(t,o,s);this.copy(N(r,v.XYZ,.5,1)),this.computeVertexNormals(),this.center()}}class pe extends e.BufferGeometry{constructor(t=.1,o=.1,s=.4,r=8){super();const c=new e.CylinderGeometry(t*.6,o*.6,s,r);c.translate(0,0,0);const n=new e.SphereGeometry(t,r,r),a=n.clone(),i=n.clone(),m=n.clone(),h=n.clone();a.translate(0,s/2+t*.6,-t*.6),i.translate(0,s/2+t*.6,t*.6),m.translate(0,-s/2-o*.6,-o*.6),h.translate(0,-s/2-o*.6,o*.6),this.copy(G.mergeGeometries([c,a,i,m,h],!1))}}class U 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 L 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 T extends e.BufferGeometry{constructor(t=.2,o=.2,s=3,r=32,c=!0){super();const n=new e.CylinderGeometry(t,o,s,r,1,c),a=new e.SphereGeometry(o,r,r/2,0,Math.PI*2,Math.PI/2,Math.PI/2);a.translate(0,-(s/2),0),this.copy(G.mergeGeometries([n,a],!1))}}class _ extends e.BufferGeometry{constructor({radius:t=.5,neckRadius:o=.2,height:s=3,neckHeight:r=1,segments:c=16}={}){super();const n=s-r,a=new e.CylinderGeometry(t,t,n,c);a.translate(0,n/2,0);const i=.3,m=new e.CylinderGeometry(o,t,i,c);m.translate(0,n+i/2,0);const h=new e.CylinderGeometry(o,o,r,c);h.translate(0,n+i+r/2,0),this.copy(G.mergeGeometries([a,m,h],!1))}}class z extends e.BufferGeometry{constructor({trunkRadiusTop:t=.25,trunkRadiusBottom:o=.4,trunkHeight:s=2.5,trunkSegments:r=14,leafSize:c=.8,leafCount:n=6,leafDetail:a=0,leafSpreadRadius:i=1.5}={}){super();const m=new e.CylinderGeometry(t,o,s,r);m.translate(0,s/2,0);const h=[];for(let u=0;u<n;u++){const d=new e.DodecahedronGeometry(c,a);d.translate((Math.random()-.5)*i,(Math.random()-.5)*c+s,(Math.random()-.5)*i),h.push(d)}this.copy(G.mergeGeometries([m.toNonIndexed(),G.mergeGeometries(h,!1)],!0)),this.computeVertexNormals()}}class xe extends e.Group{constructor(){super();const t=new e.SphereGeometry(5,32,32),o=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"),ae=require("three/addons/objects/Sky.js"),ce=require("three/addons/postprocessing/EffectComposer.js"),U=require("three/addons/postprocessing/RenderPass.js"),ie=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()},P={LINEAR:(l,t)=>1-l/t,QUADRATIC:(l,t)=>Math.pow(1-l/t,2),SQUARE_ROOT:(l,t)=>Math.pow(1-l/t,.5),LOGARITHMIC:(l,t)=>Math.log(1+(t-l))/Math.log(1+t),SINE:(l,t)=>Math.cos(l/t*Math.PI/2),EXPONENTIAL:(l,t)=>Math.exp(-l/t),CUBIC:(l,t)=>Math.pow(1-l/t,3),GAUSSIAN:(l,t)=>Math.exp(-Math.pow(l,2)/(2*Math.pow(t/3,2))),INVERSE:(l,t)=>t/(t+l),SMOOTHSTEP:(l,t)=>{const o=Math.max(0,Math.min(1,1-l/t));return o*o*(3-2*o)}},le=(l,t,o,s,a=v.UP,m=P.LINEAR)=>{const r=l.attributes.position;for(let n=0;n<r.count;n++){const c=new e.Vector3;c.fromBufferAttribute(r,n);const i=c.distanceTo(t);if(i<o){const u=m(i,o)*s;c.add(a.clone().multiplyScalar(u)),r.setXYZ(n,c.x,c.y,c.z)}}r.needsUpdate=!0},me=(l,t,o,s,a,m=v.UP,r=P.LINEAR)=>{const n=l.attributes.position;for(let c=0;c<n.count;c++){const i=new e.Vector3;i.fromBufferAttribute(n,c);const h=i.distanceTo(t);if(h<o){const d=r(h,o)*a,f=i.dot(m.normalize()),M=s-f;i.add(m.clone().multiplyScalar(M*d)),n.setXYZ(c,i.x,i.y,i.z)}}n.needsUpdate=!0},he=(l,t,o,s,a=v.UP,m=P.LINEAR)=>{const r=l.attributes.position;for(let n=0;n<r.count;n++){const c=new e.Vector3;c.fromBufferAttribute(r,n);const i=c.distanceTo(t);if(i<o){const h=m(i,o),u=s*h,d=a.clone().normalize();c.x+=e.MathUtils.randFloatSpread(u)*d.x,c.y+=e.MathUtils.randFloatSpread(u)*d.y,c.z+=e.MathUtils.randFloatSpread(u)*d.z,r.setXYZ(n,c.x,c.y,c.z)}}r.needsUpdate=!0},ue=(l,t,o,s)=>{const a=l.attributes.position,m=new e.Vector3;for(let r=0;r<a.count;r++){const n=new e.Vector3;if(n.fromBufferAttribute(a,r),n.distanceTo(t)<o){let i=new e.Vector3,h=0;for(let u=0;u<a.count;u++)m.fromBufferAttribute(a,u),m.distanceTo(n)<o&&(i.add(m),h++);h>0&&(i.divideScalar(h),n.lerp(i,s),a.setXYZ(r,n.x,n.y,n.z))}}a.needsUpdate=!0},de=(l,t,o,s,a=!1,m=P.LINEAR)=>{const r=l.attributes.position;for(let n=0;n<r.count;n++){const c=new e.Vector3;c.fromBufferAttribute(r,n);const i=c.distanceTo(t);if(i<o){const u=m(i,o)*s*(a?-1:1),d=c.clone().sub(t).normalize();c.add(d.multiplyScalar(u)),r.setXYZ(n,c.x,c.y,c.z)}}r.needsUpdate=!0},Me=(l,t,o,s,a=v.UP,m=P.LINEAR)=>{const r=l.attributes.position,n=new e.Quaternion;for(let c=0;c<r.count;c++){const i=new e.Vector3;i.fromBufferAttribute(r,c);const h=i.distanceTo(t);if(h<o){const d=m(h,o)*s;n.setFromAxisAngle(a,d),i.sub(t).applyQuaternion(n).add(t),r.setXYZ(c,i.x,i.y,i.z)}}r.needsUpdate=!0},fe={LINEAR:l=>l,QUADRATIC_EASE_IN:l=>l*l,QUADRATIC_EASE_OUT:l=>1-Math.pow(1-l,2),SQUARE_ROOT_EASING:l=>Math.sqrt(l),LOGARITHMIC_EASING:l=>Math.log(1+l)/Math.log(2),SINE_EASE_IN:l=>1-Math.cos(l*Math.PI/2),SINE_EASE_OUT:l=>Math.sin(l*Math.PI/2),EXPONENTIAL_EASE_IN:l=>Math.pow(2,10*(l-1)),EXPONENTIAL_EASE_OUT:l=>1-Math.pow(2,-10*l),CUBIC_EASE_IN:l=>l*l*l,CUBIC_EASE_OUT:l=>1-Math.pow(1-l,3),GAUSSIAN_EASING:l=>Math.exp(-Math.pow(l-.5,2)/(2*.1)),INVERSE_EASING:l=>1/(1+l),SMOOTHSTEP_EASING:l=>l*l*(3-2*l)};class ye extends e.Group{constructor(){super();const t=[],o=20,s=new e.SphereGeometry(.1,6,6),a=new e.MeshStandardMaterial({color:16777215,transparent:!0,opacity:.6,roughness:.3,metalness:.3});for(let n=0;n<o;n++){const c=new e.Mesh(s,a);c.position.set((Math.random()-.5)*1.5,Math.random()*3,(Math.random()-.5)*1.5),t.push(c),this.add(c)}function m(){t.forEach(n=>{n.position.y+=.02,n.position.y>3&&(n.position.y=0,n.position.x=(Math.random()-.5)*1.5,n.position.z=(Math.random()-.5)*1.5)})}function r(){requestAnimationFrame(r),m()}r()}}class pe extends e.BufferGeometry{constructor(t=2,o=.3,s=.6,a=5,m=5,r=Math.PI/4){super();const n=[],c=[];for(let f=0;f<a;f++){const M=f*o,p=M+o,y=f*s,x=y+s;n.push(-t/2,M,y,t/2,M,y,t/2,p,y,-t/2,p,y,-t/2,p,y,t/2,p,y,t/2,p,x,-t/2,p,x);const w=f*8;c.push(w,w+1,w+2,w,w+2,w+3),c.push(w+4,w+5,w+6,w+4,w+6,w+7)}const i=a*o,h=a*s,u=t*2;n.push(-u/2,i,h,u/2,i,h,u/2,i,h+s,-u/2,i,h+s);const d=a*8;c.push(d,d+1,d+2,d,d+2,d+3);for(let f=0;f<2;f++){const M=f===0?1:-1;for(let p=0;p<m;p++){const y=i+p*o,x=y+o,w=M*(u/4),I=h+s,k=p*s*Math.cos(r),g=p*s*Math.sin(r),b=w+M*k-t/2*Math.cos(r),A=w+M*k+t/2*Math.cos(r),B=I+g,re=b+M*s*Math.cos(r),ne=A+M*s*Math.cos(r),N=B+s*Math.sin(r);n.push(b,y,B,A,y,B,A,x,B,b,x,B,b,x,B,A,x,B,ne,x,N,re,x,N);const S=d+4+f*m*8+p*8;c.push(S,S+1,S+2,S,S+2,S+3),c.push(S+4,S+5,S+6,S+4,S+6,S+7)}}this.setIndex(c),this.setAttribute("position",new e.Float32BufferAttribute(n,3)),this.computeVertexNormals()}}class xe extends e.BufferGeometry{constructor(t=5,o=3,s=5,a=.2){super();const m=[-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],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(m,3)),this.computeVertexNormals()}}class we extends e.BufferGeometry{constructor(t=2,o=.3,s=.5,a=5,m=2){super();const r=[],n=[];for(let u=0;u<a;u++){const d=u*o,f=d+o,M=u*s,p=M+s;r.push(-t/2,d,M,t/2,d,M,t/2,f,M,-t/2,f,M,-t/2,f,M,t/2,f,M,t/2,f,p,-t/2,f,p);const y=u*8;n.push(y,y+1,y+2,y,y+2,y+3),n.push(y+4,y+5,y+6,y+4,y+6,y+7)}const c=a*o,i=a*s;r.push(-t/2,c,i,t/2,c,i,t/2,c,i+m,-t/2,c,i+m);const h=a*8;n.push(h,h+1,h+2,h,h+2,h+3);for(let u=0;u<a;u++){const d=c+u*o,f=d+o,M=-t/2-u*s,p=M-s;r.push(M,d,i+m,M,d,i+m-t,M,f,i+m-t,M,f,i+m,M,f,i+m,M,f,i+m-t,p,f,i+m-t,p,f,i+m);const y=h+4+u*8;n.push(y,y+1,y+2,y,y+2,y+3),n.push(y+4,y+5,y+6,y+4,y+6,y+7)}this.setIndex(n),this.setAttribute("position",new e.Float32BufferAttribute(r,3)),this.computeVertexNormals()}}class Ge extends e.BufferGeometry{constructor(t=1,o=.4,s=.2,a=20,m=2,r=Math.PI/8){super();const n=[],c=[];let i=0;for(let h=0;h<a;h++){const u=m*Math.cos(i),d=m*Math.sin(i),f=h*s,M=f+s;n.push(u-t/2*Math.cos(i),f,d-t/2*Math.sin(i),u+t/2*Math.cos(i),f,d+t/2*Math.sin(i),u+t/2*Math.cos(i),M,d+t/2*Math.sin(i),u-t/2*Math.cos(i),M,d-t/2*Math.sin(i)),n.push(u-t/2*Math.cos(i),M,d-t/2*Math.sin(i),u+t/2*Math.cos(i),M,d+t/2*Math.sin(i),u+t/2*Math.cos(i)-o*Math.sin(i),M,d+t/2*Math.sin(i)+o*Math.cos(i),u-t/2*Math.cos(i)-o*Math.sin(i),M,d-t/2*Math.sin(i)+o*Math.cos(i));const p=h*8;c.push(p,p+1,p+2,p,p+2,p+3),c.push(p+4,p+5,p+6,p+4,p+6,p+7),i+=r}this.setIndex(c),this.setAttribute("position",new e.Float32BufferAttribute(n,3)),this.computeVertexNormals()}}class Se extends e.BufferGeometry{constructor(t=2,o=.3,s=.5,a=10){super();const m=[],r=[];for(let n=0;n<a;n++){const c=n*o,i=c+o,h=n*s,u=h+s;m.push(-t/2,c,h,t/2,c,h,t/2,i,h,-t/2,i,h,-t/2,i,h,t/2,i,h,t/2,i,u,-t/2,i,u);const d=n*8;r.push(d,d+1,d+2,d,d+2,d+3),r.push(d+4,d+6,d+5,d+4,d+7,d+6)}this.setIndex(r),this.setAttribute("position",new e.Float32BufferAttribute(m,3)),this.computeVertexNormals()}}class L extends e.BufferGeometry{constructor(t=1,o=1.5,s=.5,a=.05,m=.05){super();const r=t,n=o,c=s,i=a,h=m,u=[0,0,0,r,0,0,r,n,0,0,n,0,r,0,-c,0,0,-c,0,n,-c,r,n,-c,0,0,-c,0,0,0,0,n,0,0,n,-c,r,0,-i,i,0,-i,i,n,-i,r,n,-i,i,0,-c+i,r,0,-c+i,r,n,-c+i,i,n,-c+i,i,0,-i,i,0,-c+i,i,n,-c+i,i,n,-i,0,n,0,r,n,0,r,n,-i,i,n,-i,0,n,-c,i,n,-c+i,r,n,-c+i,r,n,-c,0,n,0,i,n,-i,i,n,-c+i,0,n,-c,0,0,0,i,0,-i,r,0,-i,r,0,0,0,0,-c,r,0,-c,r,0,-c+i,i,0,-c+i,0,0,0,0,0,-c,i,0,-c+i,i,0,-i,r,0,0,r,0,-i,r,n,-i,r,n,0,r,0,-c,r,n,-c,r,n,-c+i,r,0,-c+i],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],f=t/(t*2+s),M=(t+s)/(t*2+s),p=[M,0,1,0,1,1,M,1,0,0,f,0,f,1,0,1,f,0,M,0,M,1,f,1,1,0,M,0,M,1,1,1,f,0,0,0,0,1,f,1,M,0,f,0,f,1,M,1,M,0,1,0,1,1,M,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],x=new Float32Array(u),w=new Float32Array(d),I=new Float32Array(p),k=new Uint16Array(y),g=new e.BufferGeometry;g.setAttribute("position",new e.BufferAttribute(x,3)),g.setAttribute("normal",new e.BufferAttribute(w,3)),g.setAttribute("uv",new e.BufferAttribute(I,2)),g.setIndex(new e.BufferAttribute(k,1));const b=new e.BoxGeometry(t-i-h,n-h*2,c-i*2);b.translate((t-i-h)/2+i,n/2,-c/2),this.copy(G.mergeGeometries([g,b],!0))}}class z extends e.BufferGeometry{constructor(t=.4,o=1.2,s=.2){super();const a=o*.6,m=new e.BoxGeometry(t/2,a,s);m.translate(0,a/2,0);const r=t*1.5,n=new e.BoxGeometry(r,t/4,s);n.translate(0,a*.75,0),this.copy(G.mergeGeometries([m,n],!1)),this.computeVertexNormals()}}class _ extends e.BufferGeometry{constructor(t=1.75,o=.75){super();const s=t*.05,a=t*.15,m=t*.15,r=t*.75;let n=0;const c=new e.BoxGeometry(o,s,o);c.translate(0,n+s/2,0),n+=s;const i=new e.BoxGeometry(o*.8,a,o*.8);i.translate(0,n+a/2,0),n+=a;const h=new e.BoxGeometry(o*.6,m,o*.6);h.translate(0,n+m/2,0),n+=m;const u=new e.BoxGeometry(o*.4,r,o*.4);u.translate(0,n+r/2,0),n+=r;const d=new e.ConeGeometry(o*.4/Math.sqrt(2),.1,4,1,!1,Math.PI/4);d.translate(0,n+.1/2,0),this.copy(G.mergeGeometries([c,i,h,u,d],!1)),this.computeVertexNormals()}}class q extends e.BufferGeometry{constructor(t=.6,o=1,s=.2,a=.6){super();const m=o-a/2,r=new e.BoxGeometry(t,m,s);r.translate(0,m/2,0);const n=new e.CylinderGeometry(a/2,a/2,s,16,1,!1,0,Math.PI);n.rotateY(Math.PI/2),n.rotateX(Math.PI/2),n.translate(0,m,0),this.copy(G.mergeGeometries([r,n],!1)),this.computeVertexNormals()}}class O extends e.BufferGeometry{constructor(t=.5,o=.8,s=.15){super();const a=new e.BoxGeometry(t,o,s);a.translate(0,o/2,0),this.copy(a)}}class D extends e.BufferGeometry{constructor({height: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 a=new e.BoxGeometry(1.4,.3,1.4);a.translate(0,.5+t+.15,0),this.copy(G.mergeGeometries([o,s,a],!1))}}class E extends e.BufferGeometry{constructor({barHeight:t=2,barRadius:o=.05,spikeHeight:s=.3,spikeRadius:a=.075,spikeScaleZ:m=1,radialSegments:r=8}={}){super();const n=new e.CylinderGeometry(o,o,t,r);n.translate(0,t/2,0);const c=new e.ConeGeometry(a,s,r);c.translate(0,t+s/2,0),c.scale(1,1,m),this.copy(G.mergeGeometries([n,c],!1))}}class H extends e.BufferGeometry{constructor({count:t=20,spacing:o=.4,barHeight:s=2,barRadius:a=.05,spikeHeight:m=.3,spikeRadius:r=.075,spikeScaleZ:n=1,railHeight:c=.1,railDepth:i=.05,railOffset:h=0}={}){super();const u=[],d=new E({barHeight:s,barRadius:a,spikeHeight:m,spikeRadius:r,spikeScaleZ:n}),f=new e.BoxGeometry(t*o,c,i);for(let y=0;y<t;y++){const x=d.clone();x.translate(y*o,0,0),u.push(x)}const M=f.clone();M.translate(o*(t-1)/2,s-h-c/2,0),u.push(M);const p=f.clone();p.translate(o*(t-1)/2,c/2,0),u.push(p),this.copy(G.mergeGeometries(u))}}class ve extends e.BufferGeometry{constructor(t=.1){super();const o=[],s=[],a=[[0,1],[.5,.75],[.75,.25],[.5,-.5],[0,-1],[-.5,-.5],[-.75,.25],[-.5,.75]];for(let r=0;r<a.length;r++){const[n,c]=a[r];o.push(n*t,c*t,0)}for(let r=1;r<a.length-1;r++)s.push(0,r,r+1);s.push(0,a.length-1,1);const m=new e.Float32BufferAttribute(o,3);this.setAttribute("position",m),this.setIndex(s),this.computeVertexNormals()}}function R(l,t=v.XYZ,o=.5,s=2){l.deleteAttribute("uv"),l.deleteAttribute("normal"),l=G.mergeVertices(l),l.computeVertexNormals();const a=l.getAttribute("position");for(let m=0;m<a.count;m++){const r=new e.Vector3().fromBufferAttribute(a,m),n=Math.random()*(s-o)+o,c=t.clone().multiplyScalar(n);r.add(c),a.setXYZ(m,r.x,r.y,r.z)}return a.needsUpdate=!0,l.computeVertexNormals(),l}class X extends e.BufferGeometry{constructor(t=1,o=4,s=4){super();const a=new e.SphereGeometry(t,o,s);this.copy(R(a,v.XYZ,.5,1)),this.computeVertexNormals(),this.center()}}class ge extends e.BufferGeometry{constructor(t=.1,o=.1,s=.4,a=8){super();const m=new e.CylinderGeometry(t*.6,o*.6,s,a);m.translate(0,0,0);const r=new e.SphereGeometry(t,a,a),n=r.clone(),c=r.clone(),i=r.clone(),h=r.clone();n.translate(0,s/2+t*.6,-t*.6),c.translate(0,s/2+t*.6,t*.6),i.translate(0,-s/2-o*.6,-o*.6),h.translate(0,-s/2-o*.6,o*.6),this.copy(G.mergeGeometries([m,n,c,i,h],!1))}}class Y 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 Z 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 T extends e.BufferGeometry{constructor(t=.2,o=.2,s=3,a=32,m=!0){super();const r=new e.CylinderGeometry(t,o,s,a,1,m),n=new e.SphereGeometry(o,a,a/2,0,Math.PI*2,Math.PI/2,Math.PI/2);n.translate(0,-(s/2),0),this.copy(G.mergeGeometries([r,n],!1))}}class j extends e.BufferGeometry{constructor({radius:t=.5,neckRadius:o=.2,height:s=3,neckHeight:a=1,segments:m=16}={}){super();const r=s-a,n=new e.CylinderGeometry(t,t,r,m);n.translate(0,r/2,0);const c=.3,i=new e.CylinderGeometry(o,t,c,m);i.translate(0,r+c/2,0);const h=new e.CylinderGeometry(o,o,a,m);h.translate(0,r+c+a/2,0),this.copy(G.mergeGeometries([n,i,h],!1))}}class Q extends e.BufferGeometry{constructor({radius:t=3,height:o=.6,widthSegments:s=64,heightSegments:a=16,phiStart:m=0,phiLength:r=Math.PI*2}={}){super(),this.copy(new e.SphereGeometry(t,s,a,m,r,0,Math.PI/2)),this.scale(1,o/t,1)}}const be=(l,t)=>l/(1-Math.cos(t)),F=(l,t)=>l/(2*Math.sin(t)),K=(l,t)=>l*(1-Math.cos(t)),Be=(l,t)=>2*l*Math.sin(t);class J extends e.BufferGeometry{constructor({radius:t=F(5,Math.PI/10),widthSegments:o=64,heightSegments:s=32,phiStart:a=0,phiLength:m=Math.PI*2,thetaLength:r=Math.PI/10}={}){super(),this.copy(new e.SphereGeometry(t,o,s,a,m,0,r));const n=K(t,r);this.translate(0,-t+n,0)}}class $ extends e.BufferGeometry{constructor({trunkRadiusTop:t=.25,trunkRadiusBottom:o=.4,trunkHeight:s=2.5,trunkSegments:a=14,leafSize:m=.8,leafCount:r=6,leafDetail:n=0,leafSpreadRadius:c=1.5}={}){super();const i=new e.CylinderGeometry(t,o,s,a);i.translate(0,s/2,0);const h=[];for(let u=0;u<r;u++){const d=new e.DodecahedronGeometry(m,n);d.translate((Math.random()-.5)*c,(Math.random()-.5)*m+s,(Math.random()-.5)*c),h.push(d)}this.copy(G.mergeGeometries([i.toNonIndexed(),G.mergeGeometries(h,!1)],!0)),this.computeVertexNormals()}}class Ie 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
|
-
`}),s=new e.Mesh(t,o);this.add(s)}}class we 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 r=new e.BoxGeometry(4,3,4),c=new e.MeshStandardMaterial({color:6908265,flatShading:!0}),n=new e.Mesh(r,c);n.position.set(0,2.5,0),this.add(n);const a=new e.ConeGeometry(3.5,2,4),i=new e.MeshStandardMaterial({color:5263440,flatShading:!0}),m=new e.Mesh(a,i);m.rotation.y=Math.PI/4,m.position.set(0,5,0),this.add(m);const h=new e.CylinderGeometry(.2,.2,3.5,16),u=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 B=new e.Mesh(h,u);B.position.set(...x),this.add(B)});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 M={depth:.5,bevelEnabled:!1},p=new e.ExtrudeGeometry(f,M),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.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 r=[];r.push(new e.Vector2(.2,0)),r.push(new e.Vector2(.25,.5)),r.push(new e.Vector2(.15,1.5)),r.push(new e.Vector2(.3,3));const c=new e.LatheGeometry(r,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 m=new e.Mesh(c,n);m.position.set(...i),this.add(m)}),this.add(s)}}class Se 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),r=new e.MeshBasicMaterial({color:16753920});this.flame=new e.Mesh(s,r),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 ve extends e.Group{constructor(t=1.3,o=.5){super();const s=new e.CylinderGeometry(o,o,.2,16),r=new e.MeshStandardMaterial({color:9127187,flatShading:!0}),c=new e.Mesh(s,r);c.position.set(0,0,0),this.add(c);const n=new e.CylinderGeometry(o*.9,o*.9,t),a=new e.MeshStandardMaterial({color:16766720,flatShading:!0,transparent:!0,opacity:.6}),i=new e.Mesh(n,a);i.position.set(0,t/2+.1,0),this.add(i);const m=new e.ConeGeometry(o*1.1,.5,8),h=new e.MeshStandardMaterial({color:9127187,flatShading:!0}),u=new e.Mesh(m,h);u.position.set(0,t+.35,0),this.add(u);const d=new e.TorusGeometry(o*.8,.05,8,16),f=new e.MeshStandardMaterial({color:9127187,flatShading:!0}),M=new e.Mesh(d,f);M.position.set(0,t+.85,0),this.add(M);const p=new e.PointLight(16755200,1.5,15);p.position.set(0,t/2+.1,0),p.castShadow=!0,this.add(p)}}class ge 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 r=0;r<5;r++){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);const n=new e.Mesh(t,s);n.scale.set(c.scale.x*.9,c.scale.y*.5,c.scale.z*.9),n.rotation.copy(c.rotation),n.position.copy(c.position),n.position.y+=.3,this.add(n)}}}class be extends e.Mesh{constructor(t=1,o=4,s=4){super(),this.geometry=new F(t,o,s),this.material=new e.MeshStandardMaterial({color:8421504,flatShading:!0})}}class Be 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 r=new e.Mesh(t,o);r.scale.set(.8+Math.random()*.4,.8+Math.random()*.4,.8+Math.random()*.4),r.rotation.set(Math.random()*Math.PI,Math.random()*Math.PI,Math.random()*Math.PI),r.position.set((Math.random()-.5)*4,0,(Math.random()-.5)*4),this.add(r)}}}class ke extends e.Group{constructor(){super();const t=new U,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 Pe extends e.Group{constructor(){super();const t=new e.BoxGeometry(1.6,.05,2.1),o=new e.MeshStandardMaterial({color:9109504}),s=new e.Mesh(t,o),r=new e.Mesh(t,o);s.position.set(0,.125,0),r.position.set(0,-.125,0);const c=new e.BoxGeometry(1.55,.2,2),n=new e.MeshStandardMaterial({color:16777215}),a=new e.Mesh(c,n);a.position.set(-.025,0,0);const i=new e.BoxGeometry(.05,.25,2.1),m=new e.MeshStandardMaterial({color:4915200}),h=new e.Mesh(i,m);h.position.set(-.8,0,0),this.add(s),this.add(r),this.add(a),this.add(h)}}class Ie 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),r=new e.MeshStandardMaterial({color:8965375,transparent:!0,opacity:.5,roughness:.1,metalness:.3}),c=new e.MeshStandardMaterial({color:16724838,transparent:!0,opacity:.6}),n=new e.MeshStandardMaterial({color:9127187,roughness:1}),a=new e.Mesh(o,r),i=new e.Mesh(o,c),m=new e.Mesh(s,n);i.scale.set(.8,.8,.8),i.position.y=.1,m.position.y=2.5;const h=new e.Group;h.add(a,i,m),this.add(h)}}class Te 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 r=new e.CylinderGeometry(.1,.1,.7,16),c=new e.MeshStandardMaterial({color:5592405,roughness:.5,metalness:.4}),n=new e.Mesh(r,c);n.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}),m=new e.Mesh(a,i);m.position.y=.8,this.add(s,n,m)}}class Ce 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),r=new e.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7}),c=new e.CylinderGeometry(.3,.3,.1,16),n=new e.MeshStandardMaterial({color:5592405,roughness:.7,metalness:.5}),a=new e.Mesh(t,o);for(let y=-1;y<=1;y++){const w=new e.Mesh(s,r);w.position.set(y,1.5,.1),a.add(w)}const i=new e.Mesh(c,n);i.rotation.x=Math.PI/2,i.position.set(0,.5,.15),a.add(i);const m=new e.SphereGeometry(.15,8,8),h=new e.MeshStandardMaterial({color:16711680,emissive:16711680,emissiveIntensity:.5}),u=new e.Mesh(m,h);u.position.set(0,-1,.1),a.add(u),this.add(a);let d=.015,f=.8,M=.2;function p(){requestAnimationFrame(p);const y=M+Math.abs(Math.sin(Date.now()*d))*(f-M);u.material.emissiveIntensity=y}p()}}class Ae 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),r=new e.MeshStandardMaterial({color:8965290,transparent:!0,opacity:.4,roughness:.1,metalness:.5}),c=new e.MeshStandardMaterial({color:9127187,roughness:1}),n=new e.Mesh(o,r),a=new e.Mesh(s,c);a.position.y=3.5,this.add(n,a)}}class Ee 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),r=new e.CylinderGeometry(.1,.1,.2,8),c=new e.CylinderGeometry(.05,.05,1,8),n=new e.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7});for(let a=-.5;a<=.5;a+=.5){const i=new e.Mesh(r,n);i.position.set(a,1,.1);const m=new e.Mesh(c,n);m.position.y=.5,i.add(m),this.add(i)}this.add(s)}}class Ve 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 r=new e.BoxGeometry(.2,1,.2),c=new e.Mesh(r,o);c.position.set(0,.6,-.2);const n=new e.CylinderGeometry(.1,.1,.4,8),a=new e.MeshStandardMaterial({color:3355443,roughness:.5,metalness:.6}),i=new e.Mesh(n,a);i.position.set(0,1.1,-.35),i.rotation.x=-Math.PI/4;const m=new e.BoxGeometry(.6,.1,.6),h=new e.MeshStandardMaterial({color:5592405,roughness:.8,metalness:.2}),u=new e.Mesh(m,h);u.position.set(0,.6,0),this.add(s,c,i,u)}}class Ne extends e.Group{constructor(){super();const t=new L,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}),r=new e.MeshStandardMaterial({color:9132587,roughness:.8,metalness:.1}),c=new e.Mesh(t,s),n=new e.Mesh(o,r);n.position.set(.3,1.3,0),n.rotation.z=Math.PI/4,this.add(c,n)}}class Fe extends e.Group{constructor(){super();const t=100,o=.05,s=new e.CatmullRomCurve3(Array.from({length:t},(m,h)=>{const u=h*.2;return new e.Vector3(Math.cos(u)*.4,h*o,Math.sin(u)*.4)})),r=new e.TubeGeometry(s,200,.1,8,!1),c=new e.MeshStandardMaterial({color:8965375,transparent:!0,opacity:.3,roughness:.1,metalness:.2,emissive:8965375}),n=new e.Mesh(r,c);this.add(n);function a(){c.emissiveIntensity=.2+Math.sin(Date.now()*.005)*.1}function i(){requestAnimationFrame(i),a()}i()}}class Ue 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 r=new e.CylinderGeometry(.02,.02,.4,8),c=new e.MeshStandardMaterial({color:6710886,roughness:.8,metalness:.3}),n=[];for(let a=0;a<3;a++){const i=a/3*Math.PI*2,m=new e.Mesh(r,c);m.position.set(Math.cos(i)*.25,.2,Math.sin(i)*.25),n.push(m)}this.add(s,...n)}}class Le 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 r=new e.CylinderGeometry(.15,.15,2,12,1,!0),c=new e.MeshStandardMaterial({color:16737792,roughness:.5,metalness:.8,side:e.DoubleSide}),n=new e.Mesh(r,c);n.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(s,n,i);const m=[];for(let d=0;d<5;d++){const f=new e.LineBasicMaterial({color:10079487}),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)],p=new e.BufferGeometry().setFromPoints(M),y=new e.Line(p,f);this.add(y),m.push(y)}function h(){m.forEach(d=>{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)];d.geometry.setFromPoints(f)})}function u(){requestAnimationFrame(u),h()}u()}}class _e extends e.Group{constructor(t=.2,o=.2,s=3,r=32){super();const c=new T(t,o,s,r),n=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,n);this.add(a)}}class ze extends e.Group{constructor(t=3,o=[65450,16711850,11141375]){super();const s=new e.BoxGeometry(3,.2,1),r=new e.MeshStandardMaterial({color:9127187,roughness:.7,metalness:.3}),c=new e.Mesh(s,r);c.position.y=.5;const n=new T(.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 m=new e.Mesh(n,a),h=(i-(t-1)/2)*.8;m.position.set(h,1,0);const u=new T(.099,.099,.5,16,!1),d=o[i%o.length],f=new e.MeshStandardMaterial({color:d,emissive:d,emissiveIntensity:.5,transparent:!0,opacity:.6}),M=new e.Mesh(u,f);M.position.set(0,-.25,0),m.add(M),c.add(m)}this.add(c)}}class qe extends e.Mesh{constructor(){super();const t=new _,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 q extends e.Shape{constructor(t=5,o=.5,s=1){super();const r=Math.PI*2/t,c=r/2,n=r/4;this.moveTo(Math.cos(0)*s,-Math.sin(0)*s);for(let a=1;a<=t;++a){let i=Math.cos(r*a-n*3)*(o/Math.cos(n)),m=-Math.sin(r*a-n*3)*(o/Math.cos(n)),h=Math.cos(r*a-c)*o,u=-Math.sin(r*a-c)*o;this.quadraticCurveTo(i,m,h,u),i=Math.cos(r*a-n)*(o/Math.cos(n)),m=-Math.sin(r*a-n)*(o/Math.cos(n)),h=Math.cos(r*a)*s,u=-Math.sin(r*a)*s,this.quadraticCurveTo(i,m,h,u)}this.closePath()}}class Oe extends e.Mesh{constructor(t=5,o=.5,s=1,r=.25){super();const c=new q(t,o,s),n=new e.ExtrudeGeometry(c,{depth:r,bevelEnabled:r>0,bevelThickness:0,bevelSize:0}),a=new e.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});n.center(),this.geometry=n,this.material=a}}class O extends e.Shape{constructor(t=5,o=.5,s=1,r=5,c=.25){super();const n=Math.PI*2/t,a=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-a*3)*o,-Math.sin(n*i-a*3)*o),this.lineTo(Math.cos(n*i-a*2)*o,-Math.sin(n*i-a*2)*o),this.lineTo(Math.cos(n*i-a)*s,-Math.sin(n*i-a)*s),this.lineTo(Math.cos(n*i)*s,-Math.sin(n*i)*s);if(this.closePath(),c>0&&r>2){const i=new e.Path,m=Math.PI*2/r;i.moveTo(Math.cos(0)*c,-Math.sin(0)*c);for(let h=1;h<r;++h)i.lineTo(Math.cos(m*h)*c,-Math.sin(m*h)*c);i.lineTo(Math.cos(0)*c,-Math.sin(0)*c),this.holes.push(i)}}}class Xe extends e.Mesh{constructor(t=5,o=.5,s=1,r=5,c=.25,n=.25){super();const a=new O(t,o,s,r,c),i=new e.ExtrudeGeometry(a,{depth:n,bevelEnabled:n>0,bevelThickness:0,bevelSize:0}),m=new e.MeshStandardMaterial({color:11184810,metalness:.8,roughness:.2,reflectivity:.5});i.center(),this.geometry=i,this.material=m}}class X extends e.Shape{constructor(t=1,o=2.1,s=1.4,r=1.6){super(),this.moveTo(0,s*t/3),this.bezierCurveTo(-o*.375*t,s*t,-o*t,s*t/3,0,-r*t),this.bezierCurveTo(o*t,s*t/3,o*.375*t,s*t,0,s*t/3)}}class Ye extends e.Mesh{constructor(t=1,o=1,s=1,r=10,c=.25){super();const n=new X(t,o,s,r),a=new e.ExtrudeGeometry(n,{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 Y extends e.Shape{constructor(t=5,o=.5,s=1){super();const r=Math.PI*2/t,c=r/2;this.moveTo(Math.cos(0)*s,Math.sin(0)*s);for(let n=1;n<=t;++n)this.lineTo(Math.cos(r*n-c)*o,Math.sin(r*n-c)*o),this.lineTo(Math.cos(r*n)*s,Math.sin(r*n)*s);this.closePath()}}class Ze extends e.Mesh{constructor(t=5,o=.5,s=1,r=.25){super();const c=new Y(t,o,s),n=new e.ExtrudeGeometry(c,{depth:r,bevelEnabled:r>0,bevelThickness:0,bevelSize:0}),a=new e.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});n.center(),this.geometry=n,this.material=a}}class Re extends e.Mesh{constructor({trunkRadiusTop:t=.25,trunkRadiusBottom:o=.4,trunkHeight:s=2.5,trunkSegments:r=14,trunkColor:c=9127187,leafSize:n=.8,leafCount:a=6,leafDetail:i=0,leafSpreadRadius:m=1.5,leafColor:h=2263842}={}){super();const u=new z({trunkRadiusTop:t,trunkRadiusBottom:o,trunkHeight:s,trunkSegments:r,trunkColor:c,leafSize:n,leafCount:a,leafDetail:i,leafSpreadRadius:m,leafColor:h}),d=new e.MeshStandardMaterial({color:c,roughness:.9,metalness:0,flatShading:!0}),f=new e.MeshStandardMaterial({color:h,roughness:.8,metalness:0,flatShading:!0});this.geometry=u,this.material=[d,f]}}const C={uniforms:{},vertexShader:`
|
|
38
|
+
`}),s=new e.Mesh(t,o);this.add(s)}}class Pe extends e.Mesh{constructor({width:t=1,height:o=1.5,depth:s=.5,coverThickness:a=.05,pageIndent:m=.05,coverColor:r=9109504,pageColor:n=16777215}={}){super(),this.geometry=new L(t,o,s,a,m),this.material=[new e.MeshStandardMaterial({color:r,metalness:.1,roughness:.7,flatShading:!0}),new e.MeshStandardMaterial({color:n,flatShading:!0})]}}class ke extends e.Mesh{constructor(t=.4,o=1.2,s=.2){super(),this.geometry=new z(t,o,s),this.material=new e.MeshStandardMaterial({color:7829367,roughness:.8})}}class Ae 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 a=new e.BoxGeometry(4,3,4),m=new e.MeshStandardMaterial({color:6908265,flatShading:!0}),r=new e.Mesh(a,m);r.position.set(0,2.5,0),this.add(r);const n=new e.ConeGeometry(3.5,2,4),c=new e.MeshStandardMaterial({color:5263440,flatShading:!0}),i=new e.Mesh(n,c);i.rotation.y=Math.PI/4,i.position.set(0,5,0),this.add(i);const h=new e.CylinderGeometry(.2,.2,3.5,16),u=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(w=>{const I=new e.Mesh(h,u);I.position.set(...w),this.add(I)});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 M={depth:.5,bevelEnabled:!1},p=new e.ExtrudeGeometry(f,M),y=new e.MeshStandardMaterial({color:4210752,flatShading:!0}),x=new e.Mesh(p,y);x.position.set(0,.5,1.7),this.add(x)}}class Ce extends e.Mesh{constructor(t=1.75,o=.75){super(),this.geometry=new _(t,o),this.material=new e.MeshStandardMaterial({color:7829367,roughness:.8})}}class Te extends e.Mesh{constructor(t=.6,o=1,s=.2,a=.6){super(),this.geometry=new q(t,o,s,a),this.material=new e.MeshStandardMaterial({color:7829367,roughness:.8})}}class Ve extends e.Mesh{constructor(t=.5,o=.8,s=.15){super(),this.geometry=new O(t,o,s),this.material=new e.MeshStandardMaterial({color:7829367,roughness:.8})}}class Ee extends e.Mesh{constructor({height:t=2.25}={}){super(),this.geometry=new D({height:t}),this.material=new e.MeshStandardMaterial({color:9141627,flatShading:!0})}}class Fe extends e.Mesh{constructor({barHeight:t=2,barRadius:o=.05,spikeHeight:s=.3,spikeRadius:a=.075,spikeScaleZ:m=1,radialSegments:r=8}={}){super(),this.geometry=new E({barHeight:t,barRadius:o,spikeHeight:s,spikeRadius:a,spikeScaleZ:m,radialSegments:r}),this.material=new e.MeshStandardMaterial({color:3355443,metalness:.8,roughness:.4})}}class Ne extends e.Mesh{constructor({count:t=20,spacing:o=.4,barHeight:s=2,barRadius:a=.05,spikeHeight:m=.3,spikeRadius:r=.075,spikeScaleZ:n=1,railHeight:c=.1,railDepth:i=.05,railOffset:h=0}={}){super(),this.geometry=new H({count:t,spacing:o,barHeight:s,barRadius:a,spikeHeight:m,spikeRadius:r,spikeScaleZ:n,railHeight:c,railDepth:i,railOffset:h}),this.material=new e.MeshStandardMaterial({color:3355443,metalness:.8,roughness:.4})}}class Ue 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 a=[];a.push(new e.Vector2(.2,0)),a.push(new e.Vector2(.25,.5)),a.push(new e.Vector2(.15,1.5)),a.push(new e.Vector2(.3,3));const m=new e.LatheGeometry(a,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(c=>{const i=new e.Mesh(m,r);i.position.set(...c),this.add(i)}),this.add(s)}}class Le 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),a=new e.MeshBasicMaterial({color:16753920});this.flame=new e.Mesh(s,a),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 ze extends e.Group{constructor(t=1.3,o=.5){super();const s=new e.CylinderGeometry(o,o,.2,16),a=new e.MeshStandardMaterial({color:9127187,flatShading:!0}),m=new e.Mesh(s,a);m.position.set(0,0,0),this.add(m);const r=new e.CylinderGeometry(o*.9,o*.9,t),n=new e.MeshStandardMaterial({color:16766720,flatShading:!0,transparent:!0,opacity:.6}),c=new e.Mesh(r,n);c.position.set(0,t/2+.1,0),this.add(c);const i=new e.ConeGeometry(o*1.1,.5,8),h=new e.MeshStandardMaterial({color:9127187,flatShading:!0}),u=new e.Mesh(i,h);u.position.set(0,t+.35,0),this.add(u);const d=new e.TorusGeometry(o*.8,.05,8,16),f=new e.MeshStandardMaterial({color:9127187,flatShading:!0}),M=new e.Mesh(d,f);M.position.set(0,t+.85,0),this.add(M);const p=new e.PointLight(16755200,1.5,15);p.position.set(0,t/2+.1,0),p.castShadow=!0,this.add(p)}}class _e 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 a=0;a<5;a++){const m=new e.Mesh(t,o);m.scale.set(.8+Math.random()*.4,.8+Math.random()*.4,.8+Math.random()*.4),m.rotation.set(Math.random()*Math.PI,Math.random()*Math.PI,Math.random()*Math.PI),m.position.set((Math.random()-.5)*4,0,(Math.random()-.5)*4),this.add(m);const r=new e.Mesh(t,s);r.scale.set(m.scale.x*.9,m.scale.y*.5,m.scale.z*.9),r.rotation.copy(m.rotation),r.position.copy(m.position),r.position.y+=.3,this.add(r)}}}class qe extends e.Mesh{constructor(t=1,o=4,s=4){super(),this.geometry=new X(t,o,s),this.material=new e.MeshStandardMaterial({color:8421504,flatShading:!0})}}class Oe 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 a=new e.Mesh(t,o);a.scale.set(.8+Math.random()*.4,.8+Math.random()*.4,.8+Math.random()*.4),a.rotation.set(Math.random()*Math.PI,Math.random()*Math.PI,Math.random()*Math.PI),a.position.set((Math.random()-.5)*4,0,(Math.random()-.5)*4),this.add(a)}}}class De extends e.Group{constructor(){super();const t=new Y,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 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)],o=new e.LatheGeometry(t,10),s=new e.CylinderGeometry(.3,.4,.2,8),a=new e.MeshStandardMaterial({color:8965375,transparent:!0,opacity:.5,roughness:.1,metalness:.3}),m=new e.MeshStandardMaterial({color:16724838,transparent:!0,opacity:.6}),r=new e.MeshStandardMaterial({color:9127187,roughness:1}),n=new e.Mesh(o,a),c=new e.Mesh(o,m),i=new e.Mesh(s,r);c.scale.set(.8,.8,.8),c.position.y=.1,i.position.y=2.5;const h=new e.Group;h.add(n,c,i),this.add(h)}}class Re 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 a=new e.CylinderGeometry(.1,.1,.7,16),m=new e.MeshStandardMaterial({color:5592405,roughness:.5,metalness:.4}),r=new e.Mesh(a,m);r.position.y=.4;const n=new e.ConeGeometry(.075,.2,16),c=new e.MeshStandardMaterial({color:16733440,emissive:16733440,emissiveIntensity:.6,transparent:!0,opacity:.8}),i=new e.Mesh(n,c);i.position.y=.8,this.add(s,r,i)}}class Xe 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),a=new e.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7}),m=new e.CylinderGeometry(.3,.3,.1,16),r=new e.MeshStandardMaterial({color:5592405,roughness:.7,metalness:.5}),n=new e.Mesh(t,o);for(let y=-1;y<=1;y++){const x=new e.Mesh(s,a);x.position.set(y,1.5,.1),n.add(x)}const c=new e.Mesh(m,r);c.rotation.x=Math.PI/2,c.position.set(0,.5,.15),n.add(c);const i=new e.SphereGeometry(.15,8,8),h=new e.MeshStandardMaterial({color:16711680,emissive:16711680,emissiveIntensity:.5}),u=new e.Mesh(i,h);u.position.set(0,-1,.1),n.add(u),this.add(n);let d=.015,f=.8,M=.2;function p(){requestAnimationFrame(p);const y=M+Math.abs(Math.sin(Date.now()*d))*(f-M);u.material.emissiveIntensity=y}p()}}class Ye 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),a=new e.MeshStandardMaterial({color:8965290,transparent:!0,opacity:.4,roughness:.1,metalness:.5}),m=new e.MeshStandardMaterial({color:9127187,roughness:1}),r=new e.Mesh(o,a),n=new e.Mesh(s,m);n.position.y=3.5,this.add(r,n)}}class Ze 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),a=new e.CylinderGeometry(.1,.1,.2,8),m=new e.CylinderGeometry(.05,.05,1,8),r=new e.MeshStandardMaterial({color:11184810,roughness:.5,metalness:.7});for(let n=-.5;n<=.5;n+=.5){const c=new e.Mesh(a,r);c.position.set(n,1,.1);const i=new e.Mesh(m,r);i.position.y=.5,c.add(i),this.add(c)}this.add(s)}}class je 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 a=new e.BoxGeometry(.2,1,.2),m=new e.Mesh(a,o);m.position.set(0,.6,-.2);const r=new e.CylinderGeometry(.1,.1,.4,8),n=new e.MeshStandardMaterial({color:3355443,roughness:.5,metalness:.6}),c=new e.Mesh(r,n);c.position.set(0,1.1,-.35),c.rotation.x=-Math.PI/4;const i=new e.BoxGeometry(.6,.1,.6),h=new e.MeshStandardMaterial({color:5592405,roughness:.8,metalness:.2}),u=new e.Mesh(i,h);u.position.set(0,.6,0),this.add(s,m,c,u)}}class Qe extends e.Group{constructor(){super();const t=new Z,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}),a=new e.MeshStandardMaterial({color:9132587,roughness:.8,metalness:.1}),m=new e.Mesh(t,s),r=new e.Mesh(o,a);r.position.set(.3,1.3,0),r.rotation.z=Math.PI/4,this.add(m,r)}}class Ke extends e.Group{constructor(){super();const t=100,o=.05,s=new e.CatmullRomCurve3(Array.from({length:t},(i,h)=>{const u=h*.2;return new e.Vector3(Math.cos(u)*.4,h*o,Math.sin(u)*.4)})),a=new e.TubeGeometry(s,200,.1,8,!1),m=new e.MeshStandardMaterial({color:8965375,transparent:!0,opacity:.3,roughness:.1,metalness:.2,emissive:8965375}),r=new e.Mesh(a,m);this.add(r);function n(){m.emissiveIntensity=.2+Math.sin(Date.now()*.005)*.1}function c(){requestAnimationFrame(c),n()}c()}}class Je 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 a=new e.CylinderGeometry(.02,.02,.4,8),m=new e.MeshStandardMaterial({color:6710886,roughness:.8,metalness:.3}),r=[];for(let n=0;n<3;n++){const c=n/3*Math.PI*2,i=new e.Mesh(a,m);i.position.set(Math.cos(c)*.25,.2,Math.sin(c)*.25),r.push(i)}this.add(s,...r)}}class $e 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 a=new e.CylinderGeometry(.15,.15,2,12,1,!0),m=new e.MeshStandardMaterial({color:16737792,roughness:.5,metalness:.8,side:e.DoubleSide}),r=new e.Mesh(a,m);r.position.y=1.3;const n=new e.SphereGeometry(.3,16,16),c=new e.Mesh(n,m);c.position.y=2.4,this.add(s,r,c);const i=[];for(let d=0;d<5;d++){const f=new e.LineBasicMaterial({color:10079487}),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)],p=new e.BufferGeometry().setFromPoints(M),y=new e.Line(p,f);this.add(y),i.push(y)}function h(){i.forEach(d=>{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)];d.geometry.setFromPoints(f)})}function u(){requestAnimationFrame(u),h()}u()}}class We extends e.Group{constructor(t=.2,o=.2,s=3,a=32){super();const m=new T(t,o,s,a),r=new e.MeshPhysicalMaterial({color:8965375,transparent:!0,opacity:.4,roughness:.1,metalness:.1,reflectivity:.8,transmission:.9,side:e.DoubleSide}),n=new e.Mesh(m,r);this.add(n)}}class et extends e.Group{constructor(t=3,o=[65450,16711850,11141375]){super();const s=new e.BoxGeometry(3,.2,1),a=new e.MeshStandardMaterial({color:9127187,roughness:.7,metalness:.3}),m=new e.Mesh(s,a);m.position.y=.5;const r=new T(.1,.1,1,16),n=new e.MeshStandardMaterial({color:11184810,transparent:!0,opacity:.4,roughness:.1,metalness:.5,side:e.DoubleSide});for(let c=0;c<t;c++){const i=new e.Mesh(r,n),h=(c-(t-1)/2)*.8;i.position.set(h,1,0);const u=new T(.099,.099,.5,16,!1),d=o[c%o.length],f=new e.MeshStandardMaterial({color:d,emissive:d,emissiveIntensity:.5,transparent:!0,opacity:.6}),M=new e.Mesh(u,f);M.position.set(0,-.25,0),i.add(M),m.add(i)}this.add(m)}}class tt extends e.Mesh{constructor(){super();const t=new j,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 W extends e.Shape{constructor(t=5,o=.5,s=1){super();const a=Math.PI*2/t,m=a/2,r=a/4;this.moveTo(Math.cos(0)*s,-Math.sin(0)*s);for(let n=1;n<=t;++n){let c=Math.cos(a*n-r*3)*(o/Math.cos(r)),i=-Math.sin(a*n-r*3)*(o/Math.cos(r)),h=Math.cos(a*n-m)*o,u=-Math.sin(a*n-m)*o;this.quadraticCurveTo(c,i,h,u),c=Math.cos(a*n-r)*(o/Math.cos(r)),i=-Math.sin(a*n-r)*(o/Math.cos(r)),h=Math.cos(a*n)*s,u=-Math.sin(a*n)*s,this.quadraticCurveTo(c,i,h,u)}this.closePath()}}class ot extends e.Mesh{constructor(t=5,o=.5,s=1,a=.25){super();const m=new W(t,o,s),r=new e.ExtrudeGeometry(m,{depth:a,bevelEnabled:a>0,bevelThickness:0,bevelSize:0}),n=new e.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});r.center(),this.geometry=r,this.material=n}}class ee extends e.Shape{constructor(t=5,o=.5,s=1,a=5,m=.25){super();const r=Math.PI*2/t,n=r/4;this.moveTo(Math.cos(0)*s,-Math.sin(0)*s);for(let c=1;c<=t;++c)this.lineTo(Math.cos(r*c-n*3)*o,-Math.sin(r*c-n*3)*o),this.lineTo(Math.cos(r*c-n*2)*o,-Math.sin(r*c-n*2)*o),this.lineTo(Math.cos(r*c-n)*s,-Math.sin(r*c-n)*s),this.lineTo(Math.cos(r*c)*s,-Math.sin(r*c)*s);if(this.closePath(),m>0&&a>2){const c=new e.Path,i=Math.PI*2/a;c.moveTo(Math.cos(0)*m,-Math.sin(0)*m);for(let h=1;h<a;++h)c.lineTo(Math.cos(i*h)*m,-Math.sin(i*h)*m);c.lineTo(Math.cos(0)*m,-Math.sin(0)*m),this.holes.push(c)}}}class st extends e.Mesh{constructor(t=5,o=.5,s=1,a=5,m=.25,r=.25){super();const n=new ee(t,o,s,a,m),c=new e.ExtrudeGeometry(n,{depth:r,bevelEnabled:r>0,bevelThickness:0,bevelSize:0}),i=new e.MeshStandardMaterial({color:11184810,metalness:.8,roughness:.2,reflectivity:.5});c.center(),this.geometry=c,this.material=i}}class te extends e.Shape{constructor(t=1,o=2.1,s=1.4,a=1.6){super(),this.moveTo(0,s*t/3),this.bezierCurveTo(-o*.375*t,s*t,-o*t,s*t/3,0,-a*t),this.bezierCurveTo(o*t,s*t/3,o*.375*t,s*t,0,s*t/3)}}class rt extends e.Mesh{constructor(t=1,o=1,s=1,a=10,m=.25){super();const r=new te(t,o,s,a),n=new e.ExtrudeGeometry(r,{depth:m,bevelEnabled:m>0,bevelThickness:0,bevelSize:0}),c=new e.MeshStandardMaterial({color:12986408,emissive:12981270,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});n.center(),this.geometry=n,this.material=c}}class oe extends e.Shape{constructor(t=5,o=.5,s=1){super();const a=Math.PI*2/t,m=a/2;this.moveTo(Math.cos(0)*s,Math.sin(0)*s);for(let r=1;r<=t;++r)this.lineTo(Math.cos(a*r-m)*o,Math.sin(a*r-m)*o),this.lineTo(Math.cos(a*r)*s,Math.sin(a*r)*s);this.closePath()}}class nt extends e.Mesh{constructor(t=5,o=.5,s=1,a=.25){super();const m=new oe(t,o,s),r=new e.ExtrudeGeometry(m,{depth:a,bevelEnabled:a>0,bevelThickness:0,bevelSize:0}),n=new e.MeshStandardMaterial({color:16776960,emissive:16766720,emissiveIntensity:.25,metalness:.1,roughness:.3,flatShading:!0});r.center(),this.geometry=r,this.material=n}}class at extends e.Mesh{constructor({trunkRadiusTop:t=.25,trunkRadiusBottom:o=.4,trunkHeight:s=2.5,trunkSegments:a=14,trunkColor:m=9127187,leafSize:r=.8,leafCount:n=6,leafDetail:c=0,leafSpreadRadius:i=1.5,leafColor:h=2263842}={}){super();const u=new $({trunkRadiusTop:t,trunkRadiusBottom:o,trunkHeight:s,trunkSegments:a,trunkColor:m,leafSize:r,leafCount:n,leafDetail:c,leafSpreadRadius:i,leafColor:h}),d=new e.MeshStandardMaterial({color:m,roughness:.9,metalness:0,flatShading:!0}),f=new e.MeshStandardMaterial({color:h,roughness:.8,metalness:0,flatShading:!0});this.geometry=u,this.material=[d,f]}}class ct extends e.Mesh{constructor({radius:t=3,height:o=.6,widthSegments:s=64,heightSegments:a=16,phiStart:m=0,phiLength:r=Math.PI*2}={}){super(),this.geometry=new Q({radius:t,height:o,widthSegments:s,heightSegments:a,phiStart:m,phiLength:r}),this.material=new e.MeshStandardMaterial({color:65280,flatShading:!0})}}class it extends e.Mesh{constructor({radius:t=F(5,Math.PI/10),widthSegments:o=64,heightSegments:s=32,phiStart:a=0,phiLength:m=Math.PI*2,thetaLength:r=Math.PI/10}={}){super(),this.geometry=new J({radius:t,widthSegments:o,heightSegments:s,phiStart:a,phiLength:m,thetaLength:r}),this.material=new e.MeshStandardMaterial({color:65280,flatShading:!0})}}function lt(l,{time:t=0,waveFrequency:o=.2,waveAmplitude:s=.5}={}){l.onBeforeCompile=a=>{a.uniforms.time={value:t},a.uniforms.waveFrequency={value:o},a.uniforms.waveAmplitude={value:s},a.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
|
+
`+a.vertexShader,a.vertexShader=a.vertexShader.replace("#include <begin_vertex>",`
|
|
53
|
+
vec3 transformed = waterDisplacement(position, normal);
|
|
54
|
+
`),l.userData.shader=a}}function mt(l,t){l.userData.shader&&(l.userData.shader.uniforms.time.value+=t)}function ht(l,{time:t=0,intensity:o=1,direction:s=v.XYZ,scale:a=10}={}){l.onBeforeCompile=m=>{m.uniforms.time={value:t},m.uniforms.direction={value:s},m.uniforms.intensity={value:o},m.uniforms.scale={value:a},m.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
|
+
`+m.vertexShader,m.vertexShader=m.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
|
+
`),l.userData.shader=m}}function ut(l,t){l.userData.shader&&(l.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
|
+
`},se={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
|
+
`},C={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,41 +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
|
-
`};
|
|
84
|
-
uniform float time;
|
|
85
|
-
uniform vec3 direction;
|
|
86
|
-
uniform float intensity;
|
|
87
|
-
uniform float scale;
|
|
88
|
-
|
|
89
|
-
float mod289(float x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
|
|
90
|
-
vec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
|
|
91
|
-
vec4 perm(vec4 x) { return mod289(((x * 34.0) + 1.0) * x); }
|
|
92
|
-
|
|
93
|
-
float noise(vec3 p) {
|
|
94
|
-
vec3 a = floor(p);
|
|
95
|
-
vec3 d = p - a;
|
|
96
|
-
d = d * d * (3.0 - 2.0 * d);
|
|
97
|
-
|
|
98
|
-
vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0);
|
|
99
|
-
vec4 k1 = perm(b.xyxy);
|
|
100
|
-
vec4 k2 = perm(k1.xyxy + b.zzww);
|
|
101
|
-
|
|
102
|
-
vec4 c = k2 + a.zzzz;
|
|
103
|
-
vec4 k3 = perm(c);
|
|
104
|
-
vec4 k4 = perm(c + 1.0);
|
|
105
|
-
|
|
106
|
-
vec4 o1 = fract(k3 * (1.0 / 41.0));
|
|
107
|
-
vec4 o2 = fract(k4 * (1.0 / 41.0));
|
|
108
|
-
|
|
109
|
-
vec4 o3 = o2 * d.z + o1 * (1.0 - d.z);
|
|
110
|
-
vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x);
|
|
111
|
-
|
|
112
|
-
return o4.y * d.y + o4.x * (1.0 - d.y);
|
|
113
|
-
}
|
|
114
|
-
`+c.vertexShader,c.vertexShader=c.vertexShader.replace("#include <begin_vertex>",`
|
|
115
|
-
vec3 transformed = vec3(position);
|
|
116
|
-
float n = noise(transformed * scale + time);
|
|
117
|
-
transformed += normalize(direction) * n * intensity;
|
|
118
|
-
vec3 transformedNormal = normal;
|
|
119
|
-
`),l.userData.shader=c}}function He(l,t){l.userData.shader&&(l.userData.shader.uniforms.time.value+=t)}class je extends e.Mesh{constructor(t=1e3){super(),this.geometry=new e.BoxGeometry(t,t,t),this.material=new e.ShaderMaterial({vertexShader:C.vertexShader,fragmentShader:C.fragmentShader,side:e.BackSide})}}class Qe extends e.Mesh{constructor(t=1e3){super(),this.geometry=new e.SphereGeometry(t,32,15),this.material=new e.ShaderMaterial({vertexShader:I.vertexShader,fragmentShader:I.fragmentShader,uniforms:I.uniforms,side:e.BackSide})}}class Ke extends e.Mesh{constructor(t=Math.PI*.49,o=2*Math.PI*.25,s=10,r=2,c=.005,n=.8){super();const a=new j.Sky;a.scale.setScalar(45e4),this.add(a);const i=a.material.uniforms;i.turbidity.value=s,i.rayleigh.value=r,i.mieCoefficient.value=c,i.mieDirectionalG.value=n,this.skyUniforms=i,this.sunPosition(t,o)}sunPosition(t,o){const s=new e.Vector3,r=this.skyUniforms;s.setFromSphericalCoords(1,t,o),r.sunPosition.value.copy(s)}}const Je=l=>{const t=new Uint8Array(4*l*l);for(let s=0;s<l*l;s++){const r=s*4,c=(s%l^Math.floor(s/l))&1?255:0;t[r]=c,t[r+1]=c,t[r+2]=c,t[r+3]=255}const o=new e.DataTexture(t,l,l,e.RGBAFormat,e.UnsignedByteType);return o.wrapS=e.RepeatWrapping,o.wrapT=e.RepeatWrapping,o.minFilter=e.NearestFilter,o.needsUpdate=!0,o};class $e{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,r,c=1){const n=new Q.EffectComposer(t),a=new V.RenderPass(s,o);n.addPass(a);const i=new K.ShaderPass(Z);i.uniforms.opacity.value=1,n.addPass(i);let m=null;function h(d){m||(m=d);const M=(d-m)/1e3/c;i.uniforms.opacity.value=Math.max(1-M,0),M<1?(n.render(),requestAnimationFrame(h)):(n.passes[0]=new V.RenderPass(r,o),m=null,requestAnimationFrame(u))}function u(d){m||(m=d);const M=(d-m)/1e3/c;i.uniforms.opacity.value=Math.min(M,1),M<1&&(n.render(),requestAnimationFrame(u))}requestAnimationFrame(h)}}exports.Beaker=ke;exports.BeakerGeometry=U;exports.BifurcatedStaircaseGeometry=re;exports.BoneGeometry=pe;exports.Book=Pe;exports.Bottle=Ie;exports.Bubbling=ne;exports.BunsenBurner=Te;exports.Burst=Oe;exports.BurstShape=q;exports.Candle=Se;exports.CrossHeadstoneGeometry=me;exports.DaySkybox=je;exports.Desk=Ge;exports.DioramaGeometry=ae;exports.Direction=v;exports.Easing=se;exports.ElectricPanel=Ce;exports.Falloff=b;exports.FenceColumn=Me;exports.Flask=Ae;exports.Gear=Xe;exports.GearShape=O;exports.Heart=Ye;exports.HeartShape=X;exports.LShapedStaircaseGeometry=ce;exports.Lantern=ve;exports.LeverPanel=Ee;exports.Mausoleum=we;exports.Microscope=Ve;exports.Moon=xe;exports.MortarAndPestle=Ne;exports.MortarGeometry=L;exports.MossyRocks=ge;exports.NightSkybox=Qe;exports.ObeliskHeadstoneGeometry=he;exports.Rock=be;exports.RockGeometry=F;exports.Rocks=Be;exports.RoundedHeadstoneGeometry=ue;exports.SceneUtils=$e;exports.SimpleLeafGeometry=ye;exports.SpiralStaircaseGeometry=ie;exports.SpiralTube=Fe;exports.SquareHeadstoneGeometry=de;exports.StaircaseGeometry=le;exports.Stand=Ue;exports.Star=Ze;exports.StarShape=Y;exports.TeslaCoil=Le;exports.TestTube=_e;exports.TestTubeGeometry=T;exports.TestTubeRack=ze;exports.Tree=Re;exports.TreeGeometry=z;exports.TwilightSkybox=Ke;exports.WineBottle=qe;exports.WineBottleGeometry=_;exports.WroughtIronBarGeometry=fe;exports.addNoiseDisplacement=De;exports.checkerboardTexture=Je;exports.daySkyShader=C;exports.displacementBrush=J;exports.fadeShader=Z;exports.flattenBrush=$;exports.nightSkyShader=I;exports.noiseBrush=W;exports.randomTransformVertices=N;exports.smoothBrush=ee;exports.spikeBrush=te;exports.twistBrush=oe;exports.updateMaterialTime=He;
|
|
135
|
+
`};class dt 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 Mt extends e.Mesh{constructor(t=1e3){super(),this.geometry=new e.SphereGeometry(t,32,15),this.material=new e.ShaderMaterial({vertexShader:C.vertexShader,fragmentShader:C.fragmentShader,uniforms:C.uniforms,side:e.BackSide})}}class ft extends e.Mesh{constructor(t=Math.PI*.49,o=2*Math.PI*.25,s=10,a=2,m=.005,r=.8){super();const n=new ae.Sky;n.scale.setScalar(45e4),this.add(n);const c=n.material.uniforms;c.turbidity.value=s,c.rayleigh.value=a,c.mieCoefficient.value=m,c.mieDirectionalG.value=r,this.skyUniforms=c,this.sunPosition(t,o)}sunPosition(t,o){const s=new e.Vector3,a=this.skyUniforms;s.setFromSphericalCoords(1,t,o),a.sunPosition.value.copy(s)}}const yt=l=>{const t=new Uint8Array(4*l*l);for(let s=0;s<l*l;s++){const a=s*4,m=(s%l^Math.floor(s/l))&1?255:0;t[a]=m,t[a+1]=m,t[a+2]=m,t[a+3]=255}const o=new e.DataTexture(t,l,l,e.RGBAFormat,e.UnsignedByteType);return o.wrapS=e.RepeatWrapping,o.wrapT=e.RepeatWrapping,o.minFilter=e.NearestFilter,o.needsUpdate=!0,o};function pt(l){const o=new e.Box3().setFromObject(l).getCenter(new e.Vector3);l.translateX(-o.x),l.translateY(-o.y),l.translateZ(-o.z),l.updateMatrixWorld(!0)}function xt(l){l.geometry.computeBoundingBox();const o=l.geometry.boundingBox.getCenter(new e.Vector3);l.geometry.translate(-o.x,-o.y,-o.z)}class wt{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,a,m=1){const r=new ce.EffectComposer(t),n=new U.RenderPass(s,o);r.addPass(n);const c=new ie.ShaderPass(se);c.uniforms.opacity.value=1,r.addPass(c);let i=null;function h(d){i||(i=d);const M=(d-i)/1e3/m;c.uniforms.opacity.value=Math.max(1-M,0),M<1?(r.render(),requestAnimationFrame(h)):(r.passes[0]=new U.RenderPass(a,o),i=null,requestAnimationFrame(u))}function u(d){i||(i=d);const M=(d-i)/1e3/m;c.uniforms.opacity.value=Math.min(M,1),M<1&&(r.render(),requestAnimationFrame(u))}requestAnimationFrame(h)}}exports.Beaker=De;exports.BeakerGeometry=Y;exports.BifurcatedStaircaseGeometry=pe;exports.BoneGeometry=ge;exports.Book=Pe;exports.BookGeometry=L;exports.Bottle=He;exports.Bubbling=ye;exports.BunsenBurner=Re;exports.Burst=ot;exports.BurstShape=W;exports.Candle=Le;exports.CrossHeadstone=ke;exports.CrossHeadstoneGeometry=z;exports.DaySkybox=dt;exports.Desk=Ue;exports.DioramaGeometry=xe;exports.Direction=v;exports.Easing=fe;exports.ElectricPanel=Xe;exports.Falloff=P;exports.FenceColumn=Ee;exports.FenceColumnGeometry=D;exports.Flask=Ye;exports.Gear=st;exports.GearShape=ee;exports.Heart=rt;exports.HeartShape=te;exports.Hill=ct;exports.HillGeometry=Q;exports.LShapedStaircaseGeometry=we;exports.Lantern=ze;exports.LeverPanel=Ze;exports.Mausoleum=Ae;exports.Microscope=je;exports.Moon=Ie;exports.MortarAndPestle=Qe;exports.MortarGeometry=Z;exports.MossyRocks=_e;exports.Mound=it;exports.MoundGeometry=J;exports.NightSkybox=Mt;exports.ObeliskHeadstone=Ce;exports.ObeliskHeadstoneGeometry=_;exports.Rock=qe;exports.RockGeometry=X;exports.Rocks=Oe;exports.RoundedHeadstone=Te;exports.RoundedHeadstoneGeometry=q;exports.SceneUtils=wt;exports.SimpleLeafGeometry=ve;exports.SpiralStaircaseGeometry=Ge;exports.SpiralTube=Ke;exports.SquareHeadstone=Ve;exports.SquareHeadstoneGeometry=O;exports.StaircaseGeometry=Se;exports.Stand=Je;exports.Star=nt;exports.StarShape=oe;exports.TeslaCoil=$e;exports.TestTube=We;exports.TestTubeGeometry=T;exports.TestTubeRack=et;exports.Tree=at;exports.TreeGeometry=$;exports.TwilightSkybox=ft;exports.WineBottle=tt;exports.WineBottleGeometry=j;exports.WroughtIronBar=Fe;exports.WroughtIronBarGeometry=E;exports.WroughtIronFence=Ne;exports.WroughtIronFenceGeometry=H;exports.addNoiseDisplacement=ht;exports.addWaterDisplacement=lt;exports.calculateSphereCapHeight=K;exports.calculateSphereCapWidth=Be;exports.centerMesh=pt;exports.centerMeshGeometry=xt;exports.checkerboardTexture=yt;exports.daySkyShader=V;exports.displacementBrush=le;exports.fadeShader=se;exports.flattenBrush=me;exports.nightSkyShader=C;exports.noiseBrush=he;exports.radiusForSphereCapHeight=be;exports.radiusForSphereCapWidth=F;exports.randomTransformVertices=R;exports.smoothBrush=ue;exports.spikeBrush=de;exports.twistBrush=Me;exports.updateNoiseDisplacementTime=ut;exports.updateWaterDisplacementTime=mt;
|
|
120
136
|
//# sourceMappingURL=index.cjs.js.map
|