Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 14, 2007, 7:27:23 PM (17 years ago)
Author:
snellen
Message:

cleaned up the cameramanager, commented all functions, corrected spelling mistakes :-P

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/cleanup/src/world_entities/tools/cameraman.h

    r10591 r10593  
    22#define _CAMERAMAN_H
    33
    4 
    5 #include <vector>
    64#include "base_object.h"
     5#include "state.h"
     6#include "camera.h"
    77
    88class BlackScreen;
     
    1111
    1212class CameraMan : public BaseObject {
     13
    1314  ObjectListDeclaration(CameraMan);
    1415
    15   private:
    16     Camera* currentCam;
    17     float nearClip;
    18     float farClip;
    19     BlackScreen* fadeToBlack;
    20 
    2116  public:
    22     std::vector<Camera*> cameras;
    2317    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
     18 
     19    /// Loading
    2920    virtual void loadParams(const TiXmlElement* root);
    3021    void createCameras(const TiXmlElement* camerasTag);
    3122    void createCam(const TiXmlElement* root);
    3223
    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; }
     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);
    3927
    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);
    5628    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);
    5730    void setRelCameraCoor(const std::string& cameraName, float x, float y, float z);
    5831    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     void pauseCamera(const std::string& camName, bool stop);
    61    
    62     void changeSpeed(float speed);
     32
     33    void setCam(const std::string& cameraName);
     34    void setCam(Camera* newCamera);
    6335    void setClipRegion(float nearClip, float farClip);
    64     void cameraInfo();
    65    
     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
    6653  private:
    67     bool cameraIsInVector(Camera* camera);
    68     void atachTarget(Camera* cam, PNode* pnode);
     54    float nearClip;
     55    float farClip;
     56    BlackScreen* fadeToBlack;
    6957   
    7058
     
    7260
    7361#endif /* _CAMERAMAN_H */
     62 
Note: See TracChangeset for help on using the changeset viewer.