Changeset 6167 for code/branches
- Timestamp:
- Nov 26, 2009, 7:41:49 PM (15 years ago)
- Location:
- code/branches/presentation2/src/modules/weapons/projectiles
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/modules/weapons/projectiles/Rocket.cc
r6120 r6167 61 61 this->bDestroy_ = false; 62 62 63 this->model_= new Model(this);64 this->model_->setMeshSource("rocket.mesh");65 this->attach( this->model_);66 Particle Spawner* fire = new ParticleSpawner(this);63 Model* model = new Model(this); 64 model->setMeshSource("rocket.mesh"); 65 this->attach(model); 66 ParticleEmitter* fire = new ParticleEmitter(this); 67 67 this->attach(fire); 68 68 fire->setOrientation(this->getOrientation()); … … 73 73 this->setCollisionType(Kinematic); 74 74 75 this->collisionShape_= new ConeCollisionShape(this);76 this->collisionShape_->setRadius(3);77 this->collisionShape_->setHeight(500);78 this->attachCollisionShape( this->collisionShape_);75 ConeCollisionShape* collisionShape = new ConeCollisionShape(this); 76 collisionShape->setRadius(3); 77 collisionShape->setHeight(500); 78 this->attachCollisionShape(collisionShape); 79 79 80 80 this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&Rocket::destroyObject, this))); 81 81 } 82 82 83 this->camPosition_ = new CameraPosition(this); 84 this->camPosition_->setPosition(0,10,40); 85 this->camPosition_->setSyncMode(0x0); 86 this->camPosition_->setAllowMouseLook(true); 87 this->attach( this->camPosition_ ); 88 this->addCameraPosition( this->camPosition_ ); 83 CameraPosition* camPosition = new CameraPosition(this); 84 camPosition->setPosition(0,10,40); 85 camPosition->setAllowMouseLook(true); 86 this->addCameraPosition(camPosition); 89 87 } 90 88 … … 97 95 if(this->isInitialized()) 98 96 { 99 if (GameMode::isMaster() && this->player_.get()) 100 { 101 this->model_->destroy(); 102 this->collisionShape_->destroy(); 97 if (GameMode::isMaster() && this->player_) 103 98 this->player_->stopTemporaryControl(); 104 }105 this->camPosition_->destroy();106 99 } 107 100 } -
code/branches/presentation2/src/modules/weapons/projectiles/Rocket.h
r6119 r6167 119 119 ControllableEntity* originalControllableEntity_; 120 120 121 Model* model_;122 CameraPosition* camPosition_;123 ConeCollisionShape* collisionShape_;124 121 WeakPtr<PlayerInfo> player_; 125 122 Timer destroyTimer_;
Note: See TracChangeset
for help on using the changeset viewer.