Changeset 2662 for code/trunk/src/orxonox/objects/weaponSystem/weapons
- Timestamp:
- Feb 14, 2009, 10:17:35 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/weaponSystem/weapons/CMakeLists.txt
r2131 r2662 1 1 SET( SRC_FILES 2 Fusion.cc 2 3 LaserGun.cc 3 Missile.cc4 # Missile.cc 4 5 ) 5 6 -
code/trunk/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc
r2097 r2662 34 34 #include "util/Debug.h" 35 35 36 #include "LaserGun.h" 37 36 38 37 39 namespace orxonox 38 40 { 41 CreateFactory(LaserGun); 42 39 43 LaserGun::LaserGun(BaseObject* creator) : Weapon(creator) 40 44 { 41 45 RegisterObject(LaserGun); 42 46 43 projectileColor_ = ColourValue(1.0, 1.0, 0.5) 47 this->speed_ = 1250; 48 44 49 } 45 50 … … 48 53 } 49 54 50 LaserGun::fire()55 void LaserGun::takeBullets() 51 56 { 52 BillboardProjectile* projectile = new ParticleProjectile(this); 53 projectile->setColour(this->projectileColor_); 54 projectile->create(); 55 if (projectile->getClassID() == 0) 56 { 57 COUT(3) << "generated projectile with classid 0" << std::endl; // TODO: remove this output 58 } 59 60 projectile->setObjectMode(0x3); 57 //COUT(0) << "LaserGun::takeBullets" << std::endl; 58 this->munition_->removeBullets(1); 59 this->bulletTimer(this->bulletLoadingTime_); 61 60 } 62 61 63 LaserGun::addMunition()62 void LaserGun::takeMagazines() 64 63 { 65 //this->munition_ = ; 64 this->munition_->removeMagazines(1); 65 this->magazineTimer(this->magazineLoadingTime_); 66 66 } 67 67 68 void LaserGun:: XMLPort(Element& xmlelement, XMLPort::Mode mode)68 void LaserGun::createProjectile() 69 69 { 70 71 }72 73 ColorValue LaserGun::getProjectileColor()74 {75 return projectileColor_;70 //COUT(0) << "LaserGun::createProjectile" << std::endl; 71 BillboardProjectile* projectile = new ParticleProjectile(this); 72 projectile->setOrientation(this->getWorldOrientation()); 73 projectile->setPosition(this->getWorldPosition()); 74 projectile->setVelocity(this->getWorldOrientation() * WorldEntity::FRONT * this->speed_); 75 projectile->setOwner(this->getParentWeaponSystem()->getParentPawn()); 76 76 } 77 77 } -
code/trunk/src/orxonox/objects/weaponSystem/weapons/LaserGun.h
r2106 r2662 34 34 #include "core/BaseObject.h" 35 35 36 #include "LaserGunMunition.h" 37 #include "tools/BillboardSet.h" 36 #include "../munitions/LaserGunMunition.h" 38 37 #include "util/Math.h" 38 #include "../Weapon.h" 39 #include "../projectiles/BillboardProjectile.h" 40 #include "../projectiles/ParticleProjectile.h" 39 41 40 42 namespace orxonox … … 46 48 virtual ~LaserGun(); 47 49 48 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);49 50 ColourValue LaserGun::getProjectileColour();50 virtual void takeBullets(); 51 virtual void takeMagazines(); 52 virtual void createProjectile(); 51 53 52 54 private: 53 ColorValue projectileColor_; 54 55 55 float speed_; 56 56 57 57 };
Note: See TracChangeset
for help on using the changeset viewer.