If you’re trying to code your own viewer, collisions for meshes and cameras aren’t enabled as features by default; you’ll have to set them up yourself. You can look at how the Sandbox itself sets this up in the Sandbox source code. I don’t think the sandbox technically uses collisions, but simply sets camera behaviors to prevent the camera from getting too close to the mesh.
If you only need a relatively simple viewer, however, it might be easier to just use the Babylon.js Viewer rather than coding your own. Not sure if that will be usable for your situation, but if so then it might save you some time. Hope this helps, and best of luck!