Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6079 for code/branches


Ignore:
Timestamp:
Nov 17, 2009, 10:59:25 AM (15 years ago)
Author:
scheusso
Message:

trying to make CE change possible

Location:
code/branches/particles2/src/modules/weapons/projectiles
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/particles2/src/modules/weapons/projectiles/Rocket.cc

    r6066 r6079  
    3535#include "graphics/Model.h"
    3636#include "objects/collisionshapes/ConeCollisionShape.h"
     37#include "infos/PlayerInfo.h"
     38#include "controllers/Controller.h"
     39#include "worldentities/CameraPosition.h"
    3740
    3841namespace orxonox
     
    6972            this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&Rocket::destroyObject, this)));
    7073        }
     74       
     75        this->camPosition_ = new CameraPosition(this);
     76        this->camPosition_->setPosition(0,0,0);
     77        this->attach( this->camPosition_ );
     78        this->addCameraPosition( this->camPosition_ );
    7179    }
    7280
     
    8189            this->collisionShape_->destroy();
    8290            this->model_->destroy();
     91           
     92            if (GameMode::isMaster() && this->owner_)
     93                this->owner_->getPlayer()->startControl(this->originalControllableEntity_);
     94            this->camPosition_->destroy();
    8395        }
    8496    }
     
    97109    {
    98110        this->owner_ = owner;
     111           
     112        this->originalControllableEntity_ = this->owner_->getPlayer()->getControllableEntity();
     113        this->owner_->getPlayer()->startControl(this);
    99114    }
    100115
  • code/branches/particles2/src/modules/weapons/projectiles/Rocket.h

    r6066 r6079  
    110110            inline float getDamage() const
    111111                { return this->damage_; }
     112            virtual void fire(unsigned int firemode) {}
    112113           
    113114        private:
     
    116117            float damage_;
    117118            bool bDestroy_;
     119            ControllableEntity* originalControllableEntity_;
    118120           
    119121            Model* model_;
     122            CameraPosition* camPosition_;
    120123            ConeCollisionShape* collisionShape_;
    121124            Timer destroyTimer_;
Note: See TracChangeset for help on using the changeset viewer.