1 | #ifndef _CAMERAMAN_H |
---|
2 | #define _CAMERAMAN_H |
---|
3 | |
---|
4 | |
---|
5 | #include <vector> |
---|
6 | #include "base_object.h" |
---|
7 | |
---|
8 | class BlackScreen; |
---|
9 | class Camera; |
---|
10 | class PNode; |
---|
11 | |
---|
12 | class CameraMan : public BaseObject { |
---|
13 | ObjectListDeclaration(CameraMan); |
---|
14 | |
---|
15 | private: |
---|
16 | Camera* currentCam; |
---|
17 | float nearClip; |
---|
18 | float farClip; |
---|
19 | BlackScreen* fadeToBlack; |
---|
20 | |
---|
21 | public: |
---|
22 | std::vector<Camera*> cameras; |
---|
23 | CameraMan(const TiXmlElement* root = NULL); |
---|
24 | void setCam(unsigned int CameraNo); |
---|
25 | void setCam(const std::string& camName); |
---|
26 | void setCam(Camera* camera); |
---|
27 | |
---|
28 | /// LOADING |
---|
29 | virtual void loadParams(const TiXmlElement* root); |
---|
30 | void createCameras(const TiXmlElement* camerasTag); |
---|
31 | void createCam(const TiXmlElement* root); |
---|
32 | |
---|
33 | /// POLLING |
---|
34 | float getCurrCameraCoorX(); |
---|
35 | float getCurrCameraCoorY(); |
---|
36 | float getCurrCameraCoorZ(); |
---|
37 | const Camera* getCurrentCam() const { return this->currentCam; } |
---|
38 | Camera* getCurrentCam() { return this->currentCam; } |
---|
39 | |
---|
40 | |
---|
41 | /// Current camera |
---|
42 | void moveCurrCam(int x, int y, int z); |
---|
43 | void changeCurrTarget(const std::string& className, const std::string& objectName); |
---|
44 | void atachCurrCameraToWorldEntity(const std::string& className, const std::string& targetEntity); |
---|
45 | void detachCurrCamera(); |
---|
46 | void jumpCurrCam(float x, float y, float z); |
---|
47 | void togglFade(); |
---|
48 | void initFadeBlack(); |
---|
49 | |
---|
50 | /// Camera |
---|
51 | void moveCam(int x, int y, int z, int camNo); |
---|
52 | void changeTarget(int camNo, const std::string& className,const std::string& objectName); |
---|
53 | void changeTarget(const std::string& camName,const std::string& className, const std::string& objectName); |
---|
54 | void atachCameraToWorldEntity(const std::string& cameraName, const std::string& className, const std::string& targetEntity); |
---|
55 | void jumpCam(int x, int y, int z, int camNo); |
---|
56 | void jumpCam(const std::string& cameraName, float x, float y, float z); |
---|
57 | void setRelCameraCoor(const std::string& cameraName, float x, float y, float z); |
---|
58 | void setRelCameraCoorSoft(const std::string& cameraName, float x, float y, float z, float bias); |
---|
59 | //void setViewMode(const std::string& camName, const std::string& viewMode); |
---|
60 | |
---|
61 | void changeSpeed(float speed); |
---|
62 | void setClipRegion(float nearClip, float farClip); |
---|
63 | void cameraInfo(); |
---|
64 | |
---|
65 | private: |
---|
66 | bool cameraIsInVector(Camera* camera); |
---|
67 | void atachTarget(Camera* cam, PNode* pnode); |
---|
68 | |
---|
69 | |
---|
70 | }; |
---|
71 | |
---|
72 | #endif /* _CAMERAMAN_H */ |
---|