   Avoid third person camera to go through walls
  Hello,I'm developing a video game using C++ and OPENGL. I use a third person camera to follow the main character which works properly. The camera is always behind the character but when the character has a wall behind him, the camera goes through it. That means that sometimes I can't see the character because the walls are in the middle.I've implemented collision detection (with Physx) so the character is not able to go through the objects and the walls.My idea is to zoom the camera in the character's direction in these situations. The problem is how to detect the walls or any object that is in between.Is there any easy (or not so easy) way to solve that problem?Thank you in advance!   
  You could do a raycast from the character's position to the desired camera position.  If the raycast returns a position closer than the goal camera position, then use that value with a small buffer so the camera near plane doesn't intersect the geometry.  PhysX has built in raycast support so that should be pretty easy if you use their functions against your collision world.   ;  I hear the easiest way is to trace from the character out x units away; if the trace hits anything, the camera is placed at the intersection, if not, keep it x units away from the character.EDIT:Ninja'd.   ;  you usually want a volume for the trace (bounding sphere or box), with the size at least equal to the camera near plane distance.   ;  Thank you for the tips!I've used Physx raycast and it's almost working. :)   