I updated from r108 to 121. Now hovering, clicking, or dragging does not interact with the controls.
Looks like the reason is
because in the app Iām in, we traverse TransformControls
to place it in its own layer, and the raycaster
now does not match the same layer.
Furthermore, the raycaster
variable is private inside the TransformControls
constructor, so it can not be modified.
To fix the issue I need to either
- fork
TransformControls
and runraycaster.layers.enable(transformControlsLayer)
within the constructor - or donāt put
TransformControls
in any layer other than default.
I used the excellent patch-package
to manage and commit a patch of the three
module into my project.
patch-package
allows you to make edits to packages in node_modules
, then it will generate a .patch
out of the changes and save it in your project which you can then commit into your VCS (git, svn, etc).
It will then apply patches to modules in node_modules
during the postinstall
phase of your projectās npm install
.
The patch I added in my case changes
var raycaster = new Raycaster();
to
var raycaster = new Raycaster();
// Enable all layers so that TransformControls works regardless of which layer it is in.
raycaster.layers.enableAll()
is there some info about this change somewhere? like why it was made to behave like that?
@drcmda Hello! That change is listed in the r113
-> r114
migration guide describing the new Raycaster#layers
property.
Hereās a fix that make the TransformControls.raycaster
property be public, then the end user can change the layers on the raycaster too:
^ @Mugen87 Can you please get this fix in, or open a PR with the change? (Iām not allowed to open PRs).
Here is a PR:
@arpu ^ The PR got closed.
Mrdoob said:
I guess it would be good to know a bit more in depth what the use case is/was. And other use cases too.
The OP describes one such situation:
I updated from r108 to 121. Now hovering, clicking, or dragging does not interact with the controls.
Basically, it is not possible to put TransformControls
in its own layer, because there is no way to also configure the private raycaster to operate on the same layers.
Simply put, thereās a layers feature, but it doesnāt work with TransformControls
.
Seems that everybody forgot about previous PR, so here new one.
I added a change as PR on your @munrocket, made it public and added docs. Do we need to add an example for it?
Sorry for the late reply but raycaster will finally be exposed with r131
, see: