Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10482 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Jan 29, 2007, 2:48:59 PM (18 years ago)
Author:
snellen
Message:

cleanup in cameramanager… continued

Location:
trunk/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/cameraman.cc

    r10481 r10482  
    150150}
    151151
    152 void CameraMan::atachCurrTarget(PNode* target)
    153 {
    154   currentCam->target->atach(target);
    155   currentCam->setViewMode(Camera::ViewNormal);
    156   State::setCamera(this->currentCam,  dynamic_cast<CameraTarget*>(target));
    157 
    158 }
    159152
    160153void CameraMan::atachCurrCameraToWorldEntity(const std::string& className, const std::string& targetEntity)
     
    164157  if(object != NULL && object->isA(PNode::staticClassID()))
    165158  {
    166    this->atachCurrTarget(dynamic_cast<PNode*>(object));
     159   this->atachTarget(this->currentCam, dynamic_cast<PNode*>(object));
    167160   return;
    168161  }
     
    233226  if( object != NULL && targetCam != NULL && object->isA(PNode::staticClassID()) )
    234227  {
    235     dynamic_cast<Camera*>(targetCam)->target->atach(dynamic_cast<PNode*>(object));
    236     dynamic_cast<Camera*>(targetCam)->setViewMode(Camera::ViewNormal);
    237     State::setCamera(dynamic_cast<Camera*>(targetCam),  dynamic_cast<CameraTarget*>(object));
     228    this->atachTarget(dynamic_cast<Camera*>(targetCam), dynamic_cast<PNode*>( object ));
    238229    return;
    239230  }
     
    304295
    305296
     297void CameraMan::atachTarget(Camera* cam ,PNode* target)
     298{
     299  cam->target->atach(target);
     300  cam->setViewMode(Camera::ViewNormal);
     301  State::setCamera( cam,  dynamic_cast<CameraTarget*>(target));
     302
     303}
     304
    306305//how to get a class fkt pointer
    307306
  • trunk/src/world_entities/cameraman.h

    r10480 r10482  
    4242    void moveCurrCam(int x, int y, int z);
    4343    void changeCurrTarget(const std::string& className, const std::string& objectName);
    44     void atachCurrTarget(PNode* target);
    4544    void atachCurrCameraToWorldEntity(const std::string& className, const std::string& targetEntity);
    4645    void detachCurrCamera();
     
    6261  private:
    6362    bool cameraIsInVector(Camera* camera);
     63    void atachTarget(Camera* cam, PNode* pnode);
    6464   
    6565
Note: See TracChangeset for help on using the changeset viewer.