Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6732 for code


Ignore:
Timestamp:
Apr 15, 2010, 3:35:31 PM (15 years ago)
Author:
scheusso
Message:

correcting initial speed of projectiles

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

Legend:

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

    r5929 r6732  
    3939#include "weaponsystem/WeaponPack.h"
    4040#include "weaponsystem/WeaponSystem.h"
     41#include "worldentities/pawns/Pawn.h"
    4142
    4243namespace orxonox
     
    107108        projectile->setOrientation(this->getMuzzleOrientation());
    108109        projectile->setPosition(this->getMuzzlePosition());
    109         projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
     110        projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
    110111
    111112        projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
  • code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc

    r5781 r6732  
    3636#include "weaponsystem/WeaponPack.h"
    3737#include "weaponsystem/WeaponSystem.h"
     38#include "worldentities/pawns/Pawn.h"
    3839
    3940namespace orxonox
     
    5960        projectile->setOrientation(this->getMuzzleOrientation());
    6061        projectile->setPosition(this->getMuzzlePosition());
    61         projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
     62        projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
    6263        projectile->scale(5);
    6364
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.cc

    r6417 r6732  
    122122        projectile->setOrientation(this->getMuzzleOrientation());
    123123        projectile->setPosition(this->getMuzzlePosition());
    124         projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
     124        projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
    125125
    126126        projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
  • code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc

    r5781 r6732  
    3434#include "weaponsystem/WeaponPack.h"
    3535#include "weaponsystem/WeaponSystem.h"
     36#include "worldentities/pawns/Pawn.h"
    3637
    3738namespace orxonox
     
    5657        projectile->setOrientation(this->getMuzzleOrientation());
    5758        projectile->setPosition(this->getMuzzlePosition());
    58         projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
     59        projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
    5960
    6061        projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
  • code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc

    r6417 r6732  
    6464        projectile->setOrientation(this->getMuzzleOrientation());
    6565        projectile->setPosition(this->getMuzzlePosition());
    66         projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
     66        projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
    6767        projectile->setAcceleration(this->getMuzzleDirection() * 1000);
    6868
  • code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc

    r6502 r6732  
    6666        rocket->setOrientation(this->getMuzzleOrientation());
    6767        rocket->setPosition(this->getMuzzlePosition());
    68         rocket->setVelocity(this->getMuzzleDirection() * this->speed_);
     68        rocket->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
    6969        rocket->scale(2);
    7070
Note: See TracChangeset for help on using the changeset viewer.