Page 1 of 1

Pb with an FPS camera and a collision with the ground

Posted: Sun Sep 04, 2005 9:29 pm
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:

Posted: Mon Sep 05, 2005 6:21 am
by CZestmyr
Why do you post your message in more forums?

Posted: Mon Sep 05, 2005 7:46 am
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