1 | #ifndef _CAMERAMAN_H |
---|
2 | #define _CAMERAMAN_H |
---|
3 | |
---|
4 | #include "base_object.h" |
---|
5 | #include "state.h" |
---|
6 | #include "camera.h" |
---|
7 | |
---|
8 | class BlackScreen; |
---|
9 | class Camera; |
---|
10 | class PNode; |
---|
11 | |
---|
12 | class CameraMan : public BaseObject { |
---|
13 | |
---|
14 | ObjectListDeclaration(CameraMan); |
---|
15 | |
---|
16 | public: |
---|
17 | CameraMan(const TiXmlElement* root = NULL); |
---|
18 | |
---|
19 | /// Loading |
---|
20 | virtual void loadParams(const TiXmlElement* root); |
---|
21 | void createCameras(const TiXmlElement* camerasTag); |
---|
22 | void createCam(const TiXmlElement* root); |
---|
23 | |
---|
24 | /// Camera management |
---|
25 | void changeTarget(const std::string& cameraName,const std::string& className, const std::string& objectName); |
---|
26 | void attachCamera(const std::string& cameraName, const std::string& className, const std::string& targetEntity); |
---|
27 | |
---|
28 | void jumpCam(const std::string& cameraName, float x, float y, float z); |
---|
29 | void moveCam(const std::string& cameraName, float x, float y, float z); |
---|
30 | void setRelCameraCoor(const std::string& cameraName, float x, float y, float z); |
---|
31 | void setRelCameraCoorSoft(const std::string& cameraName, float x, float y, float z, float bias); |
---|
32 | |
---|
33 | void setCam(const std::string& cameraName); |
---|
34 | void setCam(Camera* newCamera); |
---|
35 | void setClipRegion(float nearClip, float farClip); |
---|
36 | |
---|
37 | /// Managing the current camera |
---|
38 | void changeCurrTarget(const std::string& className, const std::string& objectName); |
---|
39 | void attachCurrCamera(const std::string& className, const std::string& targetEntity); |
---|
40 | void jumpCurrCam(float x, float y, float z); |
---|
41 | void moveCurrCam(float x, float y, float z); |
---|
42 | |
---|
43 | /// Fading |
---|
44 | void togglFade(); |
---|
45 | void initFadeBlack(); |
---|
46 | |
---|
47 | /// Polling |
---|
48 | float getCurrCameraCoorX(){return (State::getCamera())->getAbsCoorX();} |
---|
49 | float getCurrCameraCoorY(){return (State::getCamera())->getAbsCoorY();} |
---|
50 | float getCurrCameraCoorZ(){return (State::getCamera())->getAbsCoorZ();} |
---|
51 | const std::string& getCurrCamName(){ return (State::getCamera())->getName(); } |
---|
52 | |
---|
53 | private: |
---|
54 | float nearClip; |
---|
55 | float farClip; |
---|
56 | BlackScreen* fadeToBlack; |
---|
57 | |
---|
58 | |
---|
59 | }; |
---|
60 | |
---|
61 | #endif /* _CAMERAMAN_H */ |
---|
62 | |
---|