Unity / ARFoundations Integration
So i'm using the meshing from the DenseSpatialMapBuilderFrameFilter, but my use case requires the user to be able to clear the existing mesh and start over if they need to. The only way i've managed to get this work is to completely destroy the EasyARSession the DenseSpatialMapBuilderFrameFilter is attached to, which also doesnt work for me because then I also lose the active SparseSpatialMap that is currently loaded.
I've tried just accessing the mesh blocks and just destroying all of them, but there is a internal inaccesible Dictionary that also has references to the blocks, so it ends up just erroring because its trying to access what is now null meshblocks.
The closest i've got to working without completely redoing the entire ARSession is to destroy the DenseSpatialMapBuilderFrameFilter, remove it from the ARSession.Assembly.FrameFilters list, create a new DenseSpatialMapBuilderFrameFilter parented to the ARSession, and then add the new one to the ARSession.Assembly.FrameFilters. However this just results in it never building new mesh blocks.
I'm really stumped on this. Using other AR SDK's like Niantic Lightship its been as simple as Meshing.ClearExistingMeshBlocks.
Any help would be greatly appreciated.