]> git.uio.no Git - private-olgabo.git/commitdiff
sc
authorolgabo <olgabo@ifi.uio.no>
Thu, 25 Oct 2012 23:24:57 +0000 (01:24 +0200)
committerolgabo <olgabo@ifi.uio.no>
Thu, 25 Oct 2012 23:24:57 +0000 (01:24 +0200)
projects/dumbclient/Game.cpp

index 9c5799189f88496728ecb46ca332fdc01425ed92..a102b16c310638167668bf83dd6b9e28d97e6234 100644 (file)
@@ -878,7 +878,7 @@ bool Game::processAction(const String &an, class Player* player, bool scoreActio
                     if (player == localPlayer || current == localPlayer)
                     {
                         cameraYaw = Degree(-70);
-                        cameraPosNew = cameraNode->getPosition();
+                        cameraPosNew = cameraPos;
                         adjustCamera = true;
                     }
                     if (player == localPlayer)
@@ -968,13 +968,13 @@ bool Game::processAction(const String &an, class Player* player, bool scoreActio
                 gettimeofday(&msgTime, NULL);
                 registerScore(player, current, RPS);
 
-                Vector3 moveCamera = Vector3::ZERO;
-                moveCamera = cameraPos;
-                moveCamera.z += localPlayer->distanceToOtherPlayer/70;
+               
              //   moveCamera.z = (Math::Abs(moveCamera.z) + 4 + localPlayer->distanceToOtherPlayer/70);
               //  moveCamera.x +=  moveCamera.z;
                 if (player == localPlayer || current == localPlayer)
                 {
+                    Vector3 moveCamera = cameraPos;
+                    moveCamera.z += localPlayer->distanceToOtherPlayer/70;
                     cameraPosNew = moveCamera;
                     cameraYaw = Degree(-60);
                     adjustCamera = true;
@@ -1040,7 +1040,7 @@ bool Game::processAction(const String &an, class Player* player, bool scoreActio
                 if (player == localPlayer || current == localPlayer)
                 {
                     cameraYaw = Degree(-30);
-                    cameraPosNew = cameraNode->getPosition();   
+                    cameraPosNew = cameraPos;   
                     adjustCamera = true;
                 }
                 if (player == localPlayer)
@@ -1493,6 +1493,9 @@ void Game::createPlayer(int id)
         if (nickName.length() > 0)
             playerCaption = nickName;
         playerCaption += " (you)";
+
+        cameraPos = cameraNode->getPosition();
+        cameraOrient = cameraNode->getOrientation();
     }
     else
     {