Changeset 8658
- Timestamp:
- May 29, 2011, 1:40:53 PM (13 years ago)
- Location:
- code/branches/presentation/src/orxonox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/orxonox/items/Engine.cc
r8654 r8658 158 158 SUPER(Engine, tick, dt); 159 159 160 const Vector3& direction = this->getDirection(); 160 Vector3 direction = this->getDirection(); 161 float directionLength = direction.length(); 162 if (directionLength > 1.0f) 163 direction /= directionLength; // normalize 164 161 165 Vector3 velocity = this->ship_->getLocalVelocity(); 162 166 Vector3 acceleration = Vector3::ZERO; -
code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc
r8651 r8658 224 224 { 225 225 this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() - value.x); 226 this->steering_.z = -value.x;226 this->steering_.z -= value.x; 227 227 } 228 228 … … 230 230 { 231 231 this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() + value.x); 232 this->steering_.x = value.x;232 this->steering_.x += value.x; 233 233 } 234 234 … … 236 236 { 237 237 this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() + value.x); 238 this->steering_.y = value.x;238 this->steering_.y += value.x; 239 239 } 240 240 … … 244 244 245 245 Pawn::rotateYaw(value); 246 247 //This function call adds a lift to the ship when it is rotating to make it's movement more "realistic" and enhance the feeling. 248 if (abs(this-> getLocalVelocity().z) < stallSpeed_) {this->moveRightLeft(-lift_ / 5 * value * sqrt(abs(this-> getLocalVelocity().z)));} 246 249 } 247 250
Note: See TracChangeset
for help on using the changeset viewer.