Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 1, 2015, 10:06:17 PM (10 years ago)
Author:
landauf
Message:

don't add the pawn's velocity to the projectile's velocity. this makes no sense if the pawn's velocity is perpendicular to the projectile's velocity (e.g. for side turrets or when the pawn is 'strafing'). if at all, only the part of the pawn's velocity which has the same direction like the projectile should be considered. but this still makes projectiles unpredictable because they have changing speed. so better don't do it at all.

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

Legend:

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

    r10294 r10296  
    110110        projectile->setOrientation(this->getMuzzleOrientation());
    111111        projectile->setPosition(this->getMuzzlePosition());
    112         projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
     112        projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
    113113
    114114        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
  • code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc

    r10294 r10296  
    7070        projectile->setOrientation(this->getMuzzleOrientation());
    7171        projectile->setPosition(this->getMuzzlePosition());
    72         projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
     72        projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
    7373        projectile->scale(5);
    7474
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.cc

    r10294 r10296  
    121121        projectile->setOrientation(this->getMuzzleOrientation());
    122122        projectile->setPosition(this->getMuzzlePosition());
    123         projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
     123        projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
    124124
    125125        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
  • code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc

    r10294 r10296  
    6868        projectile->setOrientation(this->getMuzzleOrientation());
    6969        projectile->setPosition(this->getMuzzlePosition());
    70         projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
     70        projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
    7171
    7272        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
  • code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc

    r10294 r10296  
    7474        projectile->setOrientation(this->getMuzzleOrientation());
    7575        projectile->setPosition(this->getMuzzlePosition());
    76         projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
     76        projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
    7777
    7878        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
  • code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc

    r9667 r10296  
    7676        rocket->setOrientation(this->getMuzzleOrientation());
    7777        rocket->setPosition(this->getMuzzlePosition());
    78         rocket->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
     78        rocket->setVelocity(this->getMuzzleDirection() * this->speed_);
    7979        rocket->scale(2);
    8080
Note: See TracChangeset for help on using the changeset viewer.