[Orxonox-commit 2015] r6732 - code/trunk/src/modules/weapons/weaponmodes
scheusso at orxonox.net
scheusso at orxonox.net
Thu Apr 15 15:35:32 CEST 2010
Author: scheusso
Date: 2010-04-15 15:35:31 +0200 (Thu, 15 Apr 2010)
New Revision: 6732
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:
correcting initial speed of projectiles
Modified: code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc 2010-04-15 12:47:39 UTC (rev 6731)
+++ code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc 2010-04-15 13:35:31 UTC (rev 6732)
@@ -38,6 +38,7 @@
#include "weaponsystem/Weapon.h"
#include "weaponsystem/WeaponPack.h"
#include "weaponsystem/WeaponSystem.h"
+#include "worldentities/pawns/Pawn.h"
namespace orxonox
{
@@ -106,7 +107,7 @@
projectile->setOrientation(this->getMuzzleOrientation());
projectile->setPosition(this->getMuzzlePosition());
- projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
+ projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
projectile->setOwner(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 2010-04-15 12:47:39 UTC (rev 6731)
+++ code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc 2010-04-15 13:35:31 UTC (rev 6732)
@@ -35,6 +35,7 @@
#include "weaponsystem/Weapon.h"
#include "weaponsystem/WeaponPack.h"
#include "weaponsystem/WeaponSystem.h"
+#include "worldentities/pawns/Pawn.h"
namespace orxonox
{
@@ -58,7 +59,7 @@
projectile->setOrientation(this->getMuzzleOrientation());
projectile->setPosition(this->getMuzzlePosition());
- projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
+ projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
projectile->scale(5);
projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
Modified: code/trunk/src/modules/weapons/weaponmodes/HsW01.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/HsW01.cc 2010-04-15 12:47:39 UTC (rev 6731)
+++ code/trunk/src/modules/weapons/weaponmodes/HsW01.cc 2010-04-15 13:35:31 UTC (rev 6732)
@@ -121,7 +121,7 @@
this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
projectile->setOrientation(this->getMuzzleOrientation());
projectile->setPosition(this->getMuzzlePosition());
- projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
+ projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
projectile->setOwner(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 2010-04-15 12:47:39 UTC (rev 6731)
+++ code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc 2010-04-15 13:35:31 UTC (rev 6732)
@@ -33,6 +33,7 @@
#include "weaponsystem/Weapon.h"
#include "weaponsystem/WeaponPack.h"
#include "weaponsystem/WeaponSystem.h"
+#include "worldentities/pawns/Pawn.h"
namespace orxonox
{
@@ -55,7 +56,7 @@
projectile->setOrientation(this->getMuzzleOrientation());
projectile->setPosition(this->getMuzzlePosition());
- projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
+ projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
projectile->setOwner(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 2010-04-15 12:47:39 UTC (rev 6731)
+++ code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc 2010-04-15 13:35:31 UTC (rev 6732)
@@ -63,7 +63,7 @@
this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
projectile->setOrientation(this->getMuzzleOrientation());
projectile->setPosition(this->getMuzzlePosition());
- projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
+ projectile->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
projectile->setAcceleration(this->getMuzzleDirection() * 1000);
projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
Modified: code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc 2010-04-15 12:47:39 UTC (rev 6731)
+++ code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc 2010-04-15 13:35:31 UTC (rev 6732)
@@ -65,7 +65,7 @@
this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
rocket->setOrientation(this->getMuzzleOrientation());
rocket->setPosition(this->getMuzzlePosition());
- rocket->setVelocity(this->getMuzzleDirection() * this->speed_);
+ rocket->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_);
rocket->scale(2);
rocket->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
More information about the Orxonox-commit
mailing list