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

3 lines
54 KiB
JavaScript
Raw Permalink 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"vue";import{Vector2 as s,Vector3 as n,Plane as a,Raycaster as o,WebGLRenderer as h,OrthographicCamera as u,PerspectiveCamera as d,Group as m,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 B,SpotLight as E,FrontSide as L,MeshBasicMaterial as j,MeshLambertMaterial as k,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"three";import{OrbitControls as he}from"three/examples/jsm/controls/OrbitControls.js";import{EffectComposer as ue}from"three/examples/jsm/postprocessing/EffectComposer.js";import{RenderPass as de}from"three/examples/jsm/postprocessing/RenderPass.js";import{BokehPass as me}from"three/examples/jsm/postprocessing/BokehPass.js";import{FilmPass as ce}from"three/examples/jsm/postprocessing/FilmPass.js";import{ShaderPass as le}from"three/examples/jsm/postprocessing/ShaderPass.js";import{FXAAShader as fe}from"three/examples/jsm/shaders/FXAAShader.js";import{HalftonePass as pe}from"three/examples/jsm/postprocessing/HalftonePass.js";import{SMAAPass as ge}from"three/examples/jsm/postprocessing/SMAAPass.js";import{UnrealBloomPass as ye}from"three/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=[],d=new s,m=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:d,mouseV3:m,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: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){r.push(e)},onAfterResize:function(e){i.push(e)},offAfterResize:function(e){i=i.filter((function(t){r
2020-09-17 05:54:14 +08:00
//# sourceMappingURL=trois.module.min.js.map