<RayGrab />
with blocked axis?
#230
Answered
by
CodyJasonBennett
JenniferFalkenstein
asked this question in
Q&A
-
Is it possible to use with a blocked axis, so that for instance an object can only be moved and dragged in x- and y-directions but not in z? |
Beta Was this translation helpful? Give feedback.
Answered by
CodyJasonBennett
May 22, 2023
Replies: 1 comment 2 replies
-
Hi @JenniferFalkenstein, were you able to find a solution to your question about restricting object movement to the x- and y-directions only? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you create an issue, I'll be sure to get back to it.
Three's matrix system is a bit of a mess, but this importantly only works in local space, applying world-space transforms from the controller:
https://github.com/pmndrs/react-xr/blob/93d0e4c44676fd52c850dd80eafa8bc40bb83fef/src/Interactions.tsx#L222-L232
So we can memoize whichever axis shouldn't be moved and reapply it: