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

3 lines
54 KiB
JavaScript
Raw Normal View History

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