import{a4 as t,a5 as e,d as s,q as o,r as a,o as n,c as i,w as r,a as d}from"./vendor.6afcf1a6.js";const u=new t,c=[],l=new e;var h=s({props:{columns:{type:Number,default:20},count:{type:Number,default:2e3},floor:{type:Number,default:.8}},mounted(){const t=this.$refs.mesh.$el.instance,e=this.columns,s=Math.floor(this.count/e);for(let a=0;a<this.count;a++){const n=a%e-.5*e,i=.5*Math.floor(a/e),r=.5*this.count,d=a<r?.5*-e:n,l=a<r?i:i-.25*s,h=a<r?n:.5*e,f={coords:[d,l],originalPosition:[d,l,h],position:[d,l,h],rotation:new o,onSide:a<r,rotationSpeed:{x:.1*Math.random()-.05,y:.1*Math.random()-.05},scale:.5};c.push(f),u.position.set(d,l,h),u.updateMatrix(),t.setMatrixAt(a,u.matrix)}t.instanceMatrix.needsUpdate=!0,this.update()},methods:{update(){if(requestAnimationFrame(this.update),!this.$refs.mesh)return;const t=this.$refs.mesh.$el.instance;if(!t)return;const e=-.005*Date.now();for(let s=0;s<c.length;s++){const o=c[s],{coords:a}=o;let n=.5*l.noise2D(.1*(a[0]+e),.2*(a[1]+e))+.5;n=n>this.floor?2*(n-this.floor):0,u.position.set(...o.originalPosition),u.position[o.onSide?"x":"z"]+=n,u.updateMatrix(),t.setMatrixAt(s,u.matrix)}t.instanceMatrix.needsUpdate=!0}}});h.render=function(t,e,s,o,u,c){const l=a("boxGeometry"),h=a("meshStandardMaterial"),f=a("instancedMesh");return n(),i(f,{args:[null,null,t.count],scale:.3,ref:"mesh"},{default:r((()=>[d(l),d(h)])),_:1},8,["args","scale"])};export{h as _};
