Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3583 in orxonox.OLD for orxonox/trunk/src/world_entities/weapon.cc


Ignore:
Timestamp:
Mar 16, 2005, 11:08:33 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: some changes in the character_attributes, projectile and weapon.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/weapon.cc

    r3579 r3583  
    3333*/
    3434Weapon::Weapon () : WorldEntity()
    35 {
    36   this->model = new OBJModel("");
    37 }
     35{}
    3836
    3937
     
    5553*/
    5654void Weapon::enable()
    57 {}
     55{
     56  this->enabled = true;
     57}
    5858
    5959
     
    6666*/
    6767void Weapon::disable()
    68 {}
     68{
     69  this->enabled = false;
     70}
    6971
    7072
     
    7880*/
    7981bool Weapon::isEnabled()
    80 {}
     82{
     83  return this->enabled;
     84}
    8185
    8286
     
    133137{}
    134138
    135 
    136 /**
    137    \brief this sets the energy of a weapon
    138    \param amount of energy
    139 
    140    a weapon has a limited amount of energy, this means a limited amount of shoots
    141 */
    142 void Weapon::setWeaponEnergy(int energy)
    143 {}
    144 
    145 /**
    146    \brief adds weapon energy
    147    \param amount of energy
    148    \returns amount of energy, that is over the energy limit
    149 
    150    this can be used for energy-power up for example. There is a limited amount of energy
    151    a weapon can have. so if you want to add more, than it supports, the rest will
    152    be returned from this weapon.
    153 */
    154 int Weapon::addWeaponEnergy(int addEnergy)
    155 {}
    156 
    157 /**
    158    \brief removes weapon energy
    159    \param amount of enery
    160 
    161    this is the case, when ther should be some sort of energy loss in the weapon
    162    system. propably wont be the case but usefull to have
    163 */
    164 void Weapon::substractWeaponEnergy(int subEnergy)
    165 {}
    166 
    167 /**
    168    \brief gets the amount of energy of a weapon (= ammo)
    169 */
    170 int Weapon::getWeaponEnergy()
     139/**
     140   \brief sets a weapon idle time
     141   \param idle time in ms
     142
     143   a weapon idle time is the time spend after a shoot until the weapon can
     144   shoot again
     145*/
     146void Weapon::setWeaponIdleTime(float time)
     147{}
     148
     149/**
     150   \brief gets the weapon idle time
     151   \returns idle time in ms
     152
     153   a weapon idle time is the time spend after a shoot until the weapon can
     154   shoot again
     155*/
     156float Weapon::getWeaponIdleTime(void)
     157{}
     158
     159/**
     160   \brief checks if the idle time is elapsed
     161   \return true if time is elapsed
     162
     163   a weapon idle time is the time spend after a shoot until the weapon can
     164   shoot again
     165*/
     166bool Weapon::hasWeaponIdleTimeElapsed(void)
    171167{}
    172168
     
    211207
    212208/**
     209   \brief is called, when there is no fire button pressed
     210*/
     211void Weapon::weaponIdle()
     212{}
     213
     214
     215/**
    213216   \brief this will draw the weapon
    214217*/
    215218void Weapon::draw ()
    216 {
    217   glMatrixMode(GL_MODELVIEW);
    218   glPushMatrix();
    219 
    220   float matrix[4][4];
    221   glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
    222   this->getAbsDir().matrix (matrix);
    223   glMultMatrixf((float*)matrix);
    224   this->model->draw();
    225 
    226   glPopMatrix();
    227 }
    228 
     219{}
     220
Note: See TracChangeset for help on using the changeset viewer.