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();
}