1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

add $pointer

This commit is contained in:
Kevin Levron 2021-05-11 21:07:23 +02:00
parent fd32163e7d
commit b00c35519b

View File

@ -3,7 +3,7 @@ import { Camera, Scene, WebGLRenderer } from 'three'
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer' import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer'
import { ComponentPublicInstance, defineComponent, InjectionKey, PropType } from 'vue' import { ComponentPublicInstance, defineComponent, InjectionKey, PropType } from 'vue'
import { bindObjectProp } from '../tools' import { bindObjectProp } from '../tools'
import { PointerPublicConfigInterface } from './usePointer' import { PointerInterface, PointerPublicConfigInterface } from './usePointer'
import useThree, { SizeInterface, ThreeConfigInterface, ThreeInterface } from './useThree' import useThree, { SizeInterface, ThreeConfigInterface, ThreeInterface } from './useThree'
type CallbackType<T> = (event: T) => void type CallbackType<T> = (event: T) => void
@ -62,9 +62,7 @@ interface RendererSetupInterface {
renderFn(e: RenderFunctionEventInterface): void renderFn(e: RenderFunctionEventInterface): void
raf: boolean raf: boolean
// pointerPosition?: Vector2 $pointer?: PointerInterface
// pointerPositionN?: Vector2
// pointerPositionV3?: Vector3
initCallbacks: InitCallbackType[] initCallbacks: InitCallbackType[]
mountedCallbacks: MountedCallbackType[] mountedCallbacks: MountedCallbackType[]
@ -187,11 +185,9 @@ export default defineComponent({
this.$el.parentNode.insertBefore(this.canvas, this.$el) this.$el.parentNode.insertBefore(this.canvas, this.$el)
if (this.three.init()) { if (this.three.init()) {
// if (this.three.pointer) { if (this.three.pointer) {
// this.pointerPosition = this.three.pointer.position this.$pointer = this.three.pointer
// this.pointerPositionN = this.three.pointer.positionN }
// this.pointerPositionV3 = this.three.pointer.positionV3
// }
// TODO : don't use config // TODO : don't use config
this.three.config.onResize = (size) => { this.three.config.onResize = (size) => {