- Timestamp:
- May 26, 2011, 2:29:03 PM (13 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation
- Property svn:mergeinfo changed
/code/branches/steering merged: 8430-8431,8545,8595
- Property svn:mergeinfo changed
-
code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc
r8589 r8597 36 36 #include "core/XMLPort.h" 37 37 #include "tools/Shader.h" 38 #include "util/Debug.h" // TODO: Needed? 38 39 #include "util/Math.h" 39 40 … … 68 69 this->boostCooldownDuration_ = 5.0; 69 70 this->bBoostCooldown_ = false; 71 72 this->lift_ = 1.0f; // factor of the lift, standard is 1 73 this->stallSpeed_ = 220.0f; // max speed where lift is added 70 74 71 75 this->bInvertYAxis_ = false; … … 116 120 XMLPortParamVariable(SpaceShip, "shakeFrequency", shakeFrequency_, xmlelement, mode); 117 121 XMLPortParamVariable(SpaceShip, "shakeAmplitude", shakeAmplitude_, xmlelement, mode); 122 XMLPortParamVariable(SpaceShip, "lift", lift_, xmlelement, mode); 123 XMLPortParamVariable(SpaceShip, "stallSpeed", stallSpeed_, xmlelement, mode); 118 124 119 125 XMLPortObject(SpaceShip, Engine, "engines", addEngine, getEngine, xmlelement, mode); … … 132 138 registerVariable(this->shakeFrequency_, VariableDirection::ToClient); 133 139 registerVariable(this->shakeAmplitude_, VariableDirection::ToClient); 140 registerVariable(this->lift_, VariableDirection::ToClient); 141 registerVariable(this->stallSpeed_, VariableDirection::ToClient); 134 142 } 135 143 … … 240 248 void SpaceShip::rotatePitch(const Vector2& value) 241 249 { 242 this->localAngularAcceleration_.setX(this->localAngularAcceleration_.x() + value.x );250 this->localAngularAcceleration_.setX(this->localAngularAcceleration_.x() + value.x*0.8); 243 251 244 252 Pawn::rotatePitch(value); 253 254 //This function call adds a lift to the ship when it is pitching to make it's movement more "realistic" and enhance the feeling. 255 if (abs(this-> getLocalVelocity().z) < stallSpeed_) {this->moveUpDown(lift_ / 5 * value * sqrt(abs(this-> getLocalVelocity().z)));} 245 256 } 246 257
Note: See TracChangeset
for help on using the changeset viewer.