So I am working on a 3rd person game in three.js and I can kinda help here.
I use a RayCaster: https://threejs.org/docs/#api/en/core/Raycaster
to detect any collisions with the environment. I do this whenever the player character moves from point A to B. So let's say the player is at A and is moving to point B (in the next frame). I create a RayCaster that originates at point A and is directed at point B. If the RayCaster collides with the environment then I do not allow the movement.
This approach is pretty simple and there's a couple issues with it that I am working on figuring out:
It's inefficient. Because I'm checking if the RayCaster collides with the entire environment (not just the player's immediate area). I plan on fixing this using spacial indexing, I just need to figure out how to do that.
I don't know how to do this on the server side (to prevent cheating like you mentioned) Any ideas there would be amazing.
I hope this helps!