Changeset 9667 for code/trunk/src/modules/weapons/projectiles
- Timestamp:
- Aug 25, 2013, 9:08:42 PM (11 years ago)
- Location:
- code/trunk
- Files:
-
- 15 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/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);
Note: See TracChangeset
for help on using the changeset viewer.