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

3 lines
67 KiB
JavaScript
Raw Normal View History

2020-10-04 06:49:05 +08:00
import{h as e,toRef as t,watch as i,resolveComponent as r,openBlock as n,createBlock as s,withCtx as a,createVNode as o,renderSlot as h}from"vue";import{Vector2 as u,Vector3 as m,Plane as d,Raycaster as c,WebGLRenderer as f,PerspectiveCamera as l,Scene as p,Color as y,TextureLoader as g,CubeTextureLoader as v,BoxBufferGeometry as x,CircleBufferGeometry as b,ConeBufferGeometry as S,CylinderBufferGeometry as w,DodecahedronBufferGeometry as N,IcosahedronBufferGeometry as C,LatheBufferGeometry as z,OctahedronBufferGeometry as M,PolyhedronBufferGeometry as _,RingBufferGeometry as T,SphereBufferGeometry as G,TetrahedronBufferGeometry as P,TorusBufferGeometry as I,TorusKnotBufferGeometry as L,Curve as E,TubeBufferGeometry as B,AmbientLight as j,DirectionalLight as R,PointLight as k,SpotLight as A,FrontSide as D,MeshBasicMaterial as O,MeshLambertMaterial as F,MeshPhongMaterial as U,MeshStandardMaterial as $,MeshPhysicalMaterial as Z,ShaderChunk as W,UniformsUtils as q,ShaderLib as V,ShaderMaterial as H,MeshToonMaterial as Y,Mesh as X,PlaneBufferGeometry as K,FontLoader as J,TextBufferGeometry as Q,WebGLCubeRenderTarget as ee,RGBFormat as te,LinearMipmapLinearFilter as ie,CubeCamera as re,BackSide as ne,DoubleSide as se,InstancedMesh as ae,CubeRefractionMapping as oe,SpriteMaterial as he,Sprite as ue,Object3D as me,Geometry as de,Face3 as ce,BufferGeometry as fe,MathUtils as le,InstancedBufferAttribute as pe}from"three";import{OrbitControls as ye}from"three/examples/jsm/controls/OrbitControls.js";import{EffectComposer as ge}from"three/examples/jsm/postprocessing/EffectComposer.js";import{RenderPass as ve}from"three/examples/jsm/postprocessing/RenderPass.js";import{BokehPass as xe}from"three/examples/jsm/postprocessing/BokehPass.js";import{FilmPass as be}from"three/examples/jsm/postprocessing/FilmPass.js";import{HalftonePass as Se}from"three/examples/jsm/postprocessing/HalftonePass.js";import{SAOPass as we}from"three/examples/jsm/postprocessing/SAOPass.js";import{UnrealBloomPass as Ne}from"three/examples/jsm/postprocessing/UnrealBloomPass.js";import{gsap as Ce,Power4 as ze}from"gsap";import{GLTFLoader as Me}from"three/examples/jsm/loaders/GLTFLoader.js";function _e(){var e={canvas:null,antialias:!0,alpha:!1,autoClear:!0,orbit_ctrl:!1,mouse_move:!1,mouse_raycast:!1,resize:"window",width:0,height:0},t={width:0,height:0,wWidth:0,wHeight:0,ratio:0},i=[],r=[],n=[],s=new u,a=new m,o=new d(new m(0,0,1),0),h=new c,l={conf:e,renderer:null,camera:null,cameraCtrl:null,materials:{},scene:null,size:t,mouse:s,mouseV3:a,init:function(t){t&&Object.entries(t).forEach((function(t){var i=t[0],r=t[1];e[i]=r}));if(!l.scene)return void console.error("Missing Scene");if(!l.camera)return void console.error("Missing Camera");l.renderer=new f({canvas:e.canvas,antialias:e.antialias,alpha:e.alpha}),l.renderer.autoClear=e.autoClear,e.orbit_ctrl&&(l.orbitCtrl=new ye(l.camera,l.renderer.domElement),e.orbit_ctrl instanceof Object&&Object.entries(e.orbit_ctrl).forEach((function(e){var t=e[0],i=e[1];l.orbitCtrl[t]=i})));e.width&&e.height?x(e.width,e.height):e.resize&&(v(),window.addEventListener("resize",v));e.mouse_move&&("body"===e.mouse_move?l.mouse_move_element=document.body:l.mouse_move_element=l.renderer.domElement,l.mouse_move_element.addEventListener("mousemove",p),l.mouse_move_element.addEventListener("mouseleave",y));return i.forEach((function(e){return e()})),!0},dispose:function(){n=[],window.removeEventListener("resize",v),l.mouse_move_element&&(l.mouse_move_element.removeEventListener("mousemove",p),l.mouse_move_element.removeEventListener("mouseleave",y));l.orbitCtrl&&l.orbitCtrl.dispose();this.renderer.dispose()},render:function(){l.orbitCtrl&&l.orbitCtrl.update();n.forEach((function(e){return e()})),l.renderer.render(l.scene,l.camera)},renderC:function(){l.orbitCtrl&&l.orbitCtrl.update();n.forEach((function(e){return e()})),l.composer.render()},setSize:x,onAfterInit:function(e){i.push(e)},onAfterResize:function(e){r.push(e)},offAfterResize:function(e){r=r.filter((function(t){return t!==e}))},onBeforeRender:function(e){n.push(e)},offBeforeRender:f
2020-09-17 05:54:14 +08:00
//# sourceMappingURL=trois.module.min.js.map