Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting mesh.layers.set(1) does not work #398

Open
geyang opened this issue Feb 18, 2025 · 1 comment
Open

Setting mesh.layers.set(1) does not work #398

geyang opened this issue Feb 18, 2025 · 1 comment

Comments

@geyang
Copy link

geyang commented Feb 18, 2025

It used to be the case that we can choose to which eye an object shows, by setting the layers.set(1) or 2.

This does not work in the most recent release anymore.

  const mode = useXR(({ mode }) => mode);

  // emulate the isPresenting flag of v5
  const isPresenting = mode === 'immersive-ar' || mode === 'immersive-vr';

  useLayoutEffect(() => {
    if (!isPresenting) return;

    if (typeof layers === 'number' && isPresenting) {
      // console.log('setting layers.', layers);
      planeRef.current.layers.set(layers);
    }
  }, [layers, isPresenting]);

setting the layers to 1, or 2 does not work anymore.

@bbohlender
Copy link
Collaborator

@geyang since pmndrs/xr does not do anything in regards to threejs layers, I'd assume this is a problem that also occurs in vanilla threejs. If you have a reason to suspect this is a pmndrs/xr bug, please let me know! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants