Pb with an FPS camera and a collision with the ground

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Didine
Posts: 19
Joined: Wed Aug 24, 2005 1:22 pm
Location: France
Contact:

Pb with an FPS camera and a collision with the ground

Post by Didine »

I have a BSP scene with a large plan and a house wich is a bit more heigher than the plan. If the player is crouching on the plan, the program works fine. But when the player is crouching in the house, the camera is lowering (ok) but he's blocked : none horizontally movement is possible, just rotations. The camera is bloqued in the floor.
On the other hand, when I give the initial coordinate to the camera (like a teleportation), if a wall is between the player and the initial place, the camera is bloqued by the wall (this problem arises only when the camera is not yet bloqued in the house floor).

Code: Select all

void changeCamera(ATTITUDE attitude)
{
   camCoord = camera->getPosition();
   switch (attitude) {
          case UP :  // the player is up
               {
               camera->setPosition(vector3df(camCoord.X,camCoord.Y+60,camCoord.Z));
               anim->setEllipsoidRadius(vector3df(30, 100, 30));
               } break;
               
          case DOWN : // the player is crouching
               {
               camera->setPosition(vector3df(camCoord.X,camCoord.Y,camCoord.Z));
               anim->setEllipsoidRadius(vector3df(30, 50, 30)); 
               } break;   

          case INITIAL : 
               { // initial position at the begining of the game
               camera->setPosition(vector3df(590,950,1500));
               camera->addAnimator(anim);
               anim->setEllipsoidRadius(vector3df(30,100,30));        
               } break;
           }
   camera->addAnimator(anim);
   anim->drop();

}   
Somebody can help me please ? :shock:
CZestmyr
Posts: 72
Joined: Sat Feb 12, 2005 7:11 pm
Location: Czech Republic
Contact:

Post by CZestmyr »

Why do you post your message in more forums?
Didine
Posts: 19
Joined: Wed Aug 24, 2005 1:22 pm
Location: France
Contact:

Post by Didine »

It was an error... My attempt to post the first thread seemed working wrong. Thank you for your response in the advanced help forum.
Going to http://irrlicht.sourceforge.net/phpBB2/ ... php?t=8579
Post Reply