Changeset 7154 for code/branches/presentation3
- Timestamp:
- Jul 12, 2010, 2:06:15 PM (14 years ago)
- Location:
- code/branches/presentation3/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/src/modules/weapons/projectiles/Rocket.cc
r7127 r7154 41 41 #include "controllers/Controller.h" 42 42 #include "sound/WorldSound.h" 43 #include "Scene.h" 43 44 44 45 namespace orxonox … … 116 117 if(this->isInitialized()) 117 118 { 118 if (GameMode::isMaster() && this->player_) 119 this->player_->stopTemporaryControl(); 119 if (GameMode::isMaster()) 120 { 121 this->destructionEffect(); 122 123 if (this->getPlayer() && this->getController()) 124 this->player_->stopTemporaryControl(); 125 } 120 126 121 127 if ( this->defSndWpnEngine_ ) … … 140 146 { 141 147 this->owner_ = owner; 142 this->originalControllableEntity_ = this->owner_->getPlayer()->getControllableEntity();143 148 this->player_ = this->owner_->getPlayer(); 144 149 this->owner_->getPlayer()->startTemporaryControl(this); … … 228 233 void Rocket::fired(unsigned int firemode) 229 234 { 230 if (this->owner_) 231 { 232 { 233 ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator()); 234 effect->setPosition(this->getPosition()); 235 effect->setOrientation(this->getOrientation()); 236 effect->setDestroyAfterLife(true); 237 effect->setSource("Orxonox/explosion4"); 238 effect->setLifetime(2.0f); 239 } 240 241 { 242 ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator()); 243 effect->setPosition(this->getPosition()); 244 effect->setOrientation(this->getOrientation()); 245 effect->setDestroyAfterLife(true); 246 effect->setSource("Orxonox/smoke4"); 247 effect->setLifetime(3.0f); 248 } 235 // if (this->owner_) 236 // { 249 237 this->destroy(); 250 } 238 // } 239 } 240 241 void Rocket::destructionEffect() 242 { 243 ParticleSpawner *effect1, *effect2; 244 if( this->owner_ ) 245 { 246 effect1 = new ParticleSpawner(this->owner_->getCreator()); 247 effect2 = new ParticleSpawner(this->owner_->getCreator()); 248 } 249 else 250 { 251 effect1 = new ParticleSpawner(static_cast<BaseObject*>(this->getScene().get())); 252 effect2 = new ParticleSpawner(static_cast<BaseObject*>(this->getScene().get())); 253 } 254 255 effect1->setPosition(this->getPosition()); 256 effect1->setOrientation(this->getOrientation()); 257 effect1->setDestroyAfterLife(true); 258 effect1->setSource("Orxonox/explosion4"); 259 effect1->setLifetime(2.0f); 260 261 effect2->setPosition(this->getPosition()); 262 effect2->setOrientation(this->getOrientation()); 263 effect2->setDestroyAfterLife(true); 264 effect2->setSource("Orxonox/smoke4"); 265 effect2->setLifetime(3.0f); 251 266 } 252 267 -
code/branches/presentation3/src/modules/weapons/projectiles/Rocket.h
r6417 r7154 57 57 virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint); 58 58 void destroyObject(); 59 void destructionEffect(); 59 60 60 61 virtual void moveFrontBack(const Vector2& value){} … … 119 120 float damage_; 120 121 bool bDestroy_; 121 ControllableEntity* originalControllableEntity_;122 122 123 123 WeakPtr<PlayerInfo> player_; -
code/branches/presentation3/src/modules/weapons/weaponmodes/RocketFire.cc
r7153 r7154 66 66 rocket->setOrientation(this->getMuzzleOrientation()); 67 67 rocket->setPosition(this->getMuzzlePosition()); 68 // rocket->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_); 69 rocket->setVelocity(Vector3(1,0,0)); 68 rocket->setVelocity(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity() + this->getMuzzleDirection() * this->speed_); 70 69 rocket->scale(2); 71 70 -
code/branches/presentation3/src/orxonox/infos/PlayerInfo.cc
r6417 r7154 177 177 return; 178 178 179 // assert( this->temporaryControllableEntity_==0 );179 assert( this->oldControllableEntity_==0 ); 180 180 181 181 this->oldControllableEntity_ = this->controllableEntity_; … … 184 184 185 185 entity->setPlayer(this); 186 entity->setController(this->controller_); 186 187 187 188 if (this->controller_) … … 222 223 return; 223 224 225 this->controllableEntity_->setController(0); 226 224 227 this->controllableEntity_ = this->oldControllableEntity_; 225 228 this->controllableEntityID_ = this->controllableEntity_->getObjectID();
Note: See TracChangeset
for help on using the changeset viewer.