Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10204 in orxonox.OLD


Ignore:
Timestamp:
Jan 10, 2007, 1:18:46 PM (17 years ago)
Author:
gfilip
Message:

next update

Location:
branches/camera/src/world_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/camera/src/world_entities/camera.cc

    r10189 r10204  
    7575{
    7676  return (PNode*)this->target;
     77}
     78
     79void Camera::setTargetNode(PNode* target)
     80{
     81  this->target->setParent(target);
    7782}
    7883
     
    157162
    158163  //iterate(float dt, translate, target)
    159   target->translate( 1,dt);
     164  target->translate(dt);
    160165}
    161166
     
    353358
    354359
    355 void CameraTarget::translate(float speed, float dt)
     360void CameraTarget::translate(float dt)
    356361{
    357362  if (fabs(translateTo.len()  - (target->getAbsCoor()).len()) >= 11 )
     
    360365   Vector tmpVec= iterate(dt,  &translateTo,  &(State::getCameraNode()->getAbsCoor()));
    361366    glLoadIdentity();
    362     target->shiftCoor(tmpVec.x, tmpVec.y, tmpVec.z);
     367    target->shiftCoor(speed*tmpVec.x, speed*tmpVec.y, speed*tmpVec.z);
    363368    // cout << "%%" << tmpVec.x << "%%";
    364369
     
    371376}
    372377
    373 void CameraTarget::jump(Vector* newPos)
    374 {
    375 //target->setAbsCoor(newPos);
     378void CameraTarget::jump(Vector newPos)
     379{
     380target->setAbsCoor(newPos);
    376381}
    377382
  • branches/camera/src/world_entities/camera.h

    r10198 r10204  
    4141  CameraTarget* getTarget() const { return this->target; };
    4242  PNode* getTargetNode() const;
    43 
     43  void setTargetNode(PNode* target);
    4444  void setAspectRatio(float aspectRatio);
    4545  void setClipRegion(float nearClip, float farClip);
     
    6666
    6767  void process(const Event &event);
     68  CameraTarget*     target;          //!< The Target of the Camera (where this Camera Looks at)
    6869
    6970private:
    70   CameraTarget*     target;          //!< The Target of the Camera (where this Camera Looks at)
    7171
    7272  float             fovy;            //!< The field of view Angle (in degrees).
     
    8787class CameraTarget : public PNode
    8888{
    89   friend class Camera;             //! The CameraTarget is a friend of Camera. noone else needs a CameraTarget, so noone else can create it.
     89  friend class Camera;        //! The CameraTarget is a friend of Camera. noone else needs a CameraTarget, so noone else can create it.
    9090  ObjectListDeclaration(CameraTarget);
    9191
     
    102102  void atach(PNode* object);
    103103  Vector iterate(float dt, const Vector* target, const Vector* cam);
    104   void translate(float speed, float dt);
     104  void translate(float dt);
    105105  void changeSpeed(float speed);
    106106  Vector* rotate(Vector* newPos, float speed);
    107   void jump(Vector* newPos);
     107  void jump(Vector newPos);
    108108  void test();
    109109  void translateNow(Vector* vec);
  • branches/camera/src/world_entities/cameraman.cc

    r10198 r10204  
    3636
    3737
     38
     39void cameraman::moveCurrCam(int x, int y, int z)
     40{
     41currentCam->target->trans(x,y,z);
     42}
     43
     44
     45void cameraman::moveCam(int x, int y, int z, int camNo)
     46{
     47cameras[camNo]->target->trans(x,y,z);
     48}
     49
     50
     51void cameraman::changeTarget(int camNo, PNode* target)
     52{
     53  cameras[camNo]->setTargetNode(target);
     54}
     55
     56
     57void cameraman::changeCurrTarget(PNode* target)
     58{
     59  currentCam->setTargetNode(target);
     60}
     61
     62void cameraman::jumpCam(int x, int y, int z, int camNo)
     63{
     64 // cameras[camNo]
     65}
     66
     67
     68void jumpCurrCam(int x, int y, int z)
     69{
     70}
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
  • branches/camera/src/world_entities/cameraman.h

    r10199 r10204  
    1919    void createCam();
    2020    Camera* cameras[6];
    21     void moveCam(int x, int y, int z, int speed, int camNo);
    22     void moveCurrCam(int x, int y, int z, int speed);
     21    void moveCam(int x, int y, int z, int camNo);
     22    void moveCurrCam(int x, int y, int z);
    2323    void changeTarget(int camNo, PNode* target);
    2424    void changeCurrTarget(PNode* target);
    2525    void jumpCam(int x, int y, int z, int camNo);
    26     void jumpCam(int x, int y, int z);
    27 
     26    void jumpCurrCam(int x, int y, int z);
     27    void changeSpeed(float speed);
    2828
    2929
Note: See TracChangeset for help on using the changeset viewer.