2021-03-07 02:22:01 +08:00
|
|
|
import { createApp as _createApp } from 'vue';
|
2020-09-18 23:08:28 +08:00
|
|
|
import * as TROIS from './index.js';
|
|
|
|
|
2020-09-19 03:52:39 +08:00
|
|
|
export const TroisJSVuePlugin = {
|
2020-09-18 23:08:28 +08:00
|
|
|
install: (app) => {
|
|
|
|
const comps = [
|
|
|
|
'Camera',
|
2020-10-08 05:52:53 +08:00
|
|
|
'OrthographicCamera',
|
2020-09-18 23:08:28 +08:00
|
|
|
'PerspectiveCamera',
|
2021-03-22 21:30:56 +08:00
|
|
|
'Raycaster',
|
2020-09-18 23:08:28 +08:00
|
|
|
'Renderer',
|
|
|
|
'Scene',
|
2021-02-22 04:39:35 +08:00
|
|
|
'Group',
|
2020-09-18 23:08:28 +08:00
|
|
|
|
|
|
|
'AmbientLight',
|
2020-09-19 17:24:03 +08:00
|
|
|
'DirectionalLight',
|
2021-03-07 23:17:18 +08:00
|
|
|
'HemisphereLight',
|
2020-09-18 23:08:28 +08:00
|
|
|
'PointLight',
|
2021-03-07 07:48:06 +08:00
|
|
|
'RectAreaLight',
|
2020-09-18 23:08:28 +08:00
|
|
|
'SpotLight',
|
|
|
|
|
|
|
|
'BasicMaterial',
|
|
|
|
'LambertMaterial',
|
2020-10-04 17:23:02 +08:00
|
|
|
'MatcapMaterial',
|
2020-09-18 23:08:28 +08:00
|
|
|
'PhongMaterial',
|
|
|
|
'PhysicalMaterial',
|
|
|
|
'ShaderMaterial',
|
|
|
|
'StandardMaterial',
|
|
|
|
'SubSurfaceMaterial',
|
2020-10-04 04:32:27 +08:00
|
|
|
'ToonMaterial',
|
2020-09-18 23:08:28 +08:00
|
|
|
|
2020-10-04 20:00:07 +08:00
|
|
|
'Texture',
|
|
|
|
'CubeTexture',
|
2020-10-04 06:07:10 +08:00
|
|
|
|
2020-10-03 17:07:49 +08:00
|
|
|
'Mesh',
|
2021-03-13 07:52:40 +08:00
|
|
|
|
|
|
|
'Box', 'BoxGeometry',
|
|
|
|
'Circle', 'CircleGeometry',
|
|
|
|
'Cone', 'ConeGeometry',
|
|
|
|
'Cylinder', 'CylinderGeometry',
|
|
|
|
'Dodecahedron', 'DodecahedronGeometry',
|
|
|
|
'Icosahedron', 'IcosahedronGeometry',
|
|
|
|
'Lathe', 'LatheGeometry',
|
|
|
|
'Octahedron', 'OctahedronGeometry',
|
2021-04-06 05:25:01 +08:00
|
|
|
'Plane', 'PlaneGeometry',
|
2021-03-13 07:52:40 +08:00
|
|
|
'Polyhedron', 'PolyhedronGeometry',
|
|
|
|
'Ring', 'RingGeometry',
|
|
|
|
'Sphere', 'SphereGeometry',
|
|
|
|
'Tetrahedron', 'TetrahedronGeometry',
|
2020-09-18 23:08:28 +08:00
|
|
|
'Text',
|
2021-03-13 07:52:40 +08:00
|
|
|
'Torus', 'TorusGeometry',
|
|
|
|
'TorusKnot', 'TorusKnotGeometry',
|
|
|
|
'Tube', 'TubeGeometry',
|
2020-09-18 23:08:28 +08:00
|
|
|
|
2020-09-28 21:00:10 +08:00
|
|
|
'Image',
|
2020-09-19 17:24:03 +08:00
|
|
|
'InstancedMesh',
|
2020-09-19 18:16:16 +08:00
|
|
|
'Sprite',
|
2020-09-19 17:24:03 +08:00
|
|
|
|
2021-03-14 02:18:37 +08:00
|
|
|
'FBXModel',
|
2021-03-13 07:52:40 +08:00
|
|
|
'GLTFModel',
|
|
|
|
|
2020-09-18 23:08:28 +08:00
|
|
|
'BokehPass',
|
|
|
|
'EffectComposer',
|
2020-09-20 02:29:53 +08:00
|
|
|
'FilmPass',
|
2020-10-05 05:03:03 +08:00
|
|
|
'FXAAPass',
|
2020-09-21 15:15:15 +08:00
|
|
|
'HalftonePass',
|
2020-09-18 23:08:28 +08:00
|
|
|
'RenderPass',
|
2020-09-21 15:15:15 +08:00
|
|
|
'SAOPass',
|
2020-10-05 05:03:03 +08:00
|
|
|
'SMAAPass',
|
2021-03-21 11:26:47 +08:00
|
|
|
'SSAOPass',
|
2020-10-07 02:57:00 +08:00
|
|
|
'TiltShiftPass',
|
2020-09-18 23:08:28 +08:00
|
|
|
'UnrealBloomPass',
|
2020-10-07 02:57:00 +08:00
|
|
|
'ZoomBlurPass',
|
2020-09-19 18:42:06 +08:00
|
|
|
|
|
|
|
'GLTFViewer',
|
2020-09-18 23:08:28 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
comps.forEach(comp => {
|
|
|
|
app.component(comp, TROIS[comp]);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
};
|
2021-03-07 02:22:01 +08:00
|
|
|
|
|
|
|
export function createApp(params) {
|
|
|
|
return _createApp(params).use(TroisJSVuePlugin);
|
|
|
|
};
|