- Timestamp:
- Jun 9, 2010, 9:32:58 PM (15 years ago)
- Location:
- code/branches/presentation3/src/modules/weapons/projectiles
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/src/modules/weapons/projectiles/Rocket.cc
r7018 r7127 167 167 this->localAngularVelocity_ = 0; 168 168 } 169 169 170 170 if( GameMode::isMaster() ) 171 171 { 172 172 if( this->bDestroy_ ) 173 173 this->destroy(); 174 174 175 175 } 176 176 } -
code/branches/presentation3/src/modules/weapons/projectiles/SimpleRocket.cc
r7025 r7127 71 71 this->fire_ = new ParticleEmitter(this); 72 72 this->attach(this->fire_); 73 73 74 74 this->fire_->setOrientation(this->getOrientation()); 75 75 this->fire_->setSource("Orxonox/simplerocketfire"); … … 90 90 91 91 92 92 93 93 /** 94 94 * @brief updates state of rocket, disables fire if no fuel … … 107 107 this->localAngularVelocity_ = 0; 108 108 109 109 110 110 if (this->fuel_) 111 111 { 112 if (this->destroyTimer_.getRemainingTime()< (static_cast<float>(this->FUEL_PERCENTAGE)/100) *this->lifetime_ ) 112 if (this->destroyTimer_.getRemainingTime()< (static_cast<float>(this->FUEL_PERCENTAGE)/100) *this->lifetime_ ) 113 113 this->fuel_=false; 114 114 } else 115 115 this->disableFire(); 116 116 117 if( this->bDestroy_ ) 117 if( this->bDestroy_ ) 118 118 this->destroy(); 119 119 } 120 120 121 121 } 122 122 … … 127 127 void SimpleRocket::disableFire() 128 128 { 129 this->setAcceleration(0,0,0); 129 this->setAcceleration(0,0,0); 130 130 this->fire_->detachFromParent(); 131 131 } … … 137 137 SimpleRocket::~SimpleRocket() 138 138 { 139 if (this->isInitialized()) 139 if (this->isInitialized()) 140 140 { 141 141 if( GameMode::isMaster() ) -
code/branches/presentation3/src/modules/weapons/projectiles/SimpleRocket.h
r7095 r7127 98 98 */ 99 99 inline void rotatePitch(float value) 100 { 100 { 101 101 this->rotatePitch(Vector2(value, 0)); } 102 102 /** … … 105 105 */ 106 106 inline void rotateRoll(float value) 107 { 107 { 108 108 this->rotateRoll(Vector2(value, 0)); } 109 109 … … 124 124 Vector3 localAngularVelocity_; 125 125 float damage_; 126 bool bDestroy_; 126 bool bDestroy_; 127 127 bool fuel_; //!< Bool is true while the rocket "has fuel" 128 128
Note: See TracChangeset
for help on using the changeset viewer.