mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 04:12:02 +08:00
remove resetPosition
This commit is contained in:
parent
567a8982bc
commit
49b795aac4
@ -25,8 +25,6 @@ export interface PointerPublicConfigInterface {
|
|||||||
intersectRecursive?: boolean
|
intersectRecursive?: boolean
|
||||||
touch?: boolean
|
touch?: boolean
|
||||||
resetOnEnd?: boolean
|
resetOnEnd?: boolean
|
||||||
resetPosition?: Vector2
|
|
||||||
resetPositionV3?: Vector3
|
|
||||||
onEnter?: PointerCallbackType
|
onEnter?: PointerCallbackType
|
||||||
onMove?: PointerCallbackType
|
onMove?: PointerCallbackType
|
||||||
onLeave?: PointerCallbackType
|
onLeave?: PointerCallbackType
|
||||||
@ -63,8 +61,6 @@ export default function usePointer(options: PointerConfigInterface): PointerInte
|
|||||||
intersectRecursive = false,
|
intersectRecursive = false,
|
||||||
touch = true,
|
touch = true,
|
||||||
resetOnEnd = false,
|
resetOnEnd = false,
|
||||||
resetPosition = new Vector2(0, 0),
|
|
||||||
resetPositionV3 = new Vector3(0, 0, 0),
|
|
||||||
onEnter = () => {},
|
onEnter = () => {},
|
||||||
onMove = () => {},
|
onMove = () => {},
|
||||||
onLeave = () => {},
|
onLeave = () => {},
|
||||||
@ -76,7 +72,7 @@ export default function usePointer(options: PointerConfigInterface): PointerInte
|
|||||||
onIntersectClick = () => {},
|
onIntersectClick = () => {},
|
||||||
} = options
|
} = options
|
||||||
|
|
||||||
const position = resetPosition.clone()
|
const position = new Vector2(0, 0)
|
||||||
const positionN = new Vector2(0, 0)
|
const positionN = new Vector2(0, 0)
|
||||||
|
|
||||||
const raycaster = useRaycaster({ camera })
|
const raycaster = useRaycaster({ camera })
|
||||||
@ -96,8 +92,9 @@ export default function usePointer(options: PointerConfigInterface): PointerInte
|
|||||||
return obj
|
return obj
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
position.copy(resetPosition)
|
position.set(0, 0)
|
||||||
positionV3.copy(resetPositionV3)
|
positionN.set(0, 0)
|
||||||
|
positionV3.set(0, 0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
function updatePosition(event: TouchEvent | MouseEvent) {
|
function updatePosition(event: TouchEvent | MouseEvent) {
|
||||||
|
Loading…
Reference in New Issue
Block a user