Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10498 in orxonox.OLD for trunk


Ignore:
Timestamp:
Jan 30, 2007, 11:10:09 AM (18 years ago)
Author:
bknecht
Message:

use pauseCamera in scripts to pause the track of the camera. this works also with pause on NPCs and spaceships with tracks

Location:
trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/track/track.cc

    r10454 r10498  
    142142     this->mode = newMode;
    143143}
     144
     145/**
     146 * Sets the bool if the track runs (false) or not (true)
     147 */
     148void Track::pauseTrack(bool stop)
     149{
     150     this->pause = stop;
     151}
     152
    144153
    145154/**
     
    250259       {
    251260          float newDt = dt * ratio;
     261          if(this->pause)
     262            newDt = 0;
    252263          this->localTime = oldTime += newDt;
    253264       }
  • trunk/src/util/track/track.h

    r10454 r10498  
    2727   void setSpeed(float speed);
    2828   void setMode(int newMode);
     29   void pauseTrack(bool stop);
    2930
    3031   //void finalize();
     
    5556   PNode*               trackNode;              //!< The node that is slave to the Track. This node will be moved while update the Track, and must NOT move itself.
    5657   int                  mode;                   //!< Defines the behaviour of the Track.
     58   bool                 pause;                  //!< Defines if the track runs (false) or not (true)
    5759};
    5860
  • trunk/src/world_entities/cameraman.cc

    r10497 r10498  
    4848                        ->addMethod("setRelCoor", Executor4<CameraMan, lua_State*,const std::string&,float,float,float>(&CameraMan::setRelCameraCoor))
    4949                        ->addMethod("setRelCoorSoft", Executor5<CameraMan, lua_State*,const std::string&,float,float,float,float>(&CameraMan::setRelCameraCoorSoft))
     50                        ->addMethod("pauseCamera", Executor2<CameraMan, lua_State*, const std::string&, bool>(&CameraMan::pauseCamera))
    5051                       );
    5152
     
    134135     dynamic_cast<Camera*>(newCam)->setRelCoorSoft(x,y,z,bias);
    135136     dynamic_cast<Camera*>(newCam)->target->setRelCoorSoft(0,0,0,bias);
     137}
     138
     139void CameraMan::pauseCamera(const std::string& camName, bool stop)
     140{
     141     BaseObject* newCam = ObjectListBase::getBaseObject("Camera", camName);
     142     dynamic_cast<Camera*>(newCam)->pauseTrack(stop);
    136143}
    137144
  • trunk/src/world_entities/cameraman.h

    r10497 r10498  
    5858    void setRelCameraCoorSoft(const std::string& cameraName, float x, float y, float z, float bias);
    5959    //void setViewMode(const std::string& camName, const std::string& viewMode);
     60    void pauseCamera(const std::string& camName, bool stop);
    6061   
    6162    void changeSpeed(float speed);
  • trunk/src/world_entities/npcs/npc.cc

    r10459 r10498  
    5252                        ->addMethod("setAbsDir", Executor4<PNode, lua_State*,float,float,float,float>(&PNode::setAbsDir))
    5353                        ->addMethod("fire", Executor0<NPC, lua_State*>(&NPC::fire))
    54 
     54                        ->addMethod("pause", Executor1<WorldEntity, lua_State*, bool>(&WorldEntity::pauseTrack))
    5555                       );
    5656
  • trunk/src/world_entities/space_ships/space_ship.cc

    r10497 r10498  
    9191                        ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
    9292                        //->addMethod("setCameraSpeed", Executor1<SpaceShip, lua_State*, float>(&SpaceShip::setCameraSpeed))
     93                        ->addMethod("pause", Executor1<WorldEntity, lua_State*, bool>(&WorldEntity::pauseTrack))
    9394                       );
    9495
  • trunk/src/world_entities/world_entity.cc

    r10449 r10498  
    198198}
    199199
     200void WorldEntity::pauseTrack(bool stop)
     201{
     202     if(this->entityTrack)
     203       this->entityTrack->pauseTrack(stop);
     204}
     205
    200206
    201207/**
  • trunk/src/world_entities/world_entity.h

    r10449 r10498  
    176176  ;  ///FIXME
    177177  void debugEntity() const;
     178 
     179  void pauseTrack(bool stop);
    178180
    179181
     
    192194  void updateHealthWidget();
    193195  void addTrack(const TiXmlElement* root);
     196 
    194197
    195198
Note: See TracChangeset for help on using the changeset viewer.