diff Game.cpp @ 120:fe0e317c0de0

Camera rotation fixed. Sorta
author Nomad
date Sun, 10 Feb 2013 23:43:28 +0200
parents 2fb33d31ca0d
children 3471df3713e2 eeb0a8222d59 c70fea5013aa
line wrap: on
line diff
--- a/Game.cpp	Sun Feb 10 23:14:42 2013 +0200
+++ b/Game.cpp	Sun Feb 10 23:43:28 2013 +0200
@@ -58,8 +58,10 @@
     uFlags2 |= 2u;
   pIndoorCamera->sRotationX = pParty->sRotationX;
   pIndoorCamera->sRotationY = pParty->sRotationY;
-  pIndoorCamera->pos.x = pParty->vPosition.x - pParty->field_18 * (stru_5C6E00->SinCos(pIndoorCamera->sRotationY) / 2048.0);//12552
-  pIndoorCamera->pos.y = pParty->vPosition.y - pParty->field_18 * (stru_5C6E00->SinCos(pIndoorCamera->sRotationY) / 2048.0);//800
+  //pIndoorCamera->pos.x = pParty->vPosition.x - ((__int64)pParty->y_rotation_granularity * stru_5C6E00->SinCos(pIndoorCamera->sRotationY)) / 2048.0;//12552
+  //pIndoorCamera->pos.y = pParty->vPosition.y - ((__int64)pParty->y_rotation_granularity * stru_5C6E00->SinCos(pIndoorCamera->sRotationY)) / 2048.0;//800
+  pIndoorCamera->pos.x = pParty->vPosition.x - pParty->y_rotation_granularity * cosf(2 * 3.141592653589 * pIndoorCamera->sRotationY / 2048.0);
+  pIndoorCamera->pos.y = pParty->vPosition.y - pParty->y_rotation_granularity * sinf(2 * 3.141592653589 * pIndoorCamera->sRotationY / 2048.0);
   pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel;//193, but real 353
   pIndoorCamera->Initialize2();
   pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff();