Intuitive Design
We are excited to find your great library. We noticed the documentation mentions https://github.com/jasonChen1982/three.interaction.js which is really intuitive lib, it just drops in and worked until it stopped being maintained.
We noticed that the api for three.interactive is almost identical, with one exception, this lib requires:
interactionManager.add(cube);
With three.interaction this repeating interactionManager.add(object) call isn't necessary, so using it felt intuitive and easy throughout the application. Meanwhile three.interactive requires passing reference to the manager around everywhere and calling add() for every object? Why not make it automatically add itself just like three.interaction?
Hi @psytron, thank you for your feedback. I know it would be more convenient, but the manual approach gives you more control and it used to be faster than the auto magic three.interaction.js uses. three.interaction.js also patches three's Object3D and EventDispatcher, which I tried to avoid.
Maybe I can still add an "autoAdd" option and pass the scene to the interactionManger. In any case this would decrease performance due to increased object iterations. Not sure if the performance degradation would be notable though.
+1 autoAdd() would be awesome!
const interactionManager = new InteractionManager(
renderer,
camera,
renderer.domElement , { autoAdd:true }
);
You mean something like that?
I think your idea would be best of both worlds. Artists and experimenters could do rapid prototyping and fast auto-magic interactivity. While deeper architects could choose manual transmission for performance optimization later.
Hi @psytron, I just added the autoAdd option and published release v1.6.1. I also created an auto-add example. Please let me know, if it works as excepted or if you find any issues.
Thanks @markuslerner excited about this feature!
Testing it so far the performance of {autoAdd:true} really affects the frame rate: My animation goes from 60 FPS to 1 FPS , so the app becomes unusable.
This does not happen with THREE.interaction (this older library somehow enables the autoAdd functionality without the performance drop )
Perhaps it is something with the latest Revision of THREE.JS , currently testing it with REV 158.