2020-10-04 06:49:05 +08:00
|
|
|
{"version":3,"file":"trois.module.min.js","sources":["../src/core/useThree.js","../src/core/Renderer.js","../src/tools.js","../src/use/useBindProp.js","../src/core/PerspectiveCamera.js","../src/core/Scene.js","../src/core/Texture.js","../src/core/CubeTexture.js","../src/geometries/Geometry.js","../src/geometries/BoxGeometry.js","../src/geometries/CircleGeometry.js","../src/geometries/ConeGeometry.js","../src/geometries/CylinderGeometry.js","../src/geometries/DodecahedronGeometry.js","../src/geometries/IcosahedronGeometry.js","../src/geometries/LatheGeometry.js","../src/geometries/OctahedronGeometry.js","../src/geometries/PolyhedronGeometry.js","../src/geometries/RingGeometry.js","../src/geometries/SphereGeometry.js","../src/geometries/TetrahedronGeometry.js","../src/geometries/TorusGeometry.js","../src/geometries/TorusKnotGeometry.js","../src/geometries/TubeGeometry.js","../src/lights/Light.js","../src/lights/AmbientLight.js","../src/lights/DirectionalLight.js","../src/lights/PointLight.js","../src/lights/SpotLight.js","../src/materials/Material.js","../src/materials/BasicMaterial.js","../src/materials/LambertMaterial.js","../src/materials/PhongMaterial.js","../src/materials/StandardMaterial.js","../src/materials/PhysicalMaterial.js","../src/materials/SubsurfaceScatteringShader.js","../src/materials/SubSurfaceMaterial.js","../src/materials/ShaderMaterial.js","../src/materials/ToonMaterial.js","../src/materials/Map.js","../src/materials/EnvMap.js","../src/meshes/Mesh.js","../src/meshes/Box.js","../src/meshes/Circle.js","../src/meshes/Cone.js","../src/meshes/Cylinder.js","../src/meshes/Dodecahedron.js","../src/meshes/Icosahedron.js","../src/meshes/Lathe.js","../src/meshes/Octahedron.js","../src/meshes/Plane.js","../src/meshes/Polyhedron.js","../src/meshes/Ring.js","../src/meshes/Sphere.js","../src/meshes/Tetrahedron.js","../src/meshes/TextProps.js","../src/meshes/Text.js","../src/meshes/Torus.js","../src/meshes/TorusKnot.js","../src/meshes/Tube.js","../src/meshes/Gem.js","../src/meshes/Image.js","../src/meshes/InstancedMesh.js","../src/meshes/MirrorMesh.js","../src/meshes/RefractionMesh.js","../src/meshes/Sprite.js","../src/effects/EffectComposer.js","../src/effects/EffectPass.js","../src/effects/RenderPass.js","../src/effects/BokehPass.js","../src/effects/FilmPass.js","../src/effects/HalftonePass.js","../src/effects/SAOPass.js","../src/effects/UnrealBloomPass.js","../src/glsl/snoise2.glsl.js","../src/components/noisy/NoisyImage.js","../src/components/noisy/NoisyPlane.js","../src/components/noisy/NoisySphere.js","../src/components/noisy/NoisyText.js","../src/components/sliders/AnimatedPlane.js","../src/components/sliders/Slider1.vue","../src/use/useTextures.js","../src/components/viewers/GLTFViewer.vue","../src/plugin.js"],"sourcesContent":["import {\r\n Plane,\r\n Raycaster,\r\n Vector2,\r\n Vector3,\r\n WebGLRenderer,\r\n} from 'three';\r\n\r\nimport { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';\r\n\r\n/**\r\n * Three.js helper\r\n */\r\nexport default function useThree() {\r\n // default conf\r\n const conf = {\r\n canvas: null,\r\n antialias: true,\r\n alpha: false,\r\n autoClear: true,\r\n orbit_ctrl: false,\r\n mouse_move: false,\r\n mouse_raycast: false,\r\n resize: 'window',\r\n width: 0,\r\n height: 0,\r\n };\r\n\r\n // size\r\n const size = {\r\n width: 0, height: 0,\r\n wWidth: 0, wHeight: 0,\r\n ratio: 0,\r\n };\r\n\r\n // handlers\r\n let afterInitCallbacks = [];\r\n let afterResizeCallbacks = [];\r\n let beforeRenderCallbacks = [];\r\n\r\n // mouse tracking\r\n const mouse = new Vector2();\r\n const mouseV3 = new Vector3();\r\n const mousePlane = new Plane(new Vector3(0, 0, 1), 0);\r\n const raycaster = new Raycaster();\r\n\r\n // returned object\r\n const obj = {\r\n conf,\r\n renderer: null,\r\n camera: null,\r\n cameraCtrl: null,\r\n materials: {},\r\n scene: null,\r\n size,\r\n mouse, mouseV3,\r\n init,\r\n dispose,\r\n render,\r\n renderC,\r\n setSize,\r\n onAfterInit,\r\n o
|