Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6218 in orxonox.OLD for branches/christmas_branche


Ignore:
Timestamp:
Dec 21, 2005, 12:05:55 PM (19 years ago)
Author:
bensch
Message:

christmas: enter-leave events

Location:
branches/christmas_branche/src/world_entities
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/christmas_branche/src/world_entities/creatures/md2_creature.cc

    r6212 r6218  
    181181   this->cameraConnNode.addChild(this->getWeaponManager()->getFixedTarget());
    182182  this->getWeaponManager()->getFixedTarget()->setRelCoor(10,0,0);
     183
     184}
     185
     186
     187void MD2Creature::enter()
     188{
     189  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true);
     190
     191
     192}
     193
     194void MD2Creature::leave()
     195{
     196  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     197
    183198
    184199}
  • branches/christmas_branche/src/world_entities/creatures/md2_creature.h

    r6208 r6218  
    2626    void init();
    2727    void loadParams(const TiXmlElement* root);
     28
     29    virtual void enter();
     30    virtual void leave();
    2831
    2932    void addWeapon(Weapon* weapon );
  • branches/christmas_branche/src/world_entities/player.cc

    r6216 r6218  
    9595         if (this->controllable != (*node) && (dynamic_cast<PNode*>(*node)->getAbsCoor() - this->controllable->getAbsCoor()).len() < 10.0)
    9696       {
     97         this->controllable->leave();
    9798         this->disconnectControllable();
    9899         this->setControllable(dynamic_cast<Playable*>(*node));
     100         this->controllable->enter();
    99101         State::getCamera()->setParentSoft(this->controllable);
    100102         State::getCameraTarget()->setParentSoft(this->controllable);
  • branches/christmas_branche/src/world_entities/space_ships/helicopter.cc

    r6213 r6218  
    182182{
    183183  static_cast<WorldEntity*>(this)->loadParams(root);
     184}
     185
     186
     187
     188
     189void Helicopter::enter()
     190{
     191  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true);
     192
     193
     194}
     195
     196void Helicopter::leave()
     197{
     198  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     199
     200
    184201}
    185202
  • branches/christmas_branche/src/world_entities/space_ships/helicopter.h

    r6162 r6218  
    2424    void loadParams(const TiXmlElement* root);
    2525
     26    virtual void enter();
     27    virtual void leave();
     28
    2629    void addWeapon(Weapon* weapon );
    2730    void removeWeapon(Weapon* weapon);
     
    3942
    4043  private:
    41 
    4244    void calculateVelocity(float time);
    4345    void weaponAction();
     
    6567    float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
    6668    float                 acceleration;       //!< the acceleration of the player.
    67    
     69
    6870    float                 airViscosity;
    6971
  • branches/christmas_branche/src/world_entities/space_ships/space_ship.cc

    r6204 r6218  
    177177  this->getWeaponManager()->getFixedTarget()->setRelCoor(100000,0,0);
    178178
     179  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
    179180}
    180181
     
    188189}
    189190
     191
     192void SpaceShip::enter()
     193{
     194  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true);
     195
     196
     197}
     198
     199void SpaceShip::leave()
     200{
     201  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     202
     203
     204}
    190205
    191206/**
  • branches/christmas_branche/src/world_entities/space_ships/space_ship.h

    r6162 r6218  
    2626    void init();
    2727    void loadParams(const TiXmlElement* root);
     28
     29    virtual void enter();
     30    virtual void leave();
    2831
    2932    void addWeapon(Weapon* weapon );
Note: See TracChangeset for help on using the changeset viewer.