| [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); |
|---|
| [10480] | 56 | |
|---|
| [10406] | 57 | void changeSpeed(float speed); |
|---|
| 58 | void setClipRegion(float nearClip, float farClip); |
|---|
| 59 | void cameraInfo(); |
|---|
| [10480] | 60 | |
|---|
| 61 | private: |
|---|
| [10406] | 62 | bool cameraIsInVector(Camera* camera); |
|---|
| [10482] | 63 | void atachTarget(Camera* cam, PNode* pnode); |
|---|
| [10480] | 64 | |
|---|
| [10406] | 65 | |
|---|
| 66 | }; |
|---|
| 67 | |
|---|
| 68 | #endif /* _CAMERAMAN_H */ |
|---|