00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 5 -*- */ 00002 00003 /* 00004 * Combination of a first person action and a real time strategy battle game. 00005 */ 00006 00007 /* 00008 * Camera.h 00009 * MetalWarriors 00010 * $Revision: 1.14 $ 00011 * 00012 * Created by Daniel Aarno on Tue Oct 21 2003. 00013 * Copyright (c) 2003 Daniel Aarno and Erik Ytterberg - All rights reserved. 00014 * 00015 * This program is free software; you can redistribute it and/or modify 00016 * it under the terms of the GNU General Public License as published by 00017 * the Free Software Foundation; either version 2 of the License, or 00018 * (at your option) any later version. 00019 * 00020 * This program is distributed in the hope that it will be useful, 00021 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00023 * GNU General Public License for more details. 00024 * 00025 * You should have received a copy of the GNU General Public License 00026 * along with this program; if not, write to the Free Software 00027 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00028 */ 00029 00030 00031 #ifndef _CAMERA_ 00032 #define _CAMERA_ 00033 00034 #include "Sprite.h" 00035 00040 typedef enum { 00041 CAMERA_GAME_PANE = 1000, 00042 CAMERA_GAME_MAIN, 00043 CAMERA_GAME_BINOCULARS 00044 } CameraMode; 00045 00058 class Camera 00059 { 00060 public: 00061 Sprite *follow; 00062 Sprite *track; 00063 float where[3]; 00064 float frustum_depth; 00065 float spin, tilt, dist; 00066 00067 CameraMode currentMode; 00068 00069 00070 public: 00074 Camera(); 00075 00079 void setup(); 00080 00082 void setMode(CameraMode mode); 00084 void setTrack(Sprite *new_track); 00086 void setFollow(Sprite *new_follow); 00088 float getFrustumDepth(void); 00090 void setFrustumDepth(float depth); 00091 00092 protected: 00093 void gameSetup(); 00094 void paneSetup(bool firstTime); 00095 void binocularSetup(void); 00096 }; 00097 00098 #endif //_CAMERA_
1.4.7