1 ////////////////////////////////////////////////////////////////////////////////
2 // Scorched3D (c) 2000-2009
4 // This file is part of Scorched3D.
6 // Scorched3D is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // Scorched3D is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with Scorched3D; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 ////////////////////////////////////////////////////////////////////////////////
21 #if !defined(AFX_TARGETCAMERA_H__97593EBB_5901_4D81_BAEB_8ADC76CFB627__INCLUDED_)
22 #define AFX_TARGETCAMERA_H__97593EBB_5901_4D81_BAEB_8ADC76CFB627__INCLUDED_
24 #include <GLEXT/GLCamera.h>
25 #include <GLW/GLWToolTip.h>
26 #include <engine/GameState.h>
27 #include <graph/ParticleEmitter.h>
28 #include <common/Keyboard.h>
49 virtual ~TargetCamera();
51 GLCamera
&getCamera() { return mainCam_
; }
52 CamType
getCameraType() { return cameraPos_
; }
53 ParticleEngine
&getPrecipitationEngine() { return particleEngine_
; }
54 void setCameraType(CamType type
) { cameraPos_
= type
; }
57 void simulate(float frameTime
, bool playing
);
59 void drawPrecipitation();
60 void mouseWheel(int x
, int y
, int z
, bool &skipRest
);
61 void mouseDown(GameState::MouseButton button
,
62 int x
, int y
, bool &skipRest
);
63 void mouseUp(GameState::MouseButton button
,
64 int x
, int y
, bool &skipRest
);
65 void mouseDrag(GameState::MouseButton button
,
66 int mx
, int my
, int x
, int y
, bool &skipRest
);
69 char *buffer
, unsigned int keyState
,
70 KeyboardHistory::HistoryElement
*history
, int hisCount
,
73 static const char **getCameraNames();
74 static ToolTip
*getCameraToolTips();
75 static int getNoCameraNames();
76 static float minHeightFunc(int x
, int y
, void *heightData
);
77 static float maxHeightFunc(int x
, int y
, void *heightData
);
82 ParticleEmitter rainEmitter_
, snowEmitter_
;
83 ParticleEngine particleEngine_
;
86 int dragXStart_
, dragYStart_
;
88 bool lastLandIntersectValid_
;
89 Vector lastLandIntersect_
;
91 bool moveCamera(float frameTime
, bool playing
);
92 bool getLandIntersect(int x
, int y
, Vector
&intersect
);
96 #endif // !defined(AFX_TARGETCAMERA_H__97593EBB_5901_4D81_BAEB_8ADC76CFB627__INCLUDED_)