collision detection for camera object

jaronimo

06-04-2008 18:38:36

hi!

i'm currently coding a game that should be controlled in first person.
the character is simply represented as a camera object that gets moved / oriented according to keyboard / mouse input.

the problem is of course that the camera object has no physical properties.. thus there is no collision detection with the environment (buildings, cars .. all simulated with ode).. i have tried several things just to give the camera physical properties.. but the outcomes have been less than satisfying.. for example i modeled a box as physical representation for the character but the controlls are coded so that the input directly affects the camera position and not the position / velocity of the ode box..

anybody got a suggestion on how i could solve this issue in order to keep the smooth controlls of my camera object and at the same time have collision detection with the ode environment?

rewb0rn

06-04-2008 18:46:30

I think you should code a character controller like its described in the forum and the wiki, because else you have no possibility to stop the camera from moving through objects, i.e. you must not affect the camera position directly.