Changeset 9667 for code/trunk/src/modules/weapons
- Timestamp:
- Aug 25, 2013, 9:08:42 PM (11 years ago)
- Location:
- code/trunk
- Files:
-
- 41 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core6 merged: 9552-9554,9556-9574,9577-9579,9585-9593,9596-9612,9626-9662
- Property svn:mergeinfo changed
-
code/trunk/src/modules/weapons/MuzzleFlash.cc
r8855 r9667 39 39 namespace orxonox 40 40 { 41 CreateFactory(MuzzleFlash);41 RegisterClass(MuzzleFlash); 42 42 43 MuzzleFlash::MuzzleFlash( BaseObject* creator) : Billboard(creator)43 MuzzleFlash::MuzzleFlash(Context* context) : Billboard(context) 44 44 { 45 45 RegisterObject(MuzzleFlash); -
code/trunk/src/modules/weapons/MuzzleFlash.h
r8855 r9667 55 55 { 56 56 public: 57 MuzzleFlash( BaseObject* creator);57 MuzzleFlash(Context* context); 58 58 virtual ~MuzzleFlash() {} 59 59 -
code/trunk/src/modules/weapons/RocketController.cc
r9348 r9667 45 45 Constructor. 46 46 */ 47 RocketController::RocketController( BaseObject* creator) : Controller(creator)47 RocketController::RocketController(Context* context) : Controller(context) 48 48 { 49 49 RegisterObject(RocketController); … … 51 51 52 52 // Create a rocket for the controller. 53 this->rocket_ = new SimpleRocket(this );53 this->rocket_ = new SimpleRocket(this->getContext()); 54 54 this->rocket_->setController(this); 55 55 this->setControllableEntity(orxonox_cast<ControllableEntity*>(this->rocket_)); -
code/trunk/src/modules/weapons/RocketController.h
r8855 r9667 52 52 { 53 53 public: 54 RocketController( BaseObject* creator);54 RocketController(Context* context); 55 55 virtual ~RocketController(); 56 56 -
code/trunk/src/modules/weapons/munitions/FusionMunition.cc
r8855 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(FusionMunition);39 RegisterClass(FusionMunition); 40 40 41 FusionMunition::FusionMunition( BaseObject* creator) : Munition(creator)41 FusionMunition::FusionMunition(Context* context) : Munition(context) 42 42 { 43 43 RegisterObject(FusionMunition); -
code/trunk/src/modules/weapons/munitions/FusionMunition.h
r8855 r9667 51 51 { 52 52 public: 53 FusionMunition( BaseObject* creator);53 FusionMunition(Context* context); 54 54 virtual ~FusionMunition() {} 55 55 }; -
code/trunk/src/modules/weapons/munitions/LaserMunition.cc
r8855 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(LaserMunition);39 RegisterClass(LaserMunition); 40 40 41 LaserMunition::LaserMunition( BaseObject* creator) : ReplenishingMunition(creator)41 LaserMunition::LaserMunition(Context* context) : ReplenishingMunition(context) 42 42 { 43 43 RegisterObject(LaserMunition); -
code/trunk/src/modules/weapons/munitions/LaserMunition.h
r8855 r9667 51 51 { 52 52 public: 53 LaserMunition( BaseObject* creator);53 LaserMunition(Context* context); 54 54 virtual ~LaserMunition() {} 55 55 }; -
code/trunk/src/modules/weapons/munitions/ReplenishingMunition.cc
r8855 r9667 39 39 namespace orxonox 40 40 { 41 CreateFactory(ReplenishingMunition);41 RegisterClass(ReplenishingMunition); 42 42 43 ReplenishingMunition::ReplenishingMunition( BaseObject* creator) : Munition(creator)43 ReplenishingMunition::ReplenishingMunition(Context* context) : Munition(context) 44 44 { 45 45 RegisterObject(ReplenishingMunition); -
code/trunk/src/modules/weapons/munitions/ReplenishingMunition.h
r8855 r9667 53 53 { 54 54 public: 55 ReplenishingMunition( BaseObject* creator);55 ReplenishingMunition(Context* context); 56 56 virtual ~ReplenishingMunition() {} 57 57 -
code/trunk/src/modules/weapons/munitions/RocketMunition.cc
r8855 r9667 37 37 namespace orxonox 38 38 { 39 CreateFactory(RocketMunition);39 RegisterClass(RocketMunition); 40 40 41 RocketMunition::RocketMunition( BaseObject* creator) : Munition(creator)41 RocketMunition::RocketMunition(Context* context) : Munition(context) 42 42 { 43 43 RegisterObject(RocketMunition); -
code/trunk/src/modules/weapons/munitions/RocketMunition.h
r8855 r9667 51 51 { 52 52 public: 53 RocketMunition( BaseObject* creator);53 RocketMunition(Context* context); 54 54 virtual ~RocketMunition() {} 55 55 }; -
code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc
r8855 r9667 42 42 namespace orxonox 43 43 { 44 RegisterClassNoArgs(BasicProjectile); 45 44 46 /** 45 47 @brief 46 48 Constructor. Registers the object and initializes some default values. 47 49 */ 48 BasicProjectile::BasicProjectile() : OrxonoxClass()50 BasicProjectile::BasicProjectile() 49 51 { 50 Register RootObject(BasicProjectile);// Register the BasicProjectile class to the core52 RegisterObject(BasicProjectile);// Register the BasicProjectile class to the core 51 53 52 54 this->bDestroy_ = false; … … 106 108 { 107 109 { 108 ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getC reator());110 ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getContext()); 109 111 effect->setPosition(entity->getPosition()); 110 112 effect->setOrientation(entity->getOrientation()); … … 115 117 // Second effect with same condition 116 118 { 117 ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getC reator());119 ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getContext()); 118 120 effect->setPosition(entity->getPosition()); 119 121 effect->setOrientation(entity->getOrientation()); … … 127 129 if (victim && victim->hasShield() && (this->getDamage() > 0.0f || this->getShieldDamage() > 0.0f) && victim->getHealth() > 0.0f) 128 130 { 129 ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getC reator());131 ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getContext()); 130 132 effect->setDestroyAfterLife(true); 131 133 effect->setSource("Orxonox/Shield"); -
code/trunk/src/modules/weapons/projectiles/BasicProjectile.h
r8858 r9667 39 39 #include "worldentities/pawns/Pawn.h" 40 40 41 #include "core/ OrxonoxClass.h"41 #include "core/class/OrxonoxInterface.h" 42 42 43 43 namespace orxonox … … 52 52 @ingroup WeaponsProjectiles 53 53 */ 54 class _WeaponsExport BasicProjectile : public virtual Orxonox Class54 class _WeaponsExport BasicProjectile : public virtual OrxonoxInterface 55 55 { 56 56 public: -
code/trunk/src/modules/weapons/projectiles/BillboardProjectile.cc
r8855 r9667 40 40 namespace orxonox 41 41 { 42 CreateFactory(BillboardProjectile);42 RegisterClass(BillboardProjectile); 43 43 44 BillboardProjectile::BillboardProjectile( BaseObject* creator) : Projectile(creator)44 BillboardProjectile::BillboardProjectile(Context* context) : Projectile(context) 45 45 { 46 46 RegisterObject(BillboardProjectile); -
code/trunk/src/modules/weapons/projectiles/BillboardProjectile.h
r8855 r9667 55 55 { 56 56 public: 57 BillboardProjectile( BaseObject* creator);57 BillboardProjectile(Context* context); 58 58 virtual ~BillboardProjectile(); 59 59 -
code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.cc
r8855 r9667 40 40 namespace orxonox 41 41 { 42 CreateFactory(LightningGunProjectile);42 RegisterClass(LightningGunProjectile); 43 43 44 LightningGunProjectile::LightningGunProjectile( BaseObject* creator) : BillboardProjectile(creator)44 LightningGunProjectile::LightningGunProjectile(Context* context) : BillboardProjectile(context) 45 45 { 46 46 RegisterObject(LightningGunProjectile); -
code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.h
r8855 r9667 55 55 { 56 56 public: 57 LightningGunProjectile( BaseObject* creator);57 LightningGunProjectile(Context* context); 58 58 virtual ~LightningGunProjectile() {} 59 59 -
code/trunk/src/modules/weapons/projectiles/ParticleProjectile.cc
r8855 r9667 41 41 namespace orxonox 42 42 { 43 CreateFactory(ParticleProjectile);43 RegisterClass(ParticleProjectile); 44 44 45 ParticleProjectile::ParticleProjectile( BaseObject* creator) : BillboardProjectile(creator)45 ParticleProjectile::ParticleProjectile(Context* context) : BillboardProjectile(context) 46 46 { 47 47 RegisterObject(ParticleProjectile); … … 65 65 { 66 66 this->detachOgreObject(this->particles_->getParticleSystem()); 67 this->particles_->destroy();67 delete this->particles_; 68 68 } 69 69 } -
code/trunk/src/modules/weapons/projectiles/ParticleProjectile.h
r8855 r9667 51 51 { 52 52 public: 53 ParticleProjectile( BaseObject* creator);53 ParticleProjectile(Context* context); 54 54 virtual ~ParticleProjectile(); 55 55 virtual void changedVisibility(); -
code/trunk/src/modules/weapons/projectiles/Projectile.cc
r8855 r9667 34 34 #include "Projectile.h" 35 35 36 #include "core/ ConfigValueIncludes.h"36 #include "core/config/ConfigValueIncludes.h" 37 37 #include "core/CoreIncludes.h" 38 38 #include "core/GameMode.h" … … 44 44 namespace orxonox 45 45 { 46 CreateFactory(Projectile);46 RegisterClass(Projectile); 47 47 48 Projectile::Projectile( BaseObject* creator) : MovableEntity(creator), BasicProjectile()48 Projectile::Projectile(Context* context) : MovableEntity(context), BasicProjectile() 49 49 { 50 50 RegisterObject(Projectile); … … 60 60 this->setCollisionType(Kinematic); 61 61 62 SphereCollisionShape* shape = new SphereCollisionShape(this );62 SphereCollisionShape* shape = new SphereCollisionShape(this->getContext()); 63 63 shape->setRadius(20.0f); 64 64 this->attachCollisionShape(shape); -
code/trunk/src/modules/weapons/projectiles/Projectile.h
r8855 r9667 58 58 { 59 59 public: 60 Projectile( BaseObject* creator);60 Projectile(Context* context); 61 61 virtual ~Projectile(); 62 62 -
code/trunk/src/modules/weapons/projectiles/Rocket.cc
r9016 r9667 51 51 namespace orxonox 52 52 { 53 CreateFactory(Rocket);53 RegisterClass(Rocket); 54 54 55 55 /** … … 57 57 Constructor. Registers the object and initializes some default values. 58 58 */ 59 Rocket::Rocket( BaseObject* creator)60 : ControllableEntity(c reator)59 Rocket::Rocket(Context* context) 60 : ControllableEntity(context) 61 61 , BasicProjectile() 62 , RadarViewable( creator, static_cast<WorldEntity*>(this))62 , RadarViewable(this, static_cast<WorldEntity*>(this)) 63 63 { 64 64 RegisterObject(Rocket);// Register the Rocket class to the core … … 73 73 74 74 // Create rocket model 75 Model* model = new Model(this );75 Model* model = new Model(this->getContext()); 76 76 model->setMeshSource("rocket.mesh"); 77 77 model->scale(0.7f); … … 79 79 80 80 // Add effects. 81 ParticleEmitter* fire = new ParticleEmitter(this );81 ParticleEmitter* fire = new ParticleEmitter(this->getContext()); 82 82 this->attach(fire); 83 83 fire->setOrientation(this->getOrientation()); … … 89 89 90 90 // Add collision shape 91 ConeCollisionShape* collisionShape = new ConeCollisionShape(this );91 ConeCollisionShape* collisionShape = new ConeCollisionShape(this->getContext()); 92 92 collisionShape->setRadius(3); 93 93 collisionShape->setHeight(500); … … 97 97 98 98 // Add sound 99 this->defSndWpnEngine_ = new WorldSound(this );99 this->defSndWpnEngine_ = new WorldSound(this->getContext()); 100 100 this->defSndWpnEngine_->setLooping(true); 101 101 this->defSndWpnEngine_->setSource("sounds/Rocket_engine.ogg"); … … 103 103 this->attach(defSndWpnEngine_); 104 104 105 this->defSndWpnLaunch_ = new WorldSound(this );105 this->defSndWpnLaunch_ = new WorldSound(this->getContext()); 106 106 this->defSndWpnLaunch_->setLooping(false); 107 107 this->defSndWpnLaunch_->setSource("sounds/Rocket_launch.ogg"); … … 116 116 117 117 // Add camera 118 CameraPosition* camPosition = new CameraPosition(this );118 CameraPosition* camPosition = new CameraPosition(this->getContext()); 119 119 camPosition->setPosition(0,4,15); 120 120 camPosition->setAllowMouseLook(true); … … 226 226 if(this->getShooter()) 227 227 { 228 effect1 = new ParticleSpawner(this->getShooter()->getC reator());229 effect2 = new ParticleSpawner(this->getShooter()->getC reator());228 effect1 = new ParticleSpawner(this->getShooter()->getContext()); 229 effect2 = new ParticleSpawner(this->getShooter()->getContext()); 230 230 } 231 231 else 232 232 { 233 effect1 = new ParticleSpawner( static_cast<BaseObject*>(this->getScene().get()));234 effect2 = new ParticleSpawner( static_cast<BaseObject*>(this->getScene().get()));233 effect1 = new ParticleSpawner(this->getContext()); 234 effect2 = new ParticleSpawner(this->getContext()); 235 235 } 236 236 -
code/trunk/src/modules/weapons/projectiles/Rocket.h
r9016 r9667 59 59 { 60 60 public: 61 Rocket( BaseObject* creator);61 Rocket(Context* context); 62 62 virtual ~Rocket(); 63 63 -
code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc
r8859 r9667 52 52 namespace orxonox 53 53 { 54 CreateFactory(SimpleRocket);54 RegisterClass(SimpleRocket); 55 55 56 56 const float SimpleRocket::FUEL_PERCENTAGE = 0.8f; 57 57 58 SimpleRocket::SimpleRocket( BaseObject* creator)59 : ControllableEntity(c reator)58 SimpleRocket::SimpleRocket(Context* context) 59 : ControllableEntity(context) 60 60 , BasicProjectile() 61 , RadarViewable( creator, static_cast<WorldEntity*>(this))61 , RadarViewable(this, static_cast<WorldEntity*>(this)) 62 62 { 63 63 RegisterObject(SimpleRocket);// Register the SimpleRocket class to the core … … 74 74 75 75 // Create rocket model. 76 Model* model = new Model(this );76 Model* model = new Model(this->getContext()); 77 77 model->setMeshSource("rocket.mesh"); 78 78 model->scale(0.7f); … … 80 80 81 81 // Add effects. 82 this->fire_ = new ParticleEmitter(this );82 this->fire_ = new ParticleEmitter(this->getContext()); 83 83 this->attach(this->fire_); 84 84 … … 91 91 // Add collision shape. 92 92 // TODO: fix the orientation and size of this collision shape to match the rocket 93 ConeCollisionShape* collisionShape = new ConeCollisionShape(this );93 ConeCollisionShape* collisionShape = new ConeCollisionShape(this->getContext()); 94 94 collisionShape->setOrientation(this->getOrientation()); 95 95 collisionShape->setRadius(1.5f); -
code/trunk/src/modules/weapons/projectiles/SimpleRocket.h
r8859 r9667 60 60 { 61 61 public: 62 SimpleRocket( BaseObject* creator);62 SimpleRocket(Context* context); 63 63 virtual ~SimpleRocket(); 64 64 virtual void tick(float dt); -
code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc
r8855 r9667 49 49 namespace orxonox 50 50 { 51 CreateFactory(EnergyDrink);51 RegisterClass(EnergyDrink); 52 52 53 EnergyDrink::EnergyDrink( BaseObject* creator) : WeaponMode(creator)53 EnergyDrink::EnergyDrink(Context* context) : WeaponMode(context) 54 54 { 55 55 RegisterObject(EnergyDrink); … … 101 101 { 102 102 // Create the projectile 103 Projectile* projectile = new Projectile(this );104 Model* model = new Model(projectile );103 Projectile* projectile = new Projectile(this->getContext()); 104 Model* model = new Model(projectile->getContext()); 105 105 model->setMeshSource("can.mesh"); 106 106 model->setCastShadows(false); … … 127 127 void EnergyDrink::muzzleflash() 128 128 { 129 MuzzleFlash *muzzleFlash = new MuzzleFlash(this );129 MuzzleFlash *muzzleFlash = new MuzzleFlash(this->getContext()); 130 130 this->getWeapon()->attach(muzzleFlash); 131 131 muzzleFlash->setPosition(this->getMuzzleOffset()); -
code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.h
r8855 r9667 54 54 { 55 55 public: 56 EnergyDrink( BaseObject* creator);56 EnergyDrink(Context* context); 57 57 virtual ~EnergyDrink() {} 58 58 -
code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc
r8855 r9667 46 46 namespace orxonox 47 47 { 48 CreateFactory(FusionFire);48 RegisterClass(FusionFire); 49 49 50 FusionFire::FusionFire( BaseObject* creator) : WeaponMode(creator)50 FusionFire::FusionFire(Context* context) : WeaponMode(context) 51 51 { 52 52 RegisterObject(FusionFire); … … 66 66 void FusionFire::fire() 67 67 { 68 BillboardProjectile* projectile = new BillboardProjectile(this );68 BillboardProjectile* projectile = new BillboardProjectile(this->getContext()); 69 69 70 70 projectile->setOrientation(this->getMuzzleOrientation()); -
code/trunk/src/modules/weapons/weaponmodes/FusionFire.h
r8855 r9667 51 51 { 52 52 public: 53 FusionFire( BaseObject* creator);53 FusionFire(Context* context); 54 54 virtual ~FusionFire() {} 55 55 -
code/trunk/src/modules/weapons/weaponmodes/HsW01.cc
r9526 r9667 50 50 namespace orxonox 51 51 { 52 CreateFactory(HsW01);52 RegisterClass(HsW01); 53 53 54 HsW01::HsW01( BaseObject* creator) : WeaponMode(creator)54 HsW01::HsW01(Context* context) : WeaponMode(context) 55 55 { 56 56 RegisterObject(HsW01); … … 111 111 112 112 // Create the projectile. 113 Projectile* projectile = new Projectile(this );114 Model* model = new Model(projectile );113 Projectile* projectile = new Projectile(this->getContext()); 114 Model* model = new Model(projectile->getContext()); 115 115 model->setMeshSource(mesh_); 116 116 model->setCastShadows(false); … … 138 138 void HsW01::muzzleflash() 139 139 { 140 MuzzleFlash *muzzleFlash = new MuzzleFlash(this );140 MuzzleFlash *muzzleFlash = new MuzzleFlash(this->getContext()); 141 141 this->getWeapon()->attach(muzzleFlash); 142 142 muzzleFlash->setPosition(this->getMuzzleOffset()); -
code/trunk/src/modules/weapons/weaponmodes/HsW01.h
r9526 r9667 53 53 { 54 54 public: 55 HsW01( BaseObject* creator);55 HsW01(Context* context); 56 56 virtual ~HsW01(); 57 57 -
code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc
r8855 r9667 45 45 namespace orxonox 46 46 { 47 CreateFactory(LaserFire);47 RegisterClass(LaserFire); 48 48 49 LaserFire::LaserFire( BaseObject* creator) : WeaponMode(creator)49 LaserFire::LaserFire(Context* context) : WeaponMode(context) 50 50 { 51 51 RegisterObject(LaserFire); … … 64 64 void LaserFire::fire() 65 65 { 66 ParticleProjectile* projectile = new ParticleProjectile(this );66 ParticleProjectile* projectile = new ParticleProjectile(this->getContext()); 67 67 68 68 projectile->setOrientation(this->getMuzzleOrientation()); -
code/trunk/src/modules/weapons/weaponmodes/LaserFire.h
r8855 r9667 51 51 { 52 52 public: 53 LaserFire( BaseObject* creator);53 LaserFire(Context* context); 54 54 virtual ~LaserFire() {} 55 55 -
code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc
r9016 r9667 44 44 namespace orxonox 45 45 { 46 CreateFactory(LightningGun);46 RegisterClass(LightningGun); 47 47 48 LightningGun::LightningGun( BaseObject* creator) : WeaponMode(creator)48 LightningGun::LightningGun(Context* context) : WeaponMode(context) 49 49 { 50 50 RegisterObject(LightningGun); … … 68 68 void LightningGun::fire() 69 69 { 70 LightningGunProjectile* projectile = new LightningGunProjectile(this );70 LightningGunProjectile* projectile = new LightningGunProjectile(this->getContext()); 71 71 projectile->setMaterial("Flares/LightningBall_"); 72 72 -
code/trunk/src/modules/weapons/weaponmodes/LightningGun.h
r8855 r9667 51 51 { 52 52 public: 53 LightningGun( BaseObject* creator);53 LightningGun(Context* context); 54 54 virtual ~LightningGun(); 55 55 -
code/trunk/src/modules/weapons/weaponmodes/RocketFire.cc
r8855 r9667 46 46 namespace orxonox 47 47 { 48 CreateFactory(RocketFire);48 RegisterClass(RocketFire); 49 49 50 RocketFire::RocketFire( BaseObject* creator) : WeaponMode(creator)50 RocketFire::RocketFire(Context* context) : WeaponMode(context) 51 51 { 52 52 RegisterObject(RocketFire); … … 71 71 void RocketFire::fire() 72 72 { 73 Rocket* rocket = new Rocket(this );73 Rocket* rocket = new Rocket(this->getContext()); 74 74 75 75 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); -
code/trunk/src/modules/weapons/weaponmodes/RocketFire.h
r8855 r9667 51 51 { 52 52 public: 53 RocketFire( BaseObject* creator);53 RocketFire(Context* context); 54 54 virtual ~RocketFire(); 55 55 -
code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
r8855 r9667 50 50 { 51 51 52 CreateFactory(SimpleRocketFire);52 RegisterClass(SimpleRocketFire); 53 53 54 SimpleRocketFire::SimpleRocketFire( BaseObject* creator) : WeaponMode(creator)54 SimpleRocketFire::SimpleRocketFire(Context* context) : WeaponMode(context) 55 55 { 56 56 RegisterObject(SimpleRocketFire); … … 76 76 void SimpleRocketFire::fire() 77 77 { 78 RocketController* controller = new RocketController(this );78 RocketController* controller = new RocketController(this->getContext()); 79 79 SimpleRocket* rocket = controller->getRocket(); 80 80 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); -
code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.h
r8855 r9667 50 50 { 51 51 public: 52 SimpleRocketFire( BaseObject* creator);52 SimpleRocketFire(Context* context); 53 53 virtual ~SimpleRocketFire(); 54 54 void deactivateFire();
Note: See TracChangeset
for help on using the changeset viewer.