camera collision

i have a third person camera, the camera orbits around the character in relation to the mouse

but the camera goes through walls

now my question is, how do i make this camera collidable so that it does not go through the walls?

so far i understand that attatching a collision sphere to the camera and making it collidable is part of the steps…but other than that i am clueless

Frist off, your map has to be collidable using the collision tags {Polygon descend keep}.

If you have done this step, then go on adding your collision to the camera using this code.

#Setup collision manager
base.cTrav = CollisionTraverser()
base.cTrav.setRespectPrevTransform(True)
#Pushes objects back
base.pusher = CollisionHandlerPusher

#Add a collision sphere node around our camera.
self.cnodePath = base.camera.attachNewNode(CollisionNode('CollisionSphere'))

#Setup the collision sphere.
self.csphere = CollisionSphere(0, 0, 0, 4)#May need to change this number as you need.
self.cnodePath.node().addSolid(self.csphere)
self.cnodePath.node().setFromCollideMask(BitMask32.bit(1))
self.cnodePath.node().setIntoCollideMask(BitMask32.allOff())

#Add our collision node to the puser and then to the collision manager
base.pusher.addCollider(self.cnodePath,base.camera,base.drive.node())
base.cTrav.addCollider(self.cnodePath,base.pusher)

Make sure you check out astelix examples on collision. They are very detailed and work step by step.
discourse.panda3d.org/viewtopic.php?t=7918