Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jan 27, 2007, 10:52:56 PM (18 years ago)
Author:
snellen
Message:

added method atachCameraToWorldEntity

Location:
trunk/src/world_entities
Files:
2 edited

Legend:

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

    r10414 r10416  
    3535                        ->addMethod("atachCurrCameraToWorldEntity", Executor2<CameraMan, lua_State*,const std::string&,const std::string&>(&CameraMan::atachCurrCameraToWorldEntity))
    3636                        ->addMethod("changeTarget", Executor3<CameraMan, lua_State*, const std::string&, const std::string&,const std::string&>(&CameraMan::changeTarget))
     37                        ->addMethod("atachCameraToWorldEntity", Executor3<CameraMan, lua_State*,const std::string&,const std::string&,const std::string&>(&CameraMan::atachCameraToWorldEntity))
    3738                        ->addMethod("detachCurrCamera", Executor0<CameraMan, lua_State*>(&CameraMan::detachCurrCamera))
    3839                        ->addMethod("setCam", Executor1<CameraMan, lua_State*, const std::string&>(&CameraMan::setCam))
     
    182183  }
    183184
    184 printf("ERROR CAMERAMANAGER: Couldn't set camera target to: %s %s \n", className.c_str(),targetEntity.c_str() );
    185 }
     185printf("ERROR CAMERAMANAGER: Couldn't set camera to: %s %s \n", className.c_str(),targetEntity.c_str() );
     186}
     187
     188
     189void CameraMan::atachCameraToWorldEntity(const std::string& cameraName, const std::string& className, const std::string& targetEntity)
     190{
     191  BaseObject* object = ObjectListBase::getBaseObject(className, targetEntity);
     192  BaseObject* targetCam = ObjectListBase::getBaseObject("Camera", cameraName);
     193
     194  if(object != NULL && targetCam != NULL)
     195  {
     196   dynamic_cast<Camera*>(targetCam)->target->atach(dynamic_cast<PNode*>(object));
     197   return;
     198  }
     199
     200printf("ERROR CAMERAMANAGER: Couldn't set camera %s to: %s %s \n", cameraName.c_str(), className.c_str(),targetEntity.c_str() );
     201}
     202
    186203
    187204void CameraMan::detachCurrCamera()
  • trunk/src/world_entities/cameraman.h

    r10414 r10416  
    3535    void atachCurrTarget(PNode* target);
    3636    void atachCurrCameraToWorldEntity(const std::string& className, const std::string& targetEntity);
     37    void atachCameraToWorldEntity(const std::string& cameraName, const std::string& className, const std::string& targetEntity);
    3738    void detachCurrCamera();
    3839    void jumpCam(int x, int y, int z, int camNo);
Note: See TracChangeset for help on using the changeset viewer.