mirror of
https://gitee.com/ice-gl/icegl-three-vue-tres.git
synced 2025-04-05 06:22:43 +08:00
2 lines
2.6 KiB
JavaScript
2 lines
2.6 KiB
JavaScript
var B=Object.defineProperty;var m=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var _=(s,a,e)=>a in s?B(s,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[a]=e,c=(s,a)=>{for(var e in a||(a={}))R.call(a,e)&&_(s,e,a[e]);if(m)for(var e of m(a))z.call(a,e)&&_(s,e,a[e]);return s};import{Y as h,Z as r,az as b,aP as g,j as v,a3 as x,w as Y,o as u,s as C,I as k,aU as S,aV as y,ae as Z,c as $,a as d,B as w,C as P,a7 as X,a8 as E,aC as F}from"./vendor-76c85ed2.js";import{_ as M}from"./pagesShow.vue_vue_type_script_setup_true_lang-35f3b154.js";import{_ as V}from"./loading.vue_vue_type_script_setup_true_lang-43ced0f9.js";import"./vanilla-307d3a93.esm-959fd761.js";import"./_commonjsHelpers-725317a4.js";const j=h({__name:"precipitation",props:{speed:{default:12},randomness:{default:0},count:{default:6e3},size:{default:7},areaX:{default:1500},areaY:{default:1e3},areaZ:{default:1500},type:{default:"snow"},color:{default:"#fff"}},async setup(s){let a,e;const t=s,n={snow:"./plugins/digitalCity/image/snow.png",rain:"./plugins/digitalCity/image/rain.png",cilcle:"./plugins/digitalCity/image/cilcle.png"},i=r({});n[t.type]&&(i.value=([a,e]=b(()=>g({map:n[t.type]})),a=await a,e(),a));const o=v();return x(async()=>{}),Y(()=>t.type,async(p,l)=>{var f;p!=l&&((f=i.value)!=null&&f.map&&i.value.map.dispose(),i.value=await g({map:n[p]?n[p]:n.cilcle}))}),(p,l)=>(u(),C(k(S),{ref_key:"precipitationRef",ref:o,position:[0,t.areaY/2,0],speed:t.speed,color:t.color,alphaTest:.5,area:[t.areaX,t.areaY,t.areaZ],count:t.count,depthWrite:!0,randomness:t.randomness,size:t.size,opacity:1,map:i.value.map,alphaMap:i.value.map},null,8,["position","speed","color","area","count","randomness","size","map","alphaMap"]))}}),W=h({__name:"weather",setup(s){const a=v();x(()=>{a.value&&a.value.$refs.perspectiveCameraRef.position.set(750,500,800)});const e=r({speed:12,size:10,count:6e3,color:"#fff",type:"snow"}),t=r({areaX:1500,areaY:1e3,areaZ:1500}),n=r(c(c({},y(e)),y(t))),o=new Z({title:"天气",expanded:!0}).addFolder({title:"下落物"});return o.addBinding(e,"speed",{label:"速度",min:0,max:30,step:1}),o.addBinding(e,"color",{label:"颜色"}),o.addBinding(e,"size",{label:"大小",min:0,max:26,step:1}),o.addBinding(e,"count",{label:"数量",min:1e3,max:1e4,step:100}),o.addBinding(e,"type",{view:"list",label:"类型",options:[{text:"雪",value:"snow"},{text:"雨",value:"rain"},{text:"点",value:"point"}]}),(p,l)=>(u(),$(P,null,[d(V),d(M,{ref_key:"pagesShowRef",ref:a,autoRotate:!1},{ability:w(()=>[(u(),C(F,null,{default:w(()=>[d(j,X(E(n)),null,16)]),_:1}))]),_:1},512)],64))}});export{W as default};
|