Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jul 12, 2005, 3:11:57 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: derivation of superclasses is more clear now. lets see, if this will hold out for some time (about 115 classes long)

Location:
orxonox/trunk/src/world_entities/weapons
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/weapons/weapon_manager.cc

    r4834 r4837  
    2525#include "vector.h"
    2626#include "list.h"
     27#include "t_animation.h"
    2728
    2829using namespace std;
     
    7677  this->currConfID = W_CONFIG0;
    7778  this->crosshair = new Crosshair();
    78 }
    79 
    80 /**
    81  *
     79
     80  this->crossHairSizeAnim = new tAnimation<Crosshair>(this->crosshair, &Crosshair::setSize);
     81  this->crossHairSizeAnim->setInfinity(ANIM_INF_REWIND);
     82  this->crossHairSizeAnim->addKeyFrame(50, .1, ANIM_LINEAR);
     83  this->crossHairSizeAnim->addKeyFrame(100, .05, ANIM_LINEAR);
     84  this->crossHairSizeAnim->addKeyFrame(50, .01, ANIM_LINEAR);
     85}
     86
     87/**
     88 * loads the settings of the WeaponManager
    8289 * @param root the XML-element to load from
    8390 */
     
    207214
    208215
    209 
    210216/**
    211217 * triggers fire of all weapons in the current weaponconfig
     
    219225    if( firingWeapon != NULL) firingWeapon->fire();
    220226  }
    221   this->crosshair->setRotationSpeed(-500);
     227  this->crosshair->setRotationSpeed(500);
     228  this->crossHairSizeAnim->replay();
    222229}
    223230
  • orxonox/trunk/src/world_entities/weapons/weapon_manager.h

    r4836 r4837  
    3333class Weapon;
    3434class Crosshair;
     35template <class T> class tAnimation;
    3536
    3637#define    W_MAX_SLOTS       8
     
    5758
    5859//! this is a weapon Configuration: it has up to 8 slots
    59 typedef struct weaponConfig
     60typedef struct
    6061{
    6162  bool           bUsed;                       //!< is set to true, if this configuration is
    6263  Weapon*        slots[8];
    63 };
     64} weaponConfig;
    6465
    6566
     
    8586
    8687  private:
    87     Crosshair*            crosshair;               //!< an aim.
     88    int getNextFreeSlot(int configID);
    8889
    89     int                   nrOfSlots;               //<! number of weapon slots a ship has
    90     int                   currConfID;              //<! the currently selected config
    91     weaponConfig          configs[4];              //<! a list of four configurations
     90  private:
     91    Crosshair*              crosshair;               //!< an aim.
     92    tAnimation<Crosshair>*  crossHairSizeAnim;
    9293
    93     int getNextFreeSlot(int configID);
     94    int                     nrOfSlots;               //<! number of weapon slots a ship has
     95    int                     currConfID;              //<! the currently selected config
     96    weaponConfig            configs[4];              //<! a list of four configurations
     97
    9498};
Note: See TracChangeset for help on using the changeset viewer.