1 /***************************************************************************
2                           gamecamera.h  -  The camera being used in the game
3                              -------------------
4     begin                : ma feb 3 2003
5     copyright            : (C) 2003 by CJP
6     email                : cornware-cjp@users.sourceforge.net
7  ***************************************************************************/
8 
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17 
18 #ifndef GAMECAMERA_H
19 #define GAMECAMERA_H
20 
21 #include "camera.h"
22 #include "timer.h"
23 
24 /**
25   *@author CJP
26   */
27 
28 class CGameCamera : public CCamera  {
29 public:
30 	enum eCameraMode {
31 		In=1,
32 		Tracking,
33 		UserDefined,
34 		Top,
35 		Television
36 	};
37 
38 	CGameCamera();
39 	virtual ~CGameCamera();
40 
41 	void setCameraMode(eCameraMode mode);
42 	void swithCameraMode();
getCameraMode()43 	eCameraMode getCameraMode()
44 		{return m_Mode;}
45 
46 	void setTrackedObject(int id);
getTrackedObject()47 	int getTrackedObject()
48 		{return m_Id;}
49 
50 	void switchTrackedObject();
51 
52 	unsigned int m_PrimaryTarget; //e.g. for the dashboard
53 
getVelocity()54 	const CVector &getVelocity() const {return m_Velocity;}
55 
56 	virtual void update();
57 protected:
58 	CVector m_Velocity;
59 	CTimer m_Timer;
60 
61 	eCameraMode m_Mode;
62 	int m_Id;
63 
64 	bool m_Reached;
65 	bool m_First;
66 	float m_SwitchTime;
67 };
68 
69 #endif
70