Pb with an FPS camera and collision
Posted: Sun Sep 04, 2005 8:33 pm
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.
In 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 bloqued in the house floor).
Somebody can help me please ?
In 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 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();
}