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

Can't assign global clipping planes #879

Closed
MarvinKubus opened this issue Mar 25, 2024 · 2 comments · Fixed by #880
Closed

Can't assign global clipping planes #879

MarvinKubus opened this issue Mar 25, 2024 · 2 comments · Fixed by #880

Comments

@MarvinKubus
Copy link

I've been using the WebGLRenderer clippingPlanes for a while and now that I'm updating from an older version to the current version, they have been made readonly and are no longer assignable.

This example uses the renderer.clippingPlanes: https://github.com/mrdoob/three.js/blob/master/examples/webgl_clipping_advanced.html

This commit made them readonly:
c7d06ae#diff-a49a68ba8d61aea7970812d8ea758823574f49c5afc1f30c47e88ab0e54ec59d

If this is intentional, then what whould be the proposed way of assigning them now, or should they not be readonly?

@Methuselah96
Copy link
Contributor

Methuselah96 commented Mar 25, 2024

They probably don't need to be readonly, that was probably a side-effect of the webgl_clipping and webgl_clipping_advanced examples using Object.freeze which produces a readonly array.

Note that with the current types you can still set the property (e.g., renderer.clippingPlanes = []), just like in the webgl_clipping_advanced and webgl_clipping examples, you just can't modify the array (e.g., renderer.clippingPlanes.push(plane)).

I've created #880 to make them mutable in the next version of @types/three.

@MarvinKubus
Copy link
Author

Thank you for the info and the fast PR!
It was indeed a .push that lead me here.

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

Successfully merging a pull request may close this issue.

2 participants