1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00
This commit is contained in:
Sander Moolin 2021-03-25 09:36:02 -04:00
parent abbe3d433c
commit 136ec03c07

View File

@ -14,6 +14,11 @@ export default {
onPointerOver: { type: Function, default: null }, onPointerOver: { type: Function, default: null },
onPointerLeave: { type: Function, default: null } onPointerLeave: { type: Function, default: null }
}, },
data(){
return {
pointerIsOver: null
}
},
// can't use setup because it will not be used in sub components // can't use setup because it will not be used in sub components
// setup() {}, // setup() {},
unmounted() { unmounted() {
@ -55,8 +60,6 @@ export default {
this.three.raycaster.setFromCamera(this.three.mouse, this.three.camera) this.three.raycaster.setFromCamera(this.three.mouse, this.three.camera)
const intersects = this.three.raycaster.intersectObjects([this.o3d]) const intersects = this.three.raycaster.intersectObjects([this.o3d])
if (intersects.length) { if (intersects.length) {
console.log(intersects[0].distance)
this.onPointerEnter(intersects[0]) this.onPointerEnter(intersects[0])
} }
} }