So I have an OrbitControls attached to a camera. My code creates a new OrbitControls and attached itself to that same camera and then disposes of the old OrbitControls instance. That controls was now with the 2nd instance. That used to work fine until I updated to ThreeJS r168, then it stopped working. The 2nd OrbitControls would not move the camera anymore. I copied the previous OrbitControls.js file over to r168 and it worked again. I cannot tell if that is the intended behavior change. I do need to pass controls from 1 OrbitControls instance to a new one however.
You may compare the code of the old OrbitControls.js
with the new OrbitControls.js
. Maybe the difference will provide you with enough clues what has changed and how to proceed?
Isn’t there a way for you to use the same OrbitControls? Disposing it in order to create a new one sounds like an antipattern
I think this was recently changed. You need to connect and disconnect the controls to the dom element now, possibly.
Nah this should be fine. If you can create an object, you should be able to destroy it.