My application depends heavily on dynamically adding/disposing elements, along with clearing cached data. I’m currently trying to run scene.clearCachedVertexData(); after an array of meshes have been disposed, but afterwards when I try panning my scene camera (an ArcRotateCamera), there seems to be some internal raycasting/picking happening with scene objects, which throws an error. Is there anyway to avoid camera related raycasting/picking?
Hello, I’m not sure to understand
Can you share a repro in the PG?
to have a mesh invisible to picking, you can simply
mesh.isPickable = false
Hey @Deltakosh, while building a repro I solved the issue, haha. I was already setting the isPickable property to false for the meshes being built dynamically, but there was plane underneath all of those meshes that was still pickable and causing the error (which has been changed and everything is working fine now) – but this leads me to my next question: if deleting vertex data for a mesh causes errors when raycasting/picking, then can I exclude said mesh from the clearCachedVertexData() method? Also, if I’m not doing any picking in my code, then why is it happening in the background? Is it related to how the ArcRotateCamera moves and tilts? Or is it fired when there’s a _onPointerUp event? Here’s the error code from the previous build:
Uncaught TypeError: i is undefined
This is why we ask people for repro
It seems you are using ActionManager? seems like the culprit who launches the pick
If you are not CREATING one it is maybe not the culprit
can you share your code somewhere?
Sadly, not at the moment . But I appreciate your help!