From 6bf383d6a632604457a3cb67f7d7a23cbc4babc2 Mon Sep 17 00:00:00 2001 From: Sander Moolin Date: Mon, 22 Mar 2021 09:30:56 -0400 Subject: [PATCH] Setup for raycaster --- src/core/Raycaster.js | 21 +++++++++++++++++++++ src/core/index.js | 1 + src/plugin.js | 1 + 3 files changed, 23 insertions(+) create mode 100644 src/core/Raycaster.js diff --git a/src/core/Raycaster.js b/src/core/Raycaster.js new file mode 100644 index 0000000..47e6952 --- /dev/null +++ b/src/core/Raycaster.js @@ -0,0 +1,21 @@ +import { watch } from 'vue'; +import { bindProp } from '../tools.js'; + +export default { + name: 'Raycaster', + inject: ['three'], + emits: ['created', 'ready'], + props: { + }, + // can't use setup because it will not be used in sub components + // setup() {}, + mounted() { + console.log('TODO: raycaster') + }, + methods: { + }, + render() { + return this.$slots.default ? this.$slots.default() : []; + }, + __hmrId: 'Raycaster', +}; diff --git a/src/core/index.js b/src/core/index.js index 4428c1e..93be142 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -5,3 +5,4 @@ export { default as Camera } from './PerspectiveCamera.js'; export { default as Group } from './Group.js'; export { default as Scene } from './Scene.js'; export { default as Object3D } from './Object3D.js'; +export { default as Raycaster } from './Raycaster.js'; \ No newline at end of file diff --git a/src/plugin.js b/src/plugin.js index 04e1bfa..f4f4e08 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -7,6 +7,7 @@ export const TroisJSVuePlugin = { 'Camera', 'OrthographicCamera', 'PerspectiveCamera', + 'Raycaster', 'Renderer', 'Scene', 'Group',