Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 22, 2011, 3:05:26 PM (13 years ago)
Author:
dafrick
Message:

Cleaning up game immersion. Roughly documenting weapons module.

Location:
code/trunk/src/modules/weapons/weaponmodes
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc

    r8706 r8855  
    2727 */
    2828
     29/**
     30    @file EnergyDrink.h
     31    @brief Implementation of the EnergyDrink class.
     32*/
     33
    2934#include "EnergyDrink.h"
    3035
     
    3237#include "core/XMLPort.h"
    3338#include "core/command/Executor.h"
     39
    3440#include "graphics/Model.h"
    35 
    36 #include "weapons/projectiles/Projectile.h"
    37 #include "weapons/MuzzleFlash.h"
    3841#include "weaponsystem/Weapon.h"
    3942#include "weaponsystem/WeaponPack.h"
    4043#include "weaponsystem/WeaponSystem.h"
    4144#include "worldentities/pawns/Pawn.h"
     45
     46#include "weapons/projectiles/Projectile.h"
     47#include "weapons/MuzzleFlash.h"
    4248
    4349namespace orxonox
     
    4955        RegisterObject(EnergyDrink);
    5056
    51         this->reloadTime_ = 0.25;
    52         this->damage_ = 0; //default 15
    53         this->speed_ = 2500;
    54         this->delay_ = 0;
     57        this->reloadTime_ = 0.25f;
     58        this->damage_ = 0.0f;
     59        this->speed_ = 2500.0f;
     60        this->delay_ = 0.0f;
    5561        this->setMunitionName("FusionMunition");
    5662
     
    6571        XMLPortParam(EnergyDrink, "delay", setDelay, getDelay, xmlelement, mode);
    6672        XMLPortParam(EnergyDrink, "material", setMaterial, getMaterial, xmlelement, mode);
    67 
    6873    }
    6974
    70     void EnergyDrink::setMaterial(const std::string& material)
     75    /**
     76    @brief
     77        Sets the delay with which is fired.
     78    @param delay
     79        The delay in seconds.
     80    */
     81    void EnergyDrink::setDelay(float delay)
    7182    {
    72         this->material_ = material;
    73     }
    74 
    75     void EnergyDrink::setDelay(float d)
    76     {
    77         this->delay_ = d;
     83        this->delay_ = delay;
    7884        this->delayTimer_.setInterval(this->delay_);
    7985    }
    8086
    81     float EnergyDrink::getDelay() const
    82     {
    83         return this->delay_;
    84     }
    85 
     87    /**
     88    @brief
     89        Fires the weapon.
     90    */
    8691    void EnergyDrink::fire()
    8792    {
     
    8994    }
    9095
    91     void EnergyDrink::muendungsfeuer()
    92     {
    93         MuzzleFlash *muzzleFlash = new MuzzleFlash(this);
    94         this->getWeapon()->attach(muzzleFlash);
    95         muzzleFlash->setPosition(this->getMuzzleOffset());
    96         muzzleFlash->setMaterial(this->material_);
    97     }
    98 
    99     /* Creates the projectile object, sets its properties to the EnergyDrink properties, calls muendungsfeuer()
    100      */
     96    /**
     97    @brief
     98        Executes the shot, be creating the projectile and sending it on its way.
     99    */
    101100    void EnergyDrink::shot()
    102101    {
     102        // Create the projectile
    103103        Projectile* projectile = new Projectile(this);
    104104        Model* model = new Model(projectile);
     
    112112        projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
    113113
    114         projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
     114        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    115115        projectile->setDamage(this->getDamage());
    116116        projectile->setShieldDamage(this->getShieldDamage());
    117117        projectile->setHealthDamage(this->getHealthDamage());
    118118
    119         EnergyDrink::muendungsfeuer();
     119        // Display a muzzle flash.
     120        this->muzzleflash();
     121    }
     122
     123    /**
     124    @brief
     125        Displays a muzzle flash.
     126    */
     127    void EnergyDrink::muzzleflash()
     128    {
     129        MuzzleFlash *muzzleFlash = new MuzzleFlash(this);
     130        this->getWeapon()->attach(muzzleFlash);
     131        muzzleFlash->setPosition(this->getMuzzleOffset());
     132        muzzleFlash->setMaterial(this->material_);
    120133    }
    121134}
  • code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.h

    r5929 r8855  
    2727 */
    2828
     29/**
     30    @file EnergyDrink.h
     31    @brief Definition of the EnergyDrink class.
     32*/
     33
    2934#ifndef _EnergyDrink_H__
    3035#define _EnergyDrink_H__
     
    3843namespace orxonox
    3944{
     45
     46    /**
     47    @brief
     48        Shoots a can.
     49    @author
     50        Hagen Seifert
     51    @ingroup WeaponsWeaponModes
     52    */
    4053    class _WeaponsExport EnergyDrink : public WeaponMode
    4154    {
     
    4861
    4962        private:
    50             void setMaterial(const std::string& material);
    51             inline const std::string& getMaterial()
     63            /**
     64            @brief Set the material of the EnergyDrink.
     65            @param material The name of the material.
     66            */
     67            void setMaterial(const std::string& material)
     68                { this->material_ = material; }
     69            /**
     70            @brief Get the material of the EnergyDrink.
     71            @return Returns the material name.
     72            */
     73            inline const std::string& getMaterial() const
    5274                { return this->material_; }
    53             void setDelay(float d);
    54             float getDelay() const;
     75
     76            void setDelay(float delay);
     77            /**
     78            @brief Get the firing delay.
     79            @return Returns the delay in seconds.
     80            */
     81            float getDelay() const
     82                { return this->delay_; }
     83
    5584            void shot();
    56             void muendungsfeuer();
     85            void muzzleflash();
    5786
    58             std::string material_;
    59             float speed_;
    60             float delay_;
    61             Timer delayTimer_;
     87            std::string material_; //!< The material.
     88            float speed_; //!< The speed of the EnergyDrink.
     89            float delay_; //!< The firing delay.
     90            Timer delayTimer_; //!< The timer to delay the firing.
    6291    };
    6392}
  • code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc

    r8706 r8855  
    2727 */
    2828
     29/**
     30    @file FusionFire.h
     31    @brief Implementation of the FusionFire class.
     32*/
     33
    2934#include "FusionFire.h"
    3035
     36#include "core/CoreIncludes.h"
    3137#include "util/Math.h"
    32 #include "core/CoreIncludes.h"
    33 #include "weapons/projectiles/BillboardProjectile.h"
    3438
    3539#include "weaponsystem/Weapon.h"
     
    3741#include "weaponsystem/WeaponSystem.h"
    3842#include "worldentities/pawns/Pawn.h"
     43
     44#include "weapons/projectiles/BillboardProjectile.h"
    3945
    4046namespace orxonox
     
    4652        RegisterObject(FusionFire);
    4753
    48         this->reloadTime_ = 1.0;
     54        this->reloadTime_ = 1.0f;
    4955        this->bParallelReload_ = false;
    50         this->damage_ = 0; //default 40
    51         this->speed_ = 1250;
     56        this->damage_ = 0.0f;
     57        this->speed_ = 1250.0f;
    5258
    5359        this->setMunitionName("FusionMunition");
    5460    }
    5561
    56     /* Creates the projectile (BillboardProjectile) object, sets its properties to the FusionFire properties
    57      */
     62    /**
     63    @brief
     64        Fires the weapon, by creating a projectile.
     65    */
    5866    void FusionFire::fire()
    5967    {
     
    6573        projectile->scale(5);
    6674
    67         projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
     75        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    6876        projectile->setDamage(this->getDamage());
    6977        projectile->setShieldDamage(this->getShieldDamage());
  • code/trunk/src/modules/weapons/weaponmodes/FusionFire.h

    r5781 r8855  
    2727 */
    2828
     29/**
     30    @file FusionFire.h
     31    @brief Definition of the FusionFire class.
     32*/
     33
    2934#ifndef _FusionFire_H__
    3035#define _FusionFire_H__
     
    3540namespace orxonox
    3641{
     42
     43    /**
     44    @brief
     45        FusionFire.
     46    @author
     47        Martin Polak
     48    @ingroup WeaponsWeaponModes
     49    */
    3750    class _WeaponsExport FusionFire : public WeaponMode
    3851    {
     
    4457
    4558        private:
    46             float speed_;
     59            float speed_; //!< The speed of the fusion fire weapon.
    4760    };
    4861}
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.cc

    r8706 r8855  
    2727 */
    2828
     29/**
     30    @file HsW01.h
     31    @brief Implementation of the HsW01 class.
     32*/
     33
    2934#include "HsW01.h"
    3035
     
    3237#include "core/XMLPort.h"
    3338#include "core/command/Executor.h"
     39
    3440#include "graphics/Model.h"
    35 
    36 #include "weapons/projectiles/Projectile.h"
    37 #include "weapons/MuzzleFlash.h"
    3841#include "weaponsystem/Weapon.h"
    3942#include "weaponsystem/WeaponPack.h"
     
    4144#include "worldentities/WorldEntity.h"
    4245#include "worldentities/pawns/Pawn.h"
     46
     47#include "weapons/projectiles/Projectile.h"
     48#include "weapons/MuzzleFlash.h"
    4349
    4450namespace orxonox
     
    5056        RegisterObject(HsW01);
    5157
    52         this->reloadTime_ = 0.25;
    53         this->damage_ = 0; //default 15
    54         this->speed_ = 2500;
    55         this->delay_ = 0;
     58        this->reloadTime_ = 0.25f;
     59        this->damage_ = 0.0f; //default 15
     60        this->speed_ = 2500.0f;
     61        this->delay_ = 0.0f;
    5662        this->setMunitionName("LaserMunition");
    5763
     
    7278        XMLPortParam(HsW01, "delay", setDelay, getDelay, xmlelement, mode);
    7379        XMLPortParam(HsW01, "material", setMaterial, getMaterial, xmlelement, mode);
    74 
    7580    }
    7681
    77     void HsW01::setMaterial(const std::string& material)
     82    /**
     83    @brief
     84        Set the firing delay.
     85    @param delay
     86        The firing delay in seconds.
     87    */
     88    void HsW01::setDelay(float delay)
    7889    {
    79         this->material_ = material;
    80     }
    81 
    82     std::string& HsW01::getMaterial()
    83     {
    84         return this->material_;
    85     }
    86 
    87     void HsW01::setDelay(float d)
    88     {
    89         this->delay_ = d;
     90        this->delay_ = delay;
    9091        this->delayTimer_.setInterval(this->delay_);
    91     }
    92 
    93     float HsW01::getDelay() const
    94     {
    95         return this->delay_;
    9692    }
    9793
     
    10197    }
    10298
    103     void HsW01::muendungsfeuer()
    104     {
    105         MuzzleFlash *muzzleFlash = new MuzzleFlash(this);
    106         this->getWeapon()->attach(muzzleFlash);
    107         muzzleFlash->setPosition(this->getMuzzleOffset());
    108         muzzleFlash->setMaterial(this->material_);
    109     }
    110 
    111     /* Creates the projectile object, sets its properties to the HsW01 properties, calls muendungsfeuer()
    112      */
     99    /**
     100    @brief
     101        Fires the weapon. Creates a projectile and fires it.
     102    */
    113103    void HsW01::shot()
    114104    {
    115105        assert( this->getWeapon() && this->getWeapon()->getWeaponPack() && this->getWeapon()->getWeaponPack()->getWeaponSystem() && this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn() );
     106
     107        // Create the projectile.
    116108        Projectile* projectile = new Projectile(this);
    117109        Model* model = new Model(projectile);
     
    126118        projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
    127119
    128         projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
     120        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    129121        projectile->setDamage(this->getDamage());
    130122        projectile->setShieldDamage(this->getShieldDamage());
    131123        projectile->setHealthDamage(this->getHealthDamage());
    132124
    133         HsW01::muendungsfeuer();
     125        // Display the muzzle flash.
     126        this->HsW01::muzzleflash();
     127    }
     128
     129    /**
     130    @brief
     131        Displays the muzzle flash.
     132    */
     133    void HsW01::muzzleflash()
     134    {
     135        MuzzleFlash *muzzleFlash = new MuzzleFlash(this);
     136        this->getWeapon()->attach(muzzleFlash);
     137        muzzleFlash->setPosition(this->getMuzzleOffset());
     138        muzzleFlash->setMaterial(this->material_);
    134139    }
    135140}
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.h

    r6417 r8855  
    2727 */
    2828
     29/**
     30    @file HsW01.h
     31    @brief Definition of the HsW01 class.
     32*/
     33
    2934#ifndef _HsW01_H__
    3035#define _HsW01_H__
     
    3742namespace orxonox
    3843{
     44
     45    /**
     46    @brief
     47        Shoots laser beams.
     48    @author
     49        Hagen Seifert
     50    @ingroup WeaponsWeaponModes
     51    */
    3952    class _WeaponsExport HsW01 : public WeaponMode
    4053    {
     
    4760
    4861        private:
    49             void setMaterial(const std::string& material);
    50             std::string& getMaterial();
    51             void setDelay(float d);
    52             float getDelay() const;
     62            /**
     63            @brief Set the material.
     64            @param material The material name.
     65            */
     66            void setMaterial(const std::string& material)
     67                { this->material_ = material; }
     68            /**
     69            @brief Get the material.
     70            @return Returns the material name.
     71            */
     72            const std::string& getMaterial() const
     73                { return this->material_; }
     74
     75            void setDelay(float delay);
     76            /**
     77            @brief Get the firing delay.
     78            @return Returns the firing delay in seconds.
     79            */
     80            float getDelay() const
     81                { return this->delay_; }
     82
    5383            void shot();
    54             void muendungsfeuer();
     84            void muzzleflash();
    5585
    56             std::string material_;
    57             float speed_;
    58             float delay_;
    59             Timer delayTimer_;
     86            std::string material_; //!< The material.
     87            float speed_; //!< The speed of the fired projectile.
     88            float delay_; //!< The firing delay.
     89            Timer delayTimer_; //!< A timer to delay the firing.
    6090    };
    6191}
  • code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc

    r8706 r8855  
    2727 */
    2828
     29/**
     30    @file LaserFire.h
     31    @brief Implementation of the LaserFire class.
     32*/
     33
    2934#include "LaserFire.h"
    3035
    3136#include "core/CoreIncludes.h"
    32 #include "weapons/projectiles/ParticleProjectile.h"
     37
    3338#include "weaponsystem/Weapon.h"
    3439#include "weaponsystem/WeaponPack.h"
    3540#include "weaponsystem/WeaponSystem.h"
    3641#include "worldentities/pawns/Pawn.h"
     42
     43#include "weapons/projectiles/ParticleProjectile.h"
    3744
    3845namespace orxonox
     
    4451        RegisterObject(LaserFire);
    4552
    46         this->reloadTime_ = 0.25;
    47         this->damage_ = 0; //default 15
    48         this->speed_ = 1250;
     53        this->reloadTime_ = 0.25f;
     54        this->damage_ = 0.0f;
     55        this->speed_ = 1250.0f;
    4956
    5057        this->setMunitionName("LaserMunition");
    5158    }
    5259
    53     /* Creates the projectile object, sets its properties to the LaserFire properties
    54      */
     60    /**
     61    @brief
     62        Fires the weapon. Creates a projectile and fires it.
     63    */
    5564    void LaserFire::fire()
    5665    {
     
    6170        projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
    6271
    63         projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
     72        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    6473        projectile->setDamage(this->getDamage());
    6574        projectile->setShieldDamage(this->getShieldDamage());
  • code/trunk/src/modules/weapons/weaponmodes/LaserFire.h

    r5781 r8855  
    2727 */
    2828
     29/**
     30    @file LaserFire.h
     31    @brief Definition of the LaserFire class.
     32*/
     33
    2934#ifndef _LaserFire_H__
    3035#define _LaserFire_H__
     
    3540namespace orxonox
    3641{
     42
     43    /**
     44    @brief
     45        Shoots a particle laser.
     46    @author
     47        Martin Polak
     48    @ingroup WeaponsWeaponModes
     49    */
    3750    class _WeaponsExport LaserFire : public WeaponMode
    3851    {
     
    4457
    4558        private:
    46             float speed_;
     59            float speed_; //!< The speed of the fired projectile.
    4760    };
    4861}
  • code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc

    r8706 r8855  
    2727 */
    2828
     29/**
     30    @file LightningGun.h
     31    @brief Implementation of the LightningGun class.
     32*/
     33
    2934#include "LightningGun.h"
    3035
    3136#include "core/CoreIncludes.h"
    32 #include "weapons/projectiles/LightningGunProjectile.h"
    3337#include "weaponsystem/Weapon.h"
    3438#include "weaponsystem/WeaponPack.h"
    3539#include "weaponsystem/WeaponSystem.h"
    3640#include "worldentities/pawns/Pawn.h"
     41
     42#include "weapons/projectiles/LightningGunProjectile.h"
    3743
    3844namespace orxonox
     
    4450        RegisterObject(LightningGun);
    4551
    46         this->reloadTime_ = 1;
    47         this->damage_ = 0; //default 100
    48         this->speed_ = 150;
     52        this->reloadTime_ = 1.0f;
     53        this->damage_ = 0.0f;
     54        this->speed_ = 250.0f;
    4955
    5056        this->setMunitionName("LaserMunition");
     
    5662    }
    5763
    58     /* Creates the projectile (LightningGunProjectile) object, sets its properties to the LightningGun properties
    59      */
     64    /**
     65    @brief
     66        Fires the weapon. Creates a projectile and fires it.
     67    */
    6068    void LightningGun::fire()
    6169    {
     
    6775        projectile->setPosition(this->getMuzzlePosition());
    6876        projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
    69         projectile->setAcceleration(this->getMuzzleDirection() * 1000);
    7077
    71         projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
     78        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    7279        projectile->setDamage(this->getDamage());
    7380        projectile->setShieldDamage(this->getShieldDamage());
  • code/trunk/src/modules/weapons/weaponmodes/LightningGun.h

    r6417 r8855  
    2727 */
    2828
     29/**
     30    @file LightningGun.h
     31    @brief Definition of the LightningGun class.
     32*/
     33
    2934#ifndef _LightningGun_H__
    3035#define _LightningGun_H__
     
    3540namespace orxonox
    3641{
     42
     43    /**
     44    @brief
     45        A slow ball of lightning.
     46    @author
     47        Joel Smely
     48    @ingroup WeaponsWeaponModes
     49    */
    3750    class _WeaponsExport LightningGun : public WeaponMode
    3851    {
     
    4457
    4558       private:
    46             float speed_;
     59            float speed_; //!< The speed of the fired projectile.
    4760    };
    4861}
  • code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc

    r8706 r8855  
    2727 */
    2828
     29/**
     30    @file RocketFire.h
     31    @brief Implementation of the RocketFire class.
     32*/
     33
    2934#include "RocketFire.h"
    3035
     36#include "core/CoreIncludes.h"
    3137#include "util/Math.h"
    32 #include "core/CoreIncludes.h"
    33 #include "weapons/projectiles/Rocket.h"
    3438
    3539#include "weaponsystem/Weapon.h"
     
    3741#include "weaponsystem/WeaponSystem.h"
    3842#include "worldentities/pawns/Pawn.h"
     43
     44#include "weapons/projectiles/Rocket.h"
    3945
    4046namespace orxonox
     
    4854        this->reloadTime_ = 0.20f;
    4955        this->bParallelReload_ = false;
    50         this->damage_ = 0;
    51         this->speed_ = 500;
     56        this->damage_ = 0.0f;
     57        this->speed_ = 500.0f;
    5258
    5359        this->setMunitionName("RocketMunition");
     
    5965    }
    6066
    61     /* Creates the Rocket object, sets its properties to the RocketFire properties
    62      */
     67    /**
     68    @brief
     69        Fires the weapon. Creates the Rocket and fires it.
     70    */
    6371    void RocketFire::fire()
    6472    {
     
    7179        rocket->scale(2);
    7280
    73         rocket->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
     81        rocket->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    7482        rocket->setDamage(this->getDamage());
    7583        rocket->setShieldDamage(this->getShieldDamage());
  • code/trunk/src/modules/weapons/weaponmodes/RocketFire.h

    r6417 r8855  
    2727 */
    2828
     29/**
     30    @file RocketFire.h
     31    @brief Definition of the RocketFire class.
     32*/
     33
    2934#ifndef _RocketFire_H__
    3035#define _RocketFire_H__
     
    3540namespace orxonox
    3641{
     42
     43    /**
     44    @brief
     45        Fires the (steerable) Rocket.
     46    @author
     47        Oliver Scheuss
     48    @ingroup WeaponsWeaponModes
     49    */
    3750    class _WeaponsExport RocketFire : public WeaponMode
    3851    {
     
    4457
    4558        private:
    46             float speed_;
     59            float speed_; //!< The speed of the Rocket.
    4760    };
    4861}
  • code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc

    r8706 r8855  
    2121 *
    2222 *   Author:
     23 *      Gabriel Nadler
     24 *   Co-authors:
    2325 *      Oliver Scheuss
    24  *   Co-authors:
    2526 *      simonmie
    2627 *
    2728 */
    2829
     30/**
     31    @file BasicProjectile.h
     32    @brief Implementation of the BasicProjectile class.
     33*/
     34
    2935#include "SimpleRocketFire.h"
    3036
     37#include "core/CoreIncludes.h"
    3138#include "util/Math.h"
    32 #include "core/CoreIncludes.h"
    33 #include "weapons/RocketController.h"
    3439
    3540#include "weaponsystem/Weapon.h"
     
    3843#include "worldentities/pawns/Pawn.h"
    3944#include "sound/WorldSound.h"
     45
     46#include "weapons/RocketController.h"
     47#include "weapons/projectiles/SimpleRocket.h"
    4048
    4149namespace orxonox
     
    4856        RegisterObject(SimpleRocketFire);
    4957
    50         this->reloadTime_ = 1;
     58        this->reloadTime_ = 1.0f;
    5159        this->bParallelReload_ = false;
    52         this->damage_ = 0;
    53         this->speed_ = 500;
     60        this->damage_ = 0.0f;
     61        this->speed_ = 500.0f;
    5462
    5563        this->setMunitionName("RocketMunition");
     
    6270    }
    6371
    64     /* Creates the Rocket (RocketController) object, sets its properties to the SimpleRocketFire properties, sets target
    65      */
     72    /**
     73    @brief
     74        Fires the weapon. Creates the SimpleRocket and a RocketController to steer it and fires it.
     75    */
    6676    void SimpleRocketFire::fire()
    6777    {
    68         RocketController* con = new RocketController(this);
    69         SimpleRocket* rocket = con->getRocket();
     78        RocketController* controller = new RocketController(this);
     79        SimpleRocket* rocket = controller->getRocket();
    7080        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
    7181        rocket->setOrientation(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getWorldOrientation());
    7282        rocket->setPosition(this->getMuzzlePosition());
    7383        rocket->setVelocity(this->getMuzzleDirection()*this->speed_);
    74         rocket->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
     84        rocket->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    7585
    7686        rocket->setDamage(this->damage_);
     
    7888        rocket->setHealthDamage(this->getHealthDamage());
    7989
    80         WorldEntity* pawnn=static_cast<ControllableEntity*>(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn())->getTarget();
    81         if (pawnn) con->setTarget(pawnn);
     90        WorldEntity* pawn = static_cast<ControllableEntity*>(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn())->getTarget();
     91        if (pawn) controller->setTarget(pawn);
    8292    }
    8393}
  • code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.h

    r7163 r8855  
    2121 *
    2222 *   Author:
     23 *      Gabriel Nadler
     24 *   Co-authors:
    2325 *      Oliver Scheuss
    24  *   Co-authors:
    25  *      ...
    2626 *
    2727 */
     28
     29/**
     30    @file SimpleRocketFire.h
     31    @brief Definition of the SimpleRocketFire class.
     32*/
    2833
    2934#ifndef _SimpleRocketFire_H__
     
    3944        FireMode for target-seeking Rocket
    4045    @author
    41         Gabriel Nadler (Original file: Oli Scheuss)
     46        Gabriel Nadler
     47    @ingroup WeaponsWeaponModes
    4248    */
    4349    class _WeaponsExport SimpleRocketFire : public WeaponMode
     
    5056
    5157        private:
    52             float speed_;
     58            float speed_; //!< The speed of the SimpleRocket.
    5359
    5460    };
Note: See TracChangeset for help on using the changeset viewer.