[10406] | 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); |
---|
[10480] | 24 | void setCam(unsigned int CameraNo); |
---|
[10406] | 25 | void setCam(const std::string& camName); |
---|
| 26 | void setCam(Camera* camera); |
---|
| 27 | |
---|
[10480] | 28 | /// LOADING |
---|
| 29 | virtual void loadParams(const TiXmlElement* root); |
---|
[10414] | 30 | void createCameras(const TiXmlElement* camerasTag); |
---|
[10406] | 31 | void createCam(const TiXmlElement* root); |
---|
[10480] | 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 |
---|
[10406] | 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); |
---|
[10480] | 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); |
---|
[10416] | 54 | void atachCameraToWorldEntity(const std::string& cameraName, const std::string& className, const std::string& targetEntity); |
---|
[10406] | 55 | void jumpCam(int x, int y, int z, int camNo); |
---|
[10483] | 56 | void jumpCam(const std::string& cameraName, float x, float y, float z); |
---|
[10495] | 57 | void setRelCameraCoor(const std::string& cameraName, float x, float y, float z); |
---|
[10497] | 58 | void setRelCameraCoorSoft(const std::string& cameraName, float x, float y, float z, float bias); |
---|
[10495] | 59 | //void setViewMode(const std::string& camName, const std::string& viewMode); |
---|
[10498] | 60 | void pauseCamera(const std::string& camName, bool stop); |
---|
[10480] | 61 | |
---|
[10406] | 62 | void changeSpeed(float speed); |
---|
| 63 | void setClipRegion(float nearClip, float farClip); |
---|
| 64 | void cameraInfo(); |
---|
[10480] | 65 | |
---|
| 66 | private: |
---|
[10406] | 67 | bool cameraIsInVector(Camera* camera); |
---|
[10482] | 68 | void atachTarget(Camera* cam, PNode* pnode); |
---|
[10480] | 69 | |
---|
[10406] | 70 | |
---|
| 71 | }; |
---|
| 72 | |
---|
| 73 | #endif /* _CAMERAMAN_H */ |
---|