I am trying out a camera code that I found in the Aums.
How do I stop the camera from going outside the walls of a house? I only whant it to stay inside , because now when the player are to close to a wall the camera goes outside....and then I cant see the player....
if (camera_number == 3) // isometric view
{
camera.x = player.x - 350 * cos(player.pan); // 200 = distance
camera.y = player.y - 350 * sin(player.pan); // same value here
camera.z = player.z + 200; // above the player 200
camera.pan = player.pan;
camera.tilt = -30; // look down at the player -30
camera.roll = 0;
}