[Orxonox-commit 5636] r10296 - code/trunk/src/modules/weapons/weaponmodes
landauf at orxonox.net
landauf at orxonox.net
Sun Mar 1 22:06:18 CET 2015
Author: landauf
Date: 2015-03-01 22:06:17 +0100 (Sun, 01 Mar 2015)
New Revision: 10296
Modified:
code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc
code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc
code/trunk/src/modules/weapons/weaponmodes/HsW01.cc
code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc
code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc
code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc
Log:
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.
Modified: code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc 2015-03-01 20:59:53 UTC (rev 10295)
+++ code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc 2015-03-01 21:06:17 UTC (rev 10296)
@@ -109,7 +109,7 @@
projectile->setOrientation(this->getMuzzleOrientation());
projectile->setPosition(this->getMuzzlePosition());
- projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
+ projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
projectile->setDamage(this->getDamage());
Modified: code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc 2015-03-01 20:59:53 UTC (rev 10295)
+++ code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc 2015-03-01 21:06:17 UTC (rev 10296)
@@ -69,7 +69,7 @@
projectile->setOrientation(this->getMuzzleOrientation());
projectile->setPosition(this->getMuzzlePosition());
- projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
+ projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
projectile->scale(5);
projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
Modified: code/trunk/src/modules/weapons/weaponmodes/HsW01.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/HsW01.cc 2015-03-01 20:59:53 UTC (rev 10295)
+++ code/trunk/src/modules/weapons/weaponmodes/HsW01.cc 2015-03-01 21:06:17 UTC (rev 10296)
@@ -120,7 +120,7 @@
this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
projectile->setOrientation(this->getMuzzleOrientation());
projectile->setPosition(this->getMuzzlePosition());
- projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
+ projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
projectile->setDamage(this->getDamage());
Modified: code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc 2015-03-01 20:59:53 UTC (rev 10295)
+++ code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc 2015-03-01 21:06:17 UTC (rev 10296)
@@ -67,7 +67,7 @@
projectile->setOrientation(this->getMuzzleOrientation());
projectile->setPosition(this->getMuzzlePosition());
- projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
+ projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
projectile->setDamage(this->getDamage());
Modified: code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc 2015-03-01 20:59:53 UTC (rev 10295)
+++ code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc 2015-03-01 21:06:17 UTC (rev 10296)
@@ -73,7 +73,7 @@
this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
projectile->setOrientation(this->getMuzzleOrientation());
projectile->setPosition(this->getMuzzlePosition());
- projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
+ projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
projectile->setDamage(this->getDamage());
Modified: code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc 2015-03-01 20:59:53 UTC (rev 10295)
+++ code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc 2015-03-01 21:06:17 UTC (rev 10296)
@@ -75,7 +75,7 @@
this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
rocket->setOrientation(this->getMuzzleOrientation());
rocket->setPosition(this->getMuzzlePosition());
- rocket->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
+ rocket->setVelocity(this->getMuzzleDirection() * this->speed_);
rocket->scale(2);
rocket->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
More information about the Orxonox-commit
mailing list