[Orxonox-commit 1435] r6153 - in code/branches/presentation2: data/gui/scripts src/modules/weapons/weaponmodes src/orxonox/weaponsystem

scheusso at orxonox.net scheusso at orxonox.net
Wed Nov 25 18:04:10 CET 2009


Author: scheusso
Date: 2009-11-25 18:04:10 +0100 (Wed, 25 Nov 2009)
New Revision: 6153

Modified:
   code/branches/presentation2/data/gui/scripts/InitialiseGUI.lua
   code/branches/presentation2/src/modules/weapons/weaponmodes/LightningGun.cc
   code/branches/presentation2/src/modules/weapons/weaponmodes/RocketFire.cc
   code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.cc
Log:
some fixes in weapon system / weapons
fabian: projectiles also spawn on wrong position in standalone mode


Modified: code/branches/presentation2/data/gui/scripts/InitialiseGUI.lua
===================================================================
--- code/branches/presentation2/data/gui/scripts/InitialiseGUI.lua	2009-11-25 16:26:19 UTC (rev 6152)
+++ code/branches/presentation2/data/gui/scripts/InitialiseGUI.lua	2009-11-25 17:04:10 UTC (rev 6153)
@@ -186,7 +186,6 @@
     if root ~= nil then
         local child
         while root:getChildCount()~=0 do
-            debug(root:getChildCount())
             child = root:getChildAtIdx(0)
             root:removeChildWindow(child)
             newroot:addChildWindow(child)

Modified: code/branches/presentation2/src/modules/weapons/weaponmodes/LightningGun.cc
===================================================================
--- code/branches/presentation2/src/modules/weapons/weaponmodes/LightningGun.cc	2009-11-25 16:26:19 UTC (rev 6152)
+++ code/branches/presentation2/src/modules/weapons/weaponmodes/LightningGun.cc	2009-11-25 17:04:10 UTC (rev 6153)
@@ -58,6 +58,7 @@
         LightningGunProjectile* projectile = new LightningGunProjectile(this);
         projectile->setMaterial("Flares/LightningBall_");
 
+        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
         projectile->setOrientation(this->getMuzzleOrientation());
         projectile->setPosition(this->getMuzzlePosition());
         projectile->setVelocity(this->getMuzzleDirection() * this->speed_);

Modified: code/branches/presentation2/src/modules/weapons/weaponmodes/RocketFire.cc
===================================================================
--- code/branches/presentation2/src/modules/weapons/weaponmodes/RocketFire.cc	2009-11-25 16:26:19 UTC (rev 6152)
+++ code/branches/presentation2/src/modules/weapons/weaponmodes/RocketFire.cc	2009-11-25 17:04:10 UTC (rev 6153)
@@ -35,6 +35,7 @@
 #include "weaponsystem/Weapon.h"
 #include "weaponsystem/WeaponPack.h"
 #include "weaponsystem/WeaponSystem.h"
+#include "worldentities/pawns/Pawn.h"
 
 namespace orxonox
 {
@@ -56,6 +57,7 @@
     {
         Rocket* rocket = new Rocket(this);
 
+        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
         rocket->setOrientation(this->getMuzzleOrientation());
         rocket->setPosition(this->getMuzzlePosition());
         rocket->setVelocity(this->getMuzzleDirection() * this->speed_);

Modified: code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.cc
===================================================================
--- code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.cc	2009-11-25 16:26:19 UTC (rev 6152)
+++ code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.cc	2009-11-25 17:04:10 UTC (rev 6153)
@@ -204,7 +204,6 @@
         {
             this->muzzlePosition_ = this->weapon_->getWorldPosition() + this->weapon_->getWorldOrientation() * this->muzzleOffset_;
 
-            Pawn* pawn = this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn();
             Vector3 muzzleDirection;
             muzzleDirection = target - this->muzzlePosition_;
 //             COUT(0) << "muzzleDirection " << muzzleDirection << endl;




More information about the Orxonox-commit mailing list