Changeset 8595
- Timestamp:
- May 26, 2011, 2:02:05 PM (14 years ago)
- Location:
- code/branches/steering/src/orxonox/worldentities/pawns
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/steering/src/orxonox/worldentities/pawns/SpaceShip.cc
r8545 r8595 54 54 this->localLinearAcceleration_.setValue(0, 0, 0); 55 55 this->localAngularAcceleration_.setValue(0, 0, 0); 56 56 this->bBoost_ = false; 57 57 this->steering_ = Vector3::ZERO; 58 58 this->engine_ = 0; … … 65 65 this->bBoostCooldown_ = false; 66 66 67 68 67 this->lift_ = 1.0f; // factor of the lift, standard is 1 68 this->stallSpeed_ = 220.0f; // max speed where lift is added 69 69 70 70 this->bInvertYAxis_ = false; … … 83 83 84 84 85 85 86 86 } 87 87 … … 104 104 XMLPortParamVariable(SpaceShip, "boostRate", boostRate_, xmlelement, mode); 105 105 XMLPortParamVariable(SpaceShip, "boostCooldownDuration", boostCooldownDuration_, xmlelement, mode); 106 107 106 XMLPortParamVariable(SpaceShip, "lift", lift_, xmlelement, mode); 107 XMLPortParamVariable(SpaceShip, "stallSpeed", stallSpeed_, xmlelement, mode); 108 108 } 109 109 … … 174 174 } 175 175 } 176 176 177 177 } 178 178 } … … 202 202 this->steering_.y = value.x; 203 203 204 205 206 207 208 204 } 209 205 … … 221 217 222 218 Pawn::rotatePitch(value); 223 224 219 225 220 //This function call adds a lift to the ship when it is pitching to make it's movement more "realistic" and enhance the feeling. 226 221 if (abs(this-> getLocalVelocity().z) < stallSpeed_) {this->moveUpDown(lift_ / 5 * value * sqrt(abs(this-> getLocalVelocity().z)));} 227 228 229 230 222 231 223 } -
code/branches/steering/src/orxonox/worldentities/pawns/SpaceShip.h
r8430 r8595 89 89 float boostPowerRate_; 90 90 float boostCooldownDuration_; 91 92 91 float lift_; 92 float stallSpeed_; 93 93 Vector3 steering_; 94 94 float primaryThrust_; … … 98 98 btVector3 localAngularAcceleration_; 99 99 100 100 101 101 102 102 private:
Note: See TracChangeset
for help on using the changeset viewer.