Changeset 8597 for code/branches/presentation/src/orxonox
- Timestamp:
- May 26, 2011, 2:29:03 PM (14 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 4 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/MobileEntity.cc
r8589 r8597 83 83 this->linearVelocity_.z += this->linearAcceleration_.z * dt; 84 84 this->node_->translate(this->linearVelocity_ * dt); 85 86 85 87 86 88 // Angular part -
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 -
code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.h
r8594 r8597 98 98 float boostPowerRate_; 99 99 float boostCooldownDuration_; 100 float lift_; 101 float stallSpeed_; 100 102 Vector3 steering_; 101 103 float primaryThrust_;
Note: See TracChangeset
for help on using the changeset viewer.