Changeset 6834 for code/branches/rocket/src/modules/weapons/projectiles
- Timestamp:
- May 3, 2010, 1:40:16 PM (15 years ago)
- Location:
- code/branches/rocket/src/modules/weapons/projectiles
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/rocket/src/modules/weapons/projectiles/SimpleRocket.cc
r6827 r6834 60 60 this->lifetime_ = 100; 61 61 COUT(0)<< "simplerocket constructed\n"; 62 //this->camera_ = null; 63 //RocketController* myRController = new RocketController(this); 64 //this->setController(creator); 65 //myRController->setRocket(this, myRController); 66 67 //this->getController()->setControllableEntity(this); 68 //myController->setControllableEntity(this); 69 //this->getController()->setControllableEntity(this); 70 //this->controllableEntity_->setController(this->controller_); 62 71 63 72 64 //if (GameMode::isMaster()) 73 65 //{ 74 /*this->setCollisionType(WorldEntity::Kinematic);75 this->setVelocity(0,0, -100);*/66 this->setCollisionType(WorldEntity::Kinematic); 67 this->setVelocity(0,0,100); 76 68 77 69 Model* model = new Model(this); 78 70 model->setMeshSource("rocket.mesh"); 79 //model->scale(0.7f);71 model->scale(0.7f); 80 72 this->attach(model); 81 /* ParticleEmitter* fire = new ParticleEmitter(this); 73 74 ParticleEmitter* fire = new ParticleEmitter(this); 82 75 this->attach(fire); 83 76 fire->setOrientation(this->getOrientation()); 84 fire->setSource("Orxonox/ Rocketfire");77 fire->setSource("Orxonox/rocketfire2"); 85 78 86 79 this->enableCollisionCallback(); … … 91 84 collisionShape->setRadius(3); 92 85 collisionShape->setHeight(500); 93 this->attachCollisionShape(collisionShape); */86 this->attachCollisionShape(collisionShape); 94 87 95 88 this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&SimpleRocket::destroyObject, this))); … … 127 120 } 128 121 129 /**130 @brief131 Defines which actions the SimpleRocket has to take in each tick.132 @param dt133 The length of the tick.134 */135 void SimpleRocket::tick(float dt)136 {137 SUPER(SimpleRocket, tick, dt);138 139 if( this->hasLocalController() )140 {141 this->setAngularVelocity(this->getOrientation() * this->localAngularVelocity_);142 this->setVelocity( this->getOrientation()*WorldEntity::FRONT*this->getVelocity().length() );143 this->localAngularVelocity_ = 0;144 145 if( this->bDestroy_ )146 this->destroy();147 }148 }149 122 150 123 bool SimpleRocket::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint) -
code/branches/rocket/src/modules/weapons/projectiles/SimpleRocket.h
r6778 r6834 53 53 54 54 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a SimpleRocket through XML. 55 virtual void tick(float dt); //!< Defines which actions the SimpleRocket has to take in each tick.56 55 57 56 virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
Note: See TracChangeset
for help on using the changeset viewer.