Hello all!
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?
Thanks!
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
intersectsTriangle http://127.0.0.1:5500/dist/common.bundle.js:16
_intersectTriangles http://127.0.0.1:5500/dist/common.bundle.js:16
intersects http://127.0.0.1:5500/dist/common.bundle.js:16
intersects http://127.0.0.1:5500/dist/common.bundle.js:16
_internalPick http://127.0.0.1:5500/dist/common.bundle.js:16
pick http://127.0.0.1:5500/dist/common.bundle.js:16
_initActionManager http://127.0.0.1:5500/dist/common.bundle.js:16
_initClickEvent http://127.0.0.1:5500/dist/common.bundle.js:16
_onPointerUp http://127.0.0.1:5500/dist/common.bundle.js:16
This is why we ask people for repro 
1 Like
It seems you are using ActionManager? seems like the culprit who launches the pick
1 Like
Yep, I typed “ActionManager” in Visual Studio Code’s search window, and it appears all over my project’s compiled JavaScript, but not my TypeScript… odd. Most of it must be code imported from @Babylon/core, but I wonder how much of it is injected into my scripts because of Webpack? Down the rabbit-hole I gooooooo!
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!