- Timestamp:
- Dec 17, 2008, 2:10:11 AM (16 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation
- Property svn:mergeinfo changed
/code/branches/weapon2 (added) merged: 2108,2145,2186,2203,2232,2272-2273,2288,2308,2319,2327,2331,2337,2347,2354,2366-2368,2379,2391,2393,2398,2410
- Property svn:mergeinfo changed
-
code/branches/presentation/src/orxonox/objects/weaponSystem/weapons/CMakeLists.txt
r2131 r2493 1 1 SET( SRC_FILES 2 Fusion.cc 2 3 LaserGun.cc 3 Missile.cc4 # Missile.cc 4 5 ) 5 6 -
code/branches/presentation/src/orxonox/objects/weaponSystem/weapons/Fusion.cc
r2489 r2493 44 44 { 45 45 RegisterObject(Fusion); 46 46 47 47 this->speed_ = 1250; 48 48 … … 55 55 void Fusion::takeBullets() 56 56 { 57 COUT(0) << "Fusion::takeBullets" << std::endl;57 //COUT(0) << "Fusion::takeBullets" << std::endl; 58 58 this->munition_->removeBullets(1); 59 59 this->bulletTimer(this->bulletLoadingTime_); … … 68 68 void Fusion::createProjectile() 69 69 { 70 COUT(0) << "Fusion::createProjectile" << std::endl;70 //COUT(0) << "Fusion::createProjectile" << std::endl; 71 71 BillboardProjectile* projectile = new ParticleProjectile(this); 72 72 projectile->setOrientation(this->getWorldOrientation()); 73 73 projectile->setPosition(this->getWorldPosition()); 74 projectile->setVelocity( WorldEntity::FRONT * this->speed_);74 projectile->setVelocity(this->getWorldOrientation() * WorldEntity::FRONT * this->speed_); 75 75 } 76 76 } -
code/branches/presentation/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc
r2097 r2493 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_); 76 75 } 77 76 } -
code/branches/presentation/src/orxonox/objects/weaponSystem/weapons/LaserGun.h
r2106 r2493 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.