Replies: 4 comments
-
yes, someone solved it, its in here somewhere, in discussions. in v6 the whole event system is exchangeable, that could be a wonderful opportunity as well to just inject pointerlockevents. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/JacobJaffe/pointer-lock-controls-offset-example |
Beta Was this translation helpful? Give feedback.
-
The answer from drcmda here is worked in my case |
Beta Was this translation helpful? Give feedback.
-
Is there a way to use this with onClick / onPointerOver while it is in locked state? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to build a first person scene, and i'd like to use the built in pointer events such as
onPointerOver
for hover effects on interactive objects.The problem I have found is that when pointer lock hides the mouse, it keeps it at the position it was at when you clicked, which could be anywhere on the screen, but I want all the raycasting to be done as if the mouse was centered on the screen (under the reticule I am drawing).
Is there any way to override or customise the pointer system so that the raycast origin can be fixed to the center of the screen and not the current mouse coordinates?
Beta Was this translation helpful? Give feedback.
All reactions