1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-28 06:22:10 +08:00
trois/build/trois.module.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"vue";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 z,DirectionalLight as P,PointLight as R,SpotLight as B,FrontSide as k,MeshBasicMaterial as E,MeshLambertMaterial as L,TextureLoader as j,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"three";import{OrbitControls as oe}from"three/examples/jsm/controls/OrbitControls.js";import{EffectComposer as he}from"three/examples/jsm/postprocessing/EffectComposer.js";import{RenderPass as ue}from"three/examples/jsm/postprocessing/RenderPass.js";import{BokehPass as de}from"three/examples/jsm/postprocessing/BokehPass.js";import{FilmPass as me}from"three/examples/jsm/postprocessing/FilmPass.js";import{ShaderPass as ce}from"three/examples/jsm/postprocessing/ShaderPass.js";import{FXAAShader as le}from"three/examples/jsm/shaders/FXAAShader.js";import{HalftonePass as fe}from"three/examples/jsm/postprocessing/HalftonePass.js";import{SMAAPass as pe}from"three/examples/jsm/postprocessing/SMAAPass.js";import{UnrealBloomPass as ge}from"three/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.orbitCtrl.update();u.forEach((function(e){return e()})),p.renderer.render(p.scene,p.camera)},renderC:function(){p.orbitCtrl&&p.orbitCtrl.update();u.forEach((function(e){return e()})),p.composer.render()},setSize:w,onAfterInit:function(e){i.push(e)},onAfterResize:function(e){h.push(e)},offAfterResize:function(e){h=h.filter((function(t){return t!==e}))},onBefore
2020-09-17 05:54:14 +08:00
//# sourceMappingURL=trois.module.min.js.map