After updating from 108 to 121, Raycaster always returns zero intersections.
The reason is that Raycaster now only casts against objects that have the same matching
So if your app uses layers, you now need to either
- make sure
Raycasterhas the same layers as all the objects you’re raycasting against
- or call
raycaster.layers.enableAll()to have it operate with all layers (i.e. regardless of layer).
@Mugen87 It would’ve been great if Raycaster had
.layers.enableAll() by default. Not too late to change it, so anyone who still hasn’t updated won’t have a broken app.
Raycaster only enables the default layer. In this way, intersection testing works similar to the visibility tests with cameras. Hence, I don’t think raycaster should call
@Mugen87 I know, but it isn’t backwards compatible (with apps that are already using layers).
That’s why we have a migration guide. We try to avoid breaking changes as good as we can but sometimes they are required to achieve more consistent solutions.
@Mugen87 I think
raycaster needs to be a public variable, so that if someone changes the
layers of a
TransformControls instance, they can also changes the
layers of its
Here are the needed changes (I am not allowed to make pull requests): https://github.com/mrdoob/three.js/compare/dev...trusktr:patch-21
Do I need to build and commit the build output? If so, I can do that if it’s more convenient for you.
EDIT: Oops, I did it backwards, I should’ve modified the file in
js/ instead of
jsm/. I can update that.
EDIT: Added the type def in .d.ts. Still need to swap over to the
@Mugen87 I’m confused by
CONTRIBUTING.md . It says:
- If you modify files in
examples/jsdirectory, then don’t perform any changes in the
However, I see in a pull request
jsm/ file was directly modified, and not the
Can you please advise?
Newley created files are only located in the
examples/jsm directory. For existing files (like
TransformControls) you have to modify the
examples/js version and generate the module via
Ah, so those folders can be out of sync then.
@Darkladen mentioned that he noticed the
jsm/ folders were out of sync (differing set of classes) when he had some confusion trying to use both scripts and modules:
The js/jsm process is not so clear, and
CONTRIBUTING.md made it seem as if
js/ is the source of truth.
I pushed the change to the
js/ folder instead of
Here’s the final patch: Comparing mrdoob:dev...trusktr:patch-21 · mrdoob/three.js · GitHub
Hope that helps.
EDIT: I didn’t update Chinese docs.
Do I need to run that part manually?
Sorry for the confusion but the ES5/ES6 topic was lately discussed and a few things have changed again. It’s indeed a bit complicated for first time contributors to get everything 100% right.
@Mugen87 I think that’s it: https://github.com/mrdoob/three.js/compare/dev...trusktr:patch-21