1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 12:22:03 +08:00
trois/build/trois.module.cdn.min.js

3 lines
55 KiB
JavaScript
Raw Normal View History

2021-03-05 16:17:16 +08:00
import{h as e,toRef as t,watch as i}from"https://unpkg.com/vue@3.0.5/dist/vue.esm-browser.prod.js";import{Vector2 as r,Vector3 as s,Plane as n,Raycaster as a,WebGLRenderer as o,OrthographicCamera as h,PerspectiveCamera as u,Group as d,Scene as m,Color as c,BoxBufferGeometry as l,CircleBufferGeometry as f,ConeBufferGeometry as p,CylinderBufferGeometry as g,DodecahedronBufferGeometry as y,IcosahedronBufferGeometry as b,LatheBufferGeometry as v,OctahedronBufferGeometry as S,PolyhedronBufferGeometry as N,RingBufferGeometry as w,SphereBufferGeometry as x,TetrahedronBufferGeometry as _,TorusBufferGeometry as C,TorusKnotBufferGeometry as M,Curve as G,TubeBufferGeometry as I,AmbientLight as k,DirectionalLight as z,PointLight as P,SpotLight as R,FrontSide as B,MeshBasicMaterial as j,MeshLambertMaterial as E,TextureLoader as L,MeshMatcapMaterial as T,MeshPhongMaterial as O,MeshStandardMaterial as A,MeshPhysicalMaterial as F,ShaderChunk as U,UniformsUtils as D,ShaderLib as $,ShaderMaterial as H,MeshToonMaterial as W,CubeTextureLoader as V,CubeRefractionMapping as X,Mesh as q,PlaneBufferGeometry as Z,FontLoader as K,TextBufferGeometry as Y,WebGLCubeRenderTarget as J,RGBFormat as Q,LinearMipmapLinearFilter as ee,CubeCamera as te,BackSide as ie,DoubleSide as re,InstancedMesh as se,SpriteMaterial as ne,Sprite as ae}from"https://unpkg.com/three@0.125.2/build/three.module.js";import{OrbitControls as oe}from"https://unpkg.com/three@0.125.2/examples/jsm/controls/OrbitControls.js";import{EffectComposer as he}from"https://unpkg.com/three@0.125.2/examples/jsm/postprocessing/EffectComposer.js";import{RenderPass as ue}from"https://unpkg.com/three@0.125.2/examples/jsm/postprocessing/RenderPass.js";import{BokehPass as de}from"https://unpkg.com/three@0.125.2/examples/jsm/postprocessing/BokehPass.js";import{FilmPass as me}from"https://unpkg.com/three@0.125.2/examples/jsm/postprocessing/FilmPass.js";import{ShaderPass as ce}from"https://unpkg.com/three@0.125.2/examples/jsm/postprocessing/ShaderPass.js";import{FXAAShader as le}from"https://unpkg.com/three@0.125.2/examples/jsm/shaders/FXAAShader.js";import{HalftonePass as fe}from"https://unpkg.com/three@0.125.2/examples/jsm/postprocessing/HalftonePass.js";import{SMAAPass as pe}from"https://unpkg.com/three@0.125.2/examples/jsm/postprocessing/SMAAPass.js";import{UnrealBloomPass as ge}from"https://unpkg.com/three@0.125.2/examples/jsm/postprocessing/UnrealBloomPass.js";function ye(){var e={canvas:null,antialias:!0,alpha:!1,autoClear:!0,orbit_ctrl:!1,mouse_move:!1,mouse_raycast:!1,mouse_over:!1,click:!1,resize:!0,width:0,height:0},t={width:1,height:1,wWidth:1,wHeight:1,ratio:1},i=[],h=[],u=[],d=new r,m=new s,c=new n(new s(0,0,1),0),l=new a,f=[],p={conf:e,renderer:null,camera:null,cameraCtrl:null,materials:{},scene:null,size:t,mouse:d,mouseV3:m,init:function(t){t&&Object.entries(t).forEach((function(t){var i=t[0],r=t[1];e[i]=r}));if(!p.scene)return void console.error("Missing Scene");if(!p.camera)return void console.error("Missing Camera");p.renderer=new o({canvas:e.canvas,antialias:e.antialias,alpha:e.alpha}),p.renderer.autoClear=e.autoClear,e.orbit_ctrl&&(p.orbitCtrl=new oe(p.camera,p.renderer.domElement),e.orbit_ctrl instanceof Object&&Object.entries(e.orbit_ctrl).forEach((function(e){var t=e[0],i=e[1];p.orbitCtrl[t]=i})));e.resize?(N(),window.addEventListener("resize",N)):w(300|e.width,150|e.height);e.mouse_move=e.mouse_move||e.mouse_over,e.mouse_move&&("body"===e.mouse_move?p.mouse_move_element=document.body:p.mouse_move_element=p.renderer.domElement,p.mouse_move_element.addEventListener("mousemove",b),p.mouse_move_element.addEventListener("mouseleave",v));e.click&&p.renderer.domElement.addEventListener("click",y);return i.forEach((function(e){return e()})),!0},dispose:function(){u=[],window.removeEventListener("resize",N),p.mouse_move_element&&(p.mouse_move_element.removeEventListener("mousemove",b),p.mouse_move_element.removeEventListener("mouseleave",v));p.renderer.domElement.removeEventListener("click",y),p.orbitCtrl&&p.orbitCtrl.dispose();this.renderer.dispose()},render:function(){p.orbitCtrl&&p.o
2021-02-26 05:55:44 +08:00
//# sourceMappingURL=trois.module.cdn.min.js.map