Changeset 7127 for code/branches/presentation3/src/modules/weapons
- Timestamp:
- Jun 9, 2010, 9:32:58 PM (15 years ago)
- Location:
- code/branches/presentation3/src/modules/weapons
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/src/modules/weapons/RocketController.cc
r7021 r7127 28 28 29 29 #include "RocketController.h" 30 #include "projectiles/SimpleRocket.h" 30 #include "projectiles/SimpleRocket.h" 31 31 #include "util/Math.h" 32 32 #include "weapons/projectiles/SimpleRocket.h" … … 66 66 this->moveToTargetPosition(); 67 67 } 68 69 68 69 70 70 } 71 71 … … 102 102 103 103 104 if (distance > 1000 && this->rocket_->getVelocity().squaredLength()<160000) 104 if (distance > 1000 && this->rocket_->getVelocity().squaredLength()<160000) 105 105 this->rocket_->setAcceleration(this->rocket_->getOrientation()*Vector3(-20,-20,-20)); 106 106 if (distance <1000) this->rocket_->setAcceleration(0,0,0); -
code/branches/presentation3/src/modules/weapons/RocketController.h
r7039 r7127 50 50 RocketController(BaseObject* creator); 51 51 virtual ~RocketController(); 52 52 53 53 virtual void tick(float dt); 54 54 SimpleRocket* getRocket() const … … 64 64 Vector3 targetPosition_; 65 65 WeakPtr<PlayerInfo> player_; 66 66 67 67 WeakPtr<WorldEntity> target_; 68 68 -
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 -
code/branches/presentation3/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
r7095 r7127 54 54 55 55 this->setMunitionName("TargetSeeking Rockets"); 56 this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.4); 56 this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.4); 57 57 // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning) 58 58 }
Note: See TracChangeset
for help on using the changeset viewer.