2021-04-07 03:46:35 +08:00
|
|
|
import{defineComponent as e,h as t,toRef as r,watch as s,createApp as i}from"vue";import{Vector3 as a,Raycaster as n,Plane as o,Vector2 as h,InstancedMesh as d,WebGLRenderer as l,OrthographicCamera as m,PerspectiveCamera as u,Group as c,Scene as p,Color as f,BoxGeometry as g,CircleGeometry as y,ConeGeometry as b,CylinderGeometry as v,DodecahedronGeometry as S,IcosahedronGeometry as x,LatheGeometry as w,OctahedronGeometry as P,PlaneGeometry as N,PolyhedronGeometry as M,RingGeometry as C,SphereGeometry as L,TetrahedronGeometry as _,TorusGeometry as j,TorusKnotGeometry as z,TubeGeometry as I,Curve as O,CatmullRomCurve3 as G,AmbientLight as k,DirectionalLight as E,HemisphereLight as R,PointLight as A,RectAreaLight as T,SpotLight as B,FrontSide as F,MeshBasicMaterial as D,MeshLambertMaterial as U,TextureLoader as $,MeshMatcapMaterial as W,MeshPhongMaterial as H,MeshStandardMaterial as X,MeshPhysicalMaterial as V,ShaderMaterial as K,ShaderChunk as Z,UniformsUtils as Y,ShaderLib as q,MeshToonMaterial as J,UVMapping as Q,ClampToEdgeWrapping as ee,LinearFilter as te,LinearMipmapLinearFilter as re,CubeTextureLoader as se,CubeRefractionMapping as ie,Mesh as ae,FontLoader as ne,TextGeometry as oe,DoubleSide as he,SpriteMaterial as de,Sprite as le}from"three";import{OrbitControls as me}from"three/examples/jsm/controls/OrbitControls.js";import{RectAreaLightUniformsLib as ue}from"three/examples/jsm/lights/RectAreaLightUniformsLib.js";import{RectAreaLightHelper as ce}from"three/examples/jsm/helpers/RectAreaLightHelper.js";import{GLTFLoader as pe}from"three/examples/jsm/loaders/GLTFLoader.js";import{FBXLoader as fe}from"three/examples/jsm/loaders/FBXLoader.js";import{EffectComposer as ge}from"three/examples/jsm/postprocessing/EffectComposer.js";import{RenderPass as ye}from"three/examples/jsm/postprocessing/RenderPass.js";import{BokehPass as be}from"three/examples/jsm/postprocessing/BokehPass.js";import{FilmPass as ve}from"three/examples/jsm/postprocessing/FilmPass.js";import{ShaderPass as Se}from"three/examples/jsm/postprocessing/ShaderPass.js";import{FXAAShader as xe}from"three/examples/jsm/shaders/FXAAShader.js";import{HalftonePass as we}from"three/examples/jsm/postprocessing/HalftonePass.js";import{SMAAPass as Pe}from"three/examples/jsm/postprocessing/SMAAPass.js";import{SSAOPass as Ne}from"three/examples/jsm/postprocessing/SSAOPass.js";import{UnrealBloomPass as Me}from"three/examples/jsm/postprocessing/UnrealBloomPass.js";function Ce(e){const{camera:t,domElement:r,intersectObjects:s,touch:i=!0,resetOnEnd:l=!1,resetPosition:m=new h(0,0),resetPositionV3:u=new a(0,0,0),onEnter:c=(()=>{}),onMove:p=(()=>{}),onLeave:f=(()=>{}),onIntersectEnter:g=(()=>{}),onIntersectOver:y=(()=>{}),onIntersectMove:b=(()=>{}),onIntersectLeave:v=(()=>{}),onIntersectClick:S=(()=>{})}=e,x=m.clone(),w=new h(0,0),P=function(e){const{camera:t,resetPosition:r=new a(0,0,0)}=e,s=new n,i=r.clone(),h=new o(new a(0,0,1),0);return{position:i,updatePosition:e=>{s.setFromCamera(e,t),t.getWorldDirection(h.normal),s.ray.intersectPlane(h,i)},intersect:(e,r)=>(s.setFromCamera(e,t),s.intersectObjects(r))}}({camera:t}),N=P.position,M={position:x,positionN:w,positionV3:N,intersectObjects:s,listeners:!1,addListeners:function(){r.addEventListener("mouseenter",_),r.addEventListener("mousemove",j),r.addEventListener("mouseleave",I),r.addEventListener("click",z),i&&(r.addEventListener("touchstart",_),r.addEventListener("touchmove",j),r.addEventListener("touchend",I));M.listeners=!0},removeListeners:function(){r.removeEventListener("mouseenter",_),r.removeEventListener("mousemove",j),r.removeEventListener("mouseleave",I),r.removeEventListener("click",z),r.removeEventListener("touchstart",_),r.removeEventListener("touchmove",j),r.removeEventListener("touchend",I),M.listeners=!1},intersect:L};return M;function C(e){let t,s;e.touches&&e.touches.length>0?(t=e.touches[0].clientX,s=e.touches[0].clientY):(t=e.clientX,s=e.clientY);const i=r.getBoundingClientRect();x.x=t-i.left,x.y=s-i.top,w.x=x.x/i.width*2-1,w.y=-x.y/i.height*2+1,P.updatePosition(w)}function L(){if(s.length){const e=P.interse
|