- Timestamp:
- Jan 26, 2007, 6:59:26 PM (18 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/cameraman.cc
r10388 r10390 21 21 #include <string> 22 22 #include "script_class.h" 23 #include "loading/load_param_xml.h" 23 24 24 25 ObjectListDefinition(CameraMan); … … 28 29 addMethod("changeCurrTarget", Executor2<CameraMan, lua_State*,const std::string&,const std::string&>(&CameraMan::changeCurrTarget)) 29 30 ->addMethod("changeTarget", Executor3<CameraMan, lua_State*, int, const std::string&,const std::string&>(&CameraMan::changeTarget)) 31 ->addMethod("setCamera", Executor1<CameraMan, lua_State*, int>(&CameraMan::setCam)) 30 32 ->addMethod("togglFade", Executor0<CameraMan, lua_State*>(&CameraMan::togglFade)) 33 ->addMethod("getCurrCameraCoorX", Executor0ret<CameraMan, lua_State*,float>(&CameraMan::getCurrCameraCoorX)) 34 ->addMethod("getCurrCameraCoorY", Executor0ret<CameraMan, lua_State*,float>(&CameraMan::getCurrCameraCoorY)) 35 ->addMethod("getCurrCameraCoorZ", Executor0ret<CameraMan, lua_State*,float>(&CameraMan::getCurrCameraCoorZ)) 31 36 ); 32 37 33 38 34 CameraMan::CameraMan( )39 CameraMan::CameraMan(const TiXmlElement* root) 35 40 { 36 41 this->registerObject(this, CameraMan::_objectList); … … 43 48 State::setCamera(currentCam, currentCam->getTarget()); 44 49 this->fadeToBlack=new BlackScreen(); 50 51 if (root != NULL) 52 this->loadParams(root); 45 53 } 46 54 47 55 48 void CameraMan::createCam() 56 void CameraMan::loadParams(const TiXmlElement* root) 57 { 58 BaseObject::loadParams(root); 59 60 LOAD_PARAM_START_CYCLE(root, object); 61 { 62 this->createCam(root); 63 } 64 LOAD_PARAM_END_CYCLE(object); 65 66 67 68 69 } 70 71 72 void CameraMan::createCam(const TiXmlElement* root) 49 73 { 50 74 // Camera* newCamera=new Camera(); 51 this->cameras.push_back(new Camera( ));75 this->cameras.push_back(new Camera(root)); 52 76 cameras[cameras.size()-1]->target->detach(); 53 77 cameras[cameras.size()-1]->setClipRegion(nearClip, farClip); -
trunk/src/world_entities/cameraman.h
r10388 r10390 19 19 public: 20 20 std::vector<Camera*> cameras; 21 CameraMan( );21 CameraMan(const TiXmlElement* root = NULL); 22 22 void setCam(int CameraNo); 23 void createCam( );23 void createCam(const TiXmlElement* root); 24 24 void moveCam(int x, int y, int z, int camNo); 25 25 void moveCurrCam(int x, int y, int z); … … 32 32 void setClipRegion(float nearClip, float farClip); 33 33 void togglFade(); 34 35 /// LOADING 36 virtual void loadParams(const TiXmlElement* root); 37 38 /// Polling (to be used in scripts) 39 float getCurrCameraCoorX(){ return this->currentCam->getAbsCoorX(); } 40 float getCurrCameraCoorY(){ return this->currentCam->getAbsCoorY(); } 41 float getCurrCameraCoorZ(){ return this->currentCam->getAbsCoorZ(); } 34 42 35 43 };
Note: See TracChangeset
for help on using the changeset viewer.