[Orxonox-commit 2380] r7095 - in code/branches/presentation3/src: modules/weapons/projectiles modules/weapons/weaponmodes orxonox/weaponsystem

gnadler at orxonox.net gnadler at orxonox.net
Wed Jun 2 23:18:00 CEST 2010


Author: gnadler
Date: 2010-06-02 23:18:00 +0200 (Wed, 02 Jun 2010)
New Revision: 7095

Modified:
   code/branches/presentation3/src/modules/weapons/projectiles/SimpleRocket.h
   code/branches/presentation3/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
   code/branches/presentation3/src/orxonox/weaponsystem/WeaponMode.cc
   code/branches/presentation3/src/orxonox/weaponsystem/WeaponMode.h
Log:
added a launching sound to the rocket.
Added an additional sound-set function to WeaponMode.cc to be able to set the volume as well as the source.

Modified: code/branches/presentation3/src/modules/weapons/projectiles/SimpleRocket.h
===================================================================
--- code/branches/presentation3/src/modules/weapons/projectiles/SimpleRocket.h	2010-06-02 21:16:20 UTC (rev 7094)
+++ code/branches/presentation3/src/modules/weapons/projectiles/SimpleRocket.h	2010-06-02 21:18:00 UTC (rev 7095)
@@ -136,7 +136,6 @@
 
 
 
-
     };
 
 }

Modified: code/branches/presentation3/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
===================================================================
--- code/branches/presentation3/src/modules/weapons/weaponmodes/SimpleRocketFire.cc	2010-06-02 21:16:20 UTC (rev 7094)
+++ code/branches/presentation3/src/modules/weapons/weaponmodes/SimpleRocketFire.cc	2010-06-02 21:18:00 UTC (rev 7095)
@@ -36,6 +36,7 @@
 #include "weaponsystem/WeaponPack.h"
 #include "weaponsystem/WeaponSystem.h"
 #include "worldentities/pawns/Pawn.h"
+#include "sound/WorldSound.h"
 
 namespace orxonox
 {
@@ -51,7 +52,8 @@
         this->damage_ = 100;
         this->speed_ = 500;
 
-        this->setMunitionName("LaserMunition");
+            this->setMunitionName("TargetSeeking Rockets");
+            this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.4); 
         // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning)
     }
 

Modified: code/branches/presentation3/src/orxonox/weaponsystem/WeaponMode.cc
===================================================================
--- code/branches/presentation3/src/orxonox/weaponsystem/WeaponMode.cc	2010-06-02 21:16:20 UTC (rev 7094)
+++ code/branches/presentation3/src/orxonox/weaponsystem/WeaponMode.cc	2010-06-02 21:18:00 UTC (rev 7095)
@@ -273,4 +273,12 @@
         else
             return BLANKSTRING;
     }
+
+    void WeaponMode::setDefaultSoundWithVolume(const std::string& soundPath, const float soundVolume){
+        if (this->defSndWpnFire_) {
+            this->defSndWpnFire_->setSource(soundPath);
+            this->defSndWpnFire_->setVolume(soundVolume);
+        }
+    }
+
 }

Modified: code/branches/presentation3/src/orxonox/weaponsystem/WeaponMode.h
===================================================================
--- code/branches/presentation3/src/orxonox/weaponsystem/WeaponMode.h	2010-06-02 21:16:20 UTC (rev 7094)
+++ code/branches/presentation3/src/orxonox/weaponsystem/WeaponMode.h	2010-06-02 21:18:00 UTC (rev 7095)
@@ -54,8 +54,8 @@
             // Interacting with the default Firing sound
             void setDefaultSound(const std::string& soundPath);
             const std::string& getDefaultSound();
+            void setDefaultSoundWithVolume(const std::string& soundPath, const float soundVolume);
 
-
             // Munition
             inline Munition* getMunition() const
                 { return this->munition_; }




More information about the Orxonox-commit mailing list