Changeset 8583 for code/branches/presentation
- Timestamp:
- May 25, 2011, 10:52:36 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc
r8582 r8583 262 262 { 263 263 //make sure the ship is only shaking if it's moving 264 if (this->getVelocity().squaredLength() > 80 )264 if (this->getVelocity().squaredLength() > 80.0f) 265 265 { 266 266 this->shakeDt_ += dt; 267 267 268 int frequency = this->shakeFrequency_ * (this->getVelocity().squaredLength());269 270 if (this->shakeDt_ >= 1 /(frequency))271 { 272 this->shakeDt_ -= 1 /(frequency);273 } 274 275 Degree angle = Degree(sin(this->shakeDt_ * 2* math::pi * frequency) * this->shakeAmplitude_);268 float frequency = this->shakeFrequency_ * (this->getVelocity().squaredLength()); 269 270 if (this->shakeDt_ >= 1.0f/frequency) 271 { 272 this->shakeDt_ -= 1.0f/frequency; 273 } 274 275 Degree angle = Degree(sin(this->shakeDt_ *2.0f* math::pi * frequency) * this->shakeAmplitude_); 276 276 277 277 //COUT(0) << "Angle: " << angle << std::endl;
Note: See TracChangeset
for help on using the changeset viewer.