Remove double faces from mesh?

Raycasting is an expensive operation, but you can try speeding it up with octrees: Raycasting with camera - Questions - Babylon.js (babylonjs.com)