[Orxonox-commit 3909] r8583 - code/branches/presentation/src/orxonox/worldentities/pawns

dafrick at orxonox.net dafrick at orxonox.net
Wed May 25 22:52:37 CEST 2011


Author: dafrick
Date: 2011-05-25 22:52:36 +0200 (Wed, 25 May 2011)
New Revision: 8583

Modified:
   code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc
Log:
Fixing possible bug.


Modified: code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc	2011-05-25 20:10:09 UTC (rev 8582)
+++ code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc	2011-05-25 20:52:36 UTC (rev 8583)
@@ -261,18 +261,18 @@
     void SpaceShip::shakeCamera(float dt)
     {
         //make sure the ship is only shaking if it's moving
-        if (this->getVelocity().squaredLength() > 80)
+        if (this->getVelocity().squaredLength() > 80.0f)
         {
             this->shakeDt_ += dt;
     
-            int frequency = this->shakeFrequency_ * (this->getVelocity().squaredLength());
+            float frequency = this->shakeFrequency_ * (this->getVelocity().squaredLength());
     
-            if (this->shakeDt_ >= 1 /(frequency))
+            if (this->shakeDt_ >= 1.0f/frequency)
             {
-                this->shakeDt_ -= 1/(frequency);
+                this->shakeDt_ -= 1.0f/frequency;
             }
     
-            Degree angle = Degree(sin(this->shakeDt_ * 2* math::pi * frequency) * this->shakeAmplitude_);
+            Degree angle = Degree(sin(this->shakeDt_ *2.0f* math::pi * frequency) * this->shakeAmplitude_);
     
             //COUT(0) << "Angle: " << angle << std::endl;
             Camera* camera = this->getCamera();




More information about the Orxonox-commit mailing list