Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 25, 2013, 9:08:42 PM (11 years ago)
Author:
landauf
Message:

merged core6 back to trunk

Location:
code/trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc

    r8855 r9667  
    4242namespace orxonox
    4343{
     44    RegisterClassNoArgs(BasicProjectile);
     45
    4446    /**
    4547    @brief
    4648        Constructor. Registers the object and initializes some default values.
    4749    */
    48     BasicProjectile::BasicProjectile() : OrxonoxClass()
     50    BasicProjectile::BasicProjectile()
    4951    {
    50         RegisterRootObject(BasicProjectile);// Register the BasicProjectile class to the core
     52        RegisterObject(BasicProjectile);// Register the BasicProjectile class to the core
    5153
    5254        this->bDestroy_ = false;
     
    106108                {
    107109                    {
    108                         ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getCreator());
     110                        ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getContext());
    109111                        effect->setPosition(entity->getPosition());
    110112                        effect->setOrientation(entity->getOrientation());
     
    115117                    // Second effect with same condition
    116118                    {
    117                         ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getCreator());
     119                        ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getContext());
    118120                        effect->setPosition(entity->getPosition());
    119121                        effect->setOrientation(entity->getOrientation());
     
    127129                if (victim && victim->hasShield() && (this->getDamage() > 0.0f || this->getShieldDamage() > 0.0f) && victim->getHealth() > 0.0f)
    128130                {
    129                     ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getCreator());
     131                    ParticleSpawner* effect = new ParticleSpawner(this->getShooter()->getContext());
    130132                    effect->setDestroyAfterLife(true);
    131133                    effect->setSource("Orxonox/Shield");
  • code/trunk/src/modules/weapons/projectiles/BasicProjectile.h

    r8858 r9667  
    3939#include "worldentities/pawns/Pawn.h"
    4040
    41 #include "core/OrxonoxClass.h"
     41#include "core/class/OrxonoxInterface.h"
    4242
    4343namespace orxonox
     
    5252    @ingroup WeaponsProjectiles
    5353    */
    54     class _WeaponsExport BasicProjectile : public virtual OrxonoxClass
     54    class _WeaponsExport BasicProjectile : public virtual OrxonoxInterface
    5555    {
    5656        public:
  • code/trunk/src/modules/weapons/projectiles/BillboardProjectile.cc

    r8855 r9667  
    4040namespace orxonox
    4141{
    42     CreateFactory(BillboardProjectile);
     42    RegisterClass(BillboardProjectile);
    4343
    44     BillboardProjectile::BillboardProjectile(BaseObject* creator) : Projectile(creator)
     44    BillboardProjectile::BillboardProjectile(Context* context) : Projectile(context)
    4545    {
    4646        RegisterObject(BillboardProjectile);
  • code/trunk/src/modules/weapons/projectiles/BillboardProjectile.h

    r8855 r9667  
    5555    {
    5656        public:
    57             BillboardProjectile(BaseObject* creator);
     57            BillboardProjectile(Context* context);
    5858            virtual ~BillboardProjectile();
    5959
  • code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.cc

    r8855 r9667  
    4040namespace orxonox
    4141{
    42     CreateFactory(LightningGunProjectile);
     42    RegisterClass(LightningGunProjectile);
    4343
    44     LightningGunProjectile::LightningGunProjectile(BaseObject* creator) : BillboardProjectile(creator)
     44    LightningGunProjectile::LightningGunProjectile(Context* context) : BillboardProjectile(context)
    4545    {
    4646        RegisterObject(LightningGunProjectile);
  • code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.h

    r8855 r9667  
    5555    {
    5656        public:
    57             LightningGunProjectile(BaseObject* creator);
     57            LightningGunProjectile(Context* context);
    5858            virtual ~LightningGunProjectile() {}
    5959
  • code/trunk/src/modules/weapons/projectiles/ParticleProjectile.cc

    r8855 r9667  
    4141namespace orxonox
    4242{
    43     CreateFactory(ParticleProjectile);
     43    RegisterClass(ParticleProjectile);
    4444
    45     ParticleProjectile::ParticleProjectile(BaseObject* creator) : BillboardProjectile(creator)
     45    ParticleProjectile::ParticleProjectile(Context* context) : BillboardProjectile(context)
    4646    {
    4747        RegisterObject(ParticleProjectile);
     
    6565        {
    6666            this->detachOgreObject(this->particles_->getParticleSystem());
    67             this->particles_->destroy();
     67            delete this->particles_;
    6868        }
    6969    }
  • code/trunk/src/modules/weapons/projectiles/ParticleProjectile.h

    r8855 r9667  
    5151    {
    5252        public:
    53             ParticleProjectile(BaseObject* creator);
     53            ParticleProjectile(Context* context);
    5454            virtual ~ParticleProjectile();
    5555            virtual void changedVisibility();
  • code/trunk/src/modules/weapons/projectiles/Projectile.cc

    r8855 r9667  
    3434#include "Projectile.h"
    3535
    36 #include "core/ConfigValueIncludes.h"
     36#include "core/config/ConfigValueIncludes.h"
    3737#include "core/CoreIncludes.h"
    3838#include "core/GameMode.h"
     
    4444namespace orxonox
    4545{
    46     CreateFactory(Projectile);
     46    RegisterClass(Projectile);
    4747
    48     Projectile::Projectile(BaseObject* creator) : MovableEntity(creator), BasicProjectile()
     48    Projectile::Projectile(Context* context) : MovableEntity(context), BasicProjectile()
    4949    {
    5050        RegisterObject(Projectile);
     
    6060            this->setCollisionType(Kinematic);
    6161
    62             SphereCollisionShape* shape = new SphereCollisionShape(this);
     62            SphereCollisionShape* shape = new SphereCollisionShape(this->getContext());
    6363            shape->setRadius(20.0f);
    6464            this->attachCollisionShape(shape);
  • code/trunk/src/modules/weapons/projectiles/Projectile.h

    r8855 r9667  
    5858    {
    5959        public:
    60             Projectile(BaseObject* creator);
     60            Projectile(Context* context);
    6161            virtual ~Projectile();
    6262
  • code/trunk/src/modules/weapons/projectiles/Rocket.cc

    r9016 r9667  
    5151namespace orxonox
    5252{
    53     CreateFactory(Rocket);
     53    RegisterClass(Rocket);
    5454
    5555    /**
     
    5757        Constructor. Registers the object and initializes some default values.
    5858    */
    59     Rocket::Rocket(BaseObject* creator)
    60         : ControllableEntity(creator)
     59    Rocket::Rocket(Context* context)
     60        : ControllableEntity(context)
    6161        , BasicProjectile()
    62         , RadarViewable(creator, static_cast<WorldEntity*>(this))
     62        , RadarViewable(this, static_cast<WorldEntity*>(this))
    6363    {
    6464        RegisterObject(Rocket);// Register the Rocket class to the core
     
    7373
    7474            // Create rocket model
    75             Model* model = new Model(this);
     75            Model* model = new Model(this->getContext());
    7676            model->setMeshSource("rocket.mesh");
    7777            model->scale(0.7f);
     
    7979
    8080            // Add effects.
    81             ParticleEmitter* fire = new ParticleEmitter(this);
     81            ParticleEmitter* fire = new ParticleEmitter(this->getContext());
    8282            this->attach(fire);
    8383            fire->setOrientation(this->getOrientation());
     
    8989
    9090            // Add collision shape
    91             ConeCollisionShape* collisionShape = new ConeCollisionShape(this);
     91            ConeCollisionShape* collisionShape = new ConeCollisionShape(this->getContext());
    9292            collisionShape->setRadius(3);
    9393            collisionShape->setHeight(500);
     
    9797
    9898            // Add sound
    99             this->defSndWpnEngine_ = new WorldSound(this);
     99            this->defSndWpnEngine_ = new WorldSound(this->getContext());
    100100            this->defSndWpnEngine_->setLooping(true);
    101101            this->defSndWpnEngine_->setSource("sounds/Rocket_engine.ogg");
     
    103103            this->attach(defSndWpnEngine_);
    104104
    105             this->defSndWpnLaunch_ = new WorldSound(this);
     105            this->defSndWpnLaunch_ = new WorldSound(this->getContext());
    106106            this->defSndWpnLaunch_->setLooping(false);
    107107            this->defSndWpnLaunch_->setSource("sounds/Rocket_launch.ogg");
     
    116116
    117117        // Add camera
    118         CameraPosition* camPosition = new CameraPosition(this);
     118        CameraPosition* camPosition = new CameraPosition(this->getContext());
    119119        camPosition->setPosition(0,4,15);
    120120        camPosition->setAllowMouseLook(true);
     
    226226        if(this->getShooter())
    227227        {
    228             effect1 = new ParticleSpawner(this->getShooter()->getCreator());
    229             effect2 = new ParticleSpawner(this->getShooter()->getCreator());
     228            effect1 = new ParticleSpawner(this->getShooter()->getContext());
     229            effect2 = new ParticleSpawner(this->getShooter()->getContext());
    230230        }
    231231        else
    232232        {
    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());
    235235        }
    236236
  • code/trunk/src/modules/weapons/projectiles/Rocket.h

    r9016 r9667  
    5959    {
    6060        public:
    61             Rocket(BaseObject* creator);
     61            Rocket(Context* context);
    6262            virtual ~Rocket();
    6363
  • code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc

    r8859 r9667  
    5252namespace orxonox
    5353{
    54     CreateFactory(SimpleRocket);
     54    RegisterClass(SimpleRocket);
    5555
    5656    const float SimpleRocket::FUEL_PERCENTAGE = 0.8f;
    5757
    58     SimpleRocket::SimpleRocket(BaseObject* creator)
    59         : ControllableEntity(creator)
     58    SimpleRocket::SimpleRocket(Context* context)
     59        : ControllableEntity(context)
    6060        , BasicProjectile()
    61         , RadarViewable(creator, static_cast<WorldEntity*>(this))
     61        , RadarViewable(this, static_cast<WorldEntity*>(this))
    6262    {
    6363        RegisterObject(SimpleRocket);// Register the SimpleRocket class to the core
     
    7474
    7575            // Create rocket model.
    76             Model* model = new Model(this);
     76            Model* model = new Model(this->getContext());
    7777            model->setMeshSource("rocket.mesh");
    7878            model->scale(0.7f);
     
    8080
    8181            // Add effects.
    82             this->fire_ = new ParticleEmitter(this);
     82            this->fire_ = new ParticleEmitter(this->getContext());
    8383            this->attach(this->fire_);
    8484
     
    9191            // Add collision shape.
    9292            // 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());
    9494            collisionShape->setOrientation(this->getOrientation());
    9595            collisionShape->setRadius(1.5f);
  • code/trunk/src/modules/weapons/projectiles/SimpleRocket.h

    r8859 r9667  
    6060    {
    6161        public:
    62             SimpleRocket(BaseObject* creator);
     62            SimpleRocket(Context* context);
    6363            virtual ~SimpleRocket();
    6464            virtual void tick(float dt);
Note: See TracChangeset for help on using the changeset viewer.