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

change default pointer positions

This commit is contained in:
Kevin Levron 2021-04-04 21:59:57 +02:00
parent 3837f164f9
commit 31cf5e99f2

View File

@ -8,8 +8,8 @@ export default function usePointer(options) {
intersectObjects, intersectObjects,
touch = true, touch = true,
resetOnEnd = false, resetOnEnd = false,
resetPosition = new Vector2(Infinity, Infinity), resetPosition = new Vector2(0, 0),
resetPositionV3 = new Vector3(Infinity, Infinity, Infinity), resetPositionV3 = new Vector3(0, 0, 0),
onEnter = () => {}, onEnter = () => {},
onMove = () => {}, onMove = () => {},
onLeave = () => {}, onLeave = () => {},
@ -21,7 +21,7 @@ export default function usePointer(options) {
} = options; } = options;
const position = resetPosition.clone(); const position = resetPosition.clone();
const positionN = new Vector2(Infinity, Infinity); const positionN = new Vector2(0, 0);
const raycaster = useRaycaster({ camera }); const raycaster = useRaycaster({ camera });
const positionV3 = raycaster.position; const positionV3 = raycaster.position;