Changeset 713
- Timestamp:
- 08/23/07 21:56:54 (16 months ago)
- Location:
- trunk
- Files:
-
- 9 modified
-
common/camera.cpp (modified) (4 diffs)
-
common/lc_application.cpp (modified) (1 diff)
-
common/lc_application.h (modified) (2 diffs)
-
common/lc_camera.cpp (modified) (8 diffs)
-
common/lc_camera.h (modified) (2 diffs)
-
common/project.cpp (modified) (23 diffs)
-
common/project.h (modified) (1 diff)
-
common/terrain.cpp (modified) (1 diff)
-
win/Terrwnd.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/camera.cpp
r673 r713 1 // Camera object.2 3 1 #include "lc_global.h" 4 2 #include <stdlib.h> … … 10 8 #include "file.h" 11 9 #include "camera.h" 12 #include "tr.h"13 10 14 11 #define LC_CAMERA_SAVE_VERSION 6 // LeoCAD 0.73 … … 218 215 // Camera operations 219 216 220 void Camera::Move(unsigned short nTime, bool bAddKey, float dx, float dy, float dz)221 {222 if (IsSide())223 {224 m_Eye[0] += dx;225 m_Eye[1] += dy;226 m_Eye[2] += dz;227 m_Target[0] += dx;228 m_Target[1] += dy;229 m_Target[2] += dz;230 231 ChangeKey(nTime, bAddKey, m_Eye, LC_CK_EYE);232 ChangeKey(nTime, bAddKey, m_Target, LC_CK_TARGET);233 }234 else235 {236 if (IsEyeSelected())237 {238 m_Eye[0] += dx;239 m_Eye[1] += dy;240 m_Eye[2] += dz;241 242 ChangeKey(nTime, bAddKey, m_Eye, LC_CK_EYE);243 }244 245 if (IsTargetSelected())246 {247 m_Target[0] += dx;248 m_Target[1] += dy;249 m_Target[2] += dz;250 251 ChangeKey(nTime, bAddKey, m_Target, LC_CK_TARGET);252 }253 254 // Fix the up vector255 Vector3 upvec(m_Up), sidevec;256 Vector3 frontvec = m_Target - m_Eye;257 sidevec = Cross3(frontvec, upvec);258 upvec = Cross3(sidevec, frontvec);259 m_Up = upvec.Normalize();260 261 ChangeKey(nTime, bAddKey, m_Up, LC_CK_UP);262 }263 }264 265 void Camera::LoadProjection(float fAspect)266 {267 if (m_pTR != NULL)268 m_pTR->BeginTile();269 else270 {271 glMatrixMode(GL_PROJECTION);272 glLoadIdentity();273 274 if (m_nState & LC_CAMERA_ORTHOGRAPHIC)275 {276 float ymax, ymin, xmin, xmax, znear, zfar;277 Vector3 frontvec = m_Target - m_Eye;278 ymax = (frontvec.Length())*sinf(DTOR*m_fovy/2);279 ymin = -ymax;280 xmin = ymin * fAspect;281 xmax = ymax * fAspect;282 znear = m_zNear;283 zfar = m_zFar;284 glOrtho(xmin, xmax, ymin, ymax, znear, zfar);285 }286 else287 {288 gluPerspective(m_fovy, fAspect, m_zNear, m_zFar);289 }290 }291 292 glMatrixMode(GL_MODELVIEW);293 glLoadMatrixf(m_WorldView);294 }295 296 void Camera::DoZoom(int dy, int mouse, unsigned short nTime, bool bAddKey)297 {298 if (m_nState & LC_CAMERA_ORTHOGRAPHIC)299 {300 // TODO: have a different option to change the fov.301 m_fovy += (float)dy/(21-mouse);302 303 if (m_fovy < 0.001f)304 m_fovy = 0.001f;305 else if (m_fovy > 179.999f)306 m_fovy = 179.999f;307 }308 else309 {310 Vector3 frontvec = m_Eye - m_Target;311 frontvec.Normalize();312 frontvec *= 2.0f*dy/(21-mouse);313 314 // TODO: option to move eye, target or both315 m_Eye += frontvec;316 m_Target += frontvec;317 318 ChangeKey(nTime, bAddKey, m_Eye, LC_CK_EYE);319 ChangeKey(nTime, bAddKey, m_Target, LC_CK_TARGET);320 UpdatePosition(nTime);321 }322 }323 324 void Camera::DoPan(int dx, int dy, int mouse, unsigned short nTime, bool bAddKey)325 {326 Vector3 upvec(m_Up), frontvec = m_Eye - m_Target;327 Vector3 sidevec = Cross3(frontvec, upvec);328 sidevec.Normalize();329 sidevec *= 2.0f*dx/(21-mouse);330 upvec.Normalize();331 upvec *= -2.0f*dy/(21-mouse);332 333 m_Eye += upvec + sidevec;334 m_Target += upvec + sidevec;335 336 ChangeKey(nTime, bAddKey, m_Eye, LC_CK_EYE);337 ChangeKey(nTime, bAddKey, m_Target, LC_CK_TARGET);338 UpdatePosition(nTime);339 }340 341 void Camera::DoRotate(int dx, int dy, int mouse, unsigned short nTime, bool bAddKey, float* /*center*/)342 {343 Vector3 Dir = m_Eye - m_Target;344 345 // The X axis of the mouse always corresponds to Z in the world.346 if (dx)347 {348 float AngleX = -2.0f * dx / (21 - mouse) * LC_DTOR;349 Matrix33 RotX = MatrixFromAxisAngle(Vector3(0, 0, 1), AngleX);350 351 Dir = Mul(Dir, RotX);352 m_Up = Mul(m_Up, RotX);353 }354 355 // The Y axis will the side vector of the camera.356 if (dy)357 {358 float AngleY = 2.0f * dy / (21 - mouse) * LC_DTOR;359 Matrix33 RotY = MatrixFromAxisAngle(Vector3(m_WorldView[0][0], m_WorldView[1][0], m_WorldView[2][0]), AngleY);360 361 Dir = Mul(Dir, RotY);362 m_Up = Mul(m_Up, RotY);363 }364 365 m_Eye = m_Target + Dir;366 367 ChangeKey(nTime, bAddKey, m_Eye, LC_CK_EYE);368 ChangeKey(nTime, bAddKey, m_Up, LC_CK_UP);369 UpdatePosition(nTime);370 }371 372 217 void Camera::DoRoll(int dx, int mouse, unsigned short nTime, bool bAddKey) 373 218 { … … 466 311 UpdatePosition(nTime); 467 312 } 468 469 void Camera::StartTiledRendering(int tw, int th, int iw, int ih, float fAspect)470 {471 m_pTR = new TiledRender();472 m_pTR->TileSize(tw, th, 0);473 m_pTR->ImageSize(iw, ih);474 m_pTR->Perspective(m_fovy, fAspect, m_zNear, m_zFar);475 }476 477 void Camera::GetTileInfo(int* row, int* col, int* width, int* height)478 {479 if (m_pTR != NULL)480 {481 *row = m_pTR->m_Rows - m_pTR->m_CurrentRow - 1;482 *col = m_pTR->m_CurrentColumn;483 *width = m_pTR->m_CurrentTileWidth;484 *height = m_pTR->m_CurrentTileHeight;485 }486 }487 488 bool Camera::EndTile()489 {490 if (m_pTR != NULL)491 {492 if (m_pTR->EndTile())493 return true;494 495 delete m_pTR;496 m_pTR = NULL;497 }498 499 return false;500 } -
trunk/common/lc_application.cpp
r683 r713 36 36 m_ActiveProject = NULL; 37 37 m_Library = NULL; 38 m_MouseSensitivity = Sys_ProfileLoadInt("Default", "Mouse", 11); 38 39 } 39 40 -
trunk/common/lc_application.h
r663 r713 7 7 class PiecesLibrary; 8 8 class PiecePreview; 9 10 #define LC_MAX_MOUSE_SENSITIVITY 20 9 11 10 12 class lcApplication … … 39 41 public: 40 42 PiecePreview* m_PiecePreview; 43 int m_MouseSensitivity; 41 44 42 45 protected: -
trunk/common/lc_camera.cpp
r709 r713 4 4 5 5 #include "lc_colors.h" 6 #include "lc_application.h" 6 7 #include "opengl.h" 7 8 … … 232 233 } 233 234 234 void lcCamera::SetRoll(u32 Time, bool AddKey, constfloat NewRoll)235 void lcCamera::SetRoll(u32 Time, bool AddKey, float NewRoll) 235 236 { 236 237 ChangeKey(Time, AddKey, LC_CAMERA_ROLL, NewRoll); 237 238 } 238 239 239 void lcCamera::Roll(u32 Time, bool AddKey, float MouseX, float MouseY) 240 { 241 float NewRoll = m_Roll + MouseX / 100; 240 void lcCamera::Roll(u32 Time, bool AddKey, int MouseX, int MouseY) 241 { 242 float Sensitivity = 2.0f / (LC_MAX_MOUSE_SENSITIVITY+1 - g_App->m_MouseSensitivity); 243 float dx = MouseX * Sensitivity; 244 245 float NewRoll = m_Roll + dx / 100; 242 246 SetRoll(Time, AddKey, NewRoll); 243 247 } 244 248 245 246 247 248 249 250 251 // ============================================================================ 252 // Everything from now on needs to be rewritten 253 254 void lcCamera::Zoom(float MouseY, u32 Time, bool AddKey) 255 { 249 void lcCamera::Zoom(u32 Time, bool AddKey, int MouseX, int MouseY) 250 { 251 float Sensitivity = 2.0f / (LC_MAX_MOUSE_SENSITIVITY+1 - g_App->m_MouseSensitivity); 252 float dy = MouseY * Sensitivity; 253 256 254 if (m_Flags & LC_CAMERA_ORTHOGRAPHIC) 257 255 { 258 256 // TODO: have a different option to change the FOV. 259 m_FOV += MouseY;257 m_FOV += dy; 260 258 m_FOV = lcClamp(m_FOV, 0.001f, 179.999f); 261 259 } 262 260 else 263 261 { 264 Vector3 Delta = Vector3(m_ViewWorld[2]) * MouseY;262 Vector3 Delta = Vector3(m_ViewWorld[2]) * dy; 265 263 266 264 // TODO: option to move eye, target or both … … 272 270 } 273 271 274 void lcCamera::Pan(float MouseX, float MouseY, u32 Time, bool AddKey) 275 { 276 Vector3 Delta = Vector3(m_ViewWorld[0]) * -MouseX + Vector3(m_ViewWorld[1]) * -MouseY; 272 void lcCamera::Pan(u32 Time, bool AddKey, int MouseX, int MouseY) 273 { 274 float Sensitivity = 2.0f / (LC_MAX_MOUSE_SENSITIVITY+1 - g_App->m_MouseSensitivity); 275 float dx = MouseX * Sensitivity; 276 float dy = MouseY * Sensitivity; 277 278 Vector3 Delta = Vector3(m_ViewWorld[0]) * -dx + Vector3(m_ViewWorld[1]) * -dy; 277 279 278 280 if (m_Children) … … 282 284 } 283 285 284 void lcCamera::Orbit(float MouseX, float MouseY, u32 Time, bool AddKey) 285 { 286 void lcCamera::Orbit(u32 Time, bool AddKey, int MouseX, int MouseY) 287 { 288 float Sensitivity = 2.0f / (LC_MAX_MOUSE_SENSITIVITY+1 - g_App->m_MouseSensitivity); 289 float dx = MouseX * Sensitivity; 290 float dy = MouseY * Sensitivity; 291 286 292 Vector3 Dir = m_WorldPosition - m_Children->m_WorldPosition; 287 293 288 294 // The X axis of the mouse always corresponds to Z in the world. 289 if (fabsf( MouseX) > 0.01f)290 { 291 float AngleX = - MouseX* LC_DTOR;295 if (fabsf(dx) > 0.01f) 296 { 297 float AngleX = -dx * LC_DTOR; 292 298 Matrix33 RotX = MatrixFromAxisAngle(Vector4(0, 0, 1, AngleX)); 293 299 … … 296 302 297 303 // The Y axis will the side vector of the camera. 298 if (fabsf( MouseY) > 0.01f)299 { 300 float AngleY = MouseY* LC_DTOR;304 if (fabsf(dy) > 0.01f) 305 { 306 float AngleY = dy * LC_DTOR; 301 307 Matrix33 RotY = MatrixFromAxisAngle(Vector4(m_WorldView[0][0], m_WorldView[1][0], m_WorldView[2][0], AngleY)); 302 308 … … 307 313 } 308 314 309 void lcCamera::Rotate(float MouseX, float MouseY, u32 Time, bool AddKey) 310 { 315 void lcCamera::Rotate(u32 Time, bool AddKey, int MouseX, int MouseY) 316 { 317 float Sensitivity = 2.0f / (LC_MAX_MOUSE_SENSITIVITY+1 - g_App->m_MouseSensitivity); 318 float dx = MouseX * Sensitivity; 319 float dy = MouseY * Sensitivity; 320 311 321 Vector3 Dir = m_Children->m_WorldPosition - m_WorldPosition; 312 322 313 323 // The X axis of the mouse always corresponds to Z in the world. 314 if (fabsf( MouseX) > 0.01f)315 { 316 float AngleX = - MouseX* LC_DTOR;324 if (fabsf(dx) > 0.01f) 325 { 326 float AngleX = -dx * LC_DTOR; 317 327 Matrix33 RotX = MatrixFromAxisAngle(Vector4(0, 0, 1, AngleX)); 318 328 … … 321 331 322 332 // The Y axis will the side vector of the camera. 323 if (fabsf( MouseY) > 0.01f)324 { 325 float AngleY = MouseY* LC_DTOR;333 if (fabsf(dy) > 0.01f) 334 { 335 float AngleY = dy * LC_DTOR; 326 336 Matrix33 RotY = MatrixFromAxisAngle(Vector4(m_WorldView[0][0], m_WorldView[1][0], m_WorldView[2][0], AngleY)); 327 337 … … 331 341 m_Children->SetPosition(Time, AddKey, Dir + m_ParentPosition); 332 342 } 333 334 // FIXME: Move this to the View class, or remove.335 void lcCamera::GetFrustumPlanes(float Aspect, Vector4 Planes[6]) const336 {337 Matrix44 Projection = CreatePerspectiveMatrix(m_FOV, Aspect, m_NearDist, m_FarDist);338 ::GetFrustumPlanes(m_WorldView, Projection, Planes);339 }340 341 void lcCamera::LoadProjection(float Aspect)342 {343 glMatrixMode(GL_PROJECTION);344 glLoadIdentity();345 346 if (IsOrtho())347 {348 float ymax, ymin, xmin, xmax, znear, zfar;349 Vector3 frontvec = Vector3(m_ViewWorld[2]);//m_Target - m_Eye; // FIXME: free ortho cameras = crash350 ymax = (frontvec.Length())*sinf(DTOR*m_FOV/2);351 ymin = -ymax;352 xmin = ymin * Aspect;353 xmax = ymax * Aspect;354 znear = m_NearDist;355 zfar = m_FarDist;356 glOrtho(xmin, xmax, ymin, ymax, znear, zfar);357 }358 else359 {360 gluPerspective(m_FOV, Aspect, m_NearDist, m_FarDist);361 }362 363 glMatrixMode(GL_MODELVIEW);364 glLoadMatrixf(m_WorldView);365 } -
trunk/common/lc_camera.h
r681 r713 61 61 } 62 62 63 // FIXME: remove IsSide 64 bool IsSide() const 65 { return m_CameraType < LC_CAMERA_MAIN; } 66 63 67 // Change the roll value. 64 void SetRoll(u32 Time, bool AddKey, constfloat NewRoll);68 void SetRoll(u32 Time, bool AddKey, float NewRoll); 65 69 66 // Move the camera along its Z direction.67 void Zoom( float MouseY, u32 Time, bool AddKey);70 // Move the camera along its Z axis. 71 void Zoom(u32 Time, bool AddKey, int MouseX, int MouseY); 68 72 69 73 // Move the camera along its XY plane. 70 void Pan( float MouseX, float MouseY, u32 Time, bool AddKey);74 void Pan(u32 Time, bool AddKey, int MouseX, int MouseY); 71 75 72 76 // Rotate the camera around its target. 73 void Orbit( float MouseX, float MouseY, u32 Time, bool AddKey);77 void Orbit(u32 Time, bool AddKey, int MouseX, int MouseY); 74 78 75 79 // Rotate the target around the camera. 76 void Rotate( float MouseX, float MouseY, u32 Time, bool AddKey);80 void Rotate(u32 Time, bool AddKey, int MouseX, int MouseY); 77 81 78 // Rotate the camera around its Z direction.79 void Roll(u32 Time, bool AddKey, float MouseX, float MouseY);82 // Rotate the camera around its Z axis. 83 void Roll(u32 Time, bool AddKey, int MouseX, int MouseY); 80 84 81 85 // Base class implementation. … … 87 91 // Base class overrides. 88 92 void Move(u32 Time, bool AddKey, const Vector3& Delta); 89 90 // FIXME: Temp functions to get LeoCAD to compile again.91 void LoadProjection(float Aspect);92 void GetFrustumPlanes(float Aspect, Vector4 Planes[6]) const;93 void DoZoom(int dy, int mouse, u32 Time, bool AddKey)94 { Zoom(2.0f*(float)dy/(21-mouse), Time, AddKey); }95 void DoPan(int dx, int dy, int mouse, u32 Time, bool AddKey)96 { Pan(2.0f*dx/(21-mouse), 2.0f*dy/(21-mouse), Time, AddKey); }97 void DoOrbit(int dx, int dy, int mouse, u32 Time, bool AddKey)98 { Orbit(2.0f*dx/(21-mouse), 2.0f*dy/(21-mouse), Time, AddKey); }99 void DoRotate(int dx, int dy, int mouse, u32 Time, bool AddKey)100 { Rotate(2.0f*dx/(21-mouse), 2.0f*dy/(21-mouse), Time, AddKey); }101 void DoRoll(int dx, int mouse, u32 Time, bool AddKey)102 { Roll(Time, AddKey, 2.0f*dx/(21-mouse), 0); }103 bool IsSide() const104 { return m_CameraType < LC_CAMERA_MAIN; }105 93 106 94 public: -
trunk/common/project.cpp
r712 r713 79 79 m_pBackground = new Texture(); 80 80 m_nAutosave = Sys_ProfileLoadInt ("Settings", "Autosave", 10); 81 m_nMouse = Sys_ProfileLoadInt ("Default", "Mouse", 11);82 81 strcpy(m_strModelsPath, Sys_ProfileLoadString ("Default", "Projects", "")); 83 82 … … 5383 5382 { 5384 5383 LC_PREFERENCESDLG_OPTS opts; 5385 opts.nMouse = m_nMouse;5384 opts.nMouse = g_App->m_MouseSensitivity; 5386 5385 opts.nSaveInterval = m_nAutosave; 5387 5386 strcpy(opts.strUser, Sys_ProfileLoadString ("Default", "User", "")); … … 5404 5403 if (SystemDoDialog(LC_DLG_PREFERENCES, &opts)) 5405 5404 { 5406 m_nMouse= opts.nMouse;5405 g_App->m_MouseSensitivity = opts.nMouse; 5407 5406 m_nAutosave = opts.nSaveInterval; 5408 5407 strcpy(m_strModelsPath, opts.strPath); … … 5437 5436 case LC_VIEW_ZOOM: 5438 5437 { 5439 m_ActiveView->GetCamera()-> DoZoom(nParam, m_nMouse, m_ActiveModel->m_CurFrame, m_bAddKeys);5438 m_ActiveView->GetCamera()->Zoom(m_ActiveModel->m_CurFrame, m_bAddKeys, 0, nParam); 5440 5439 SystemUpdateFocus(NULL); 5441 5440 UpdateOverlayScale(); … … 5445 5444 case LC_VIEW_ZOOMIN: 5446 5445 { 5447 m_ActiveView->GetCamera()-> DoZoom(-1, m_nMouse, m_ActiveModel->m_CurFrame, m_bAddKeys);5446 m_ActiveView->GetCamera()->Zoom(m_ActiveModel->m_CurFrame, m_bAddKeys, 0, -1); 5448 5447 SystemUpdateFocus(NULL); 5449 5448 UpdateOverlayScale(); … … 5453 5452 case LC_VIEW_ZOOMOUT: 5454 5453 { 5455 m_ActiveView->GetCamera()-> DoZoom(1, m_nMouse, m_ActiveModel->m_CurFrame, m_bAddKeys);5454 m_ActiveView->GetCamera()->Zoom(m_ActiveModel->m_CurFrame, m_bAddKeys, 0, 1); 5456 5455 SystemUpdateFocus(NULL); 5457 5456 UpdateOverlayScale(); … … 5754 5753 y -= y > 0 ? 5 : -5; 5755 5754 5756 m_ActiveView->GetCamera()-> DoPan(x/4, y/4, 1, m_ActiveModel->m_CurFrame, m_bAddKeys);5755 m_ActiveView->GetCamera()->Pan(m_ActiveModel->m_CurFrame, m_bAddKeys, x/4, y/4); 5757 5756 m_ActiveView->GetCamera()->Update(m_ActiveModel->m_CurFrame); 5758 5757 m_nDownX = x; … … 7789 7788 case LC_ACTION_SPOTLIGHT: 7790 7789 { 7790 /* 7791 // fixme: move this to lc_action_move 7791 7792 float mouse = 10.0f/(21 - m_nMouse); 7792 7793 Vector3 Delta((ptx - m_fTrack[0])*mouse, (pty - m_fTrack[1])*mouse, (ptz - m_fTrack[2])*mouse); … … 7805 7806 SystemUpdateFocus(NULL); 7806 7807 UpdateAllViews(); 7808 */ 7807 7809 } break; 7808 7810 7809 7811 case LC_ACTION_CAMERA: 7810 7812 { 7813 /* 7814 // fixme: move this to lc_action_move 7811 7815 float mouse = 10.0f/(21 - m_nMouse); 7812 7816 Vector3 Delta((ptx - m_fTrack[0])*mouse, (pty - m_fTrack[1])*mouse, (ptz - m_fTrack[2])*mouse); … … 7825 7829 SystemUpdateFocus(NULL); 7826 7830 UpdateAllViews(); 7831 */ 7827 7832 } break; 7828 7833 … … 7833 7838 break; 7834 7839 7840 float Sensitivity = 0.25f / (LC_MAX_MOUSE_SENSITIVITY+1 - g_App->m_MouseSensitivity); 7835 7841 lcCamera* Camera = m_ActiveView->GetCamera(); 7836 7842 bool Redraw; … … 7956 7962 } 7957 7963 7958 MoveX *= (float)(x - m_nDownX) * 0.25f / (21 - m_nMouse);7959 MoveY *= (float)(y - m_nDownY) * 0.25f / (21 - m_nMouse);7964 MoveX *= (float)(x - m_nDownX) * Sensitivity; 7965 MoveY *= (float)(y - m_nDownY) * Sensitivity; 7960 7966 7961 7967 m_nDownX = x; … … 7979 7985 Vector3 MoveX, MoveY; 7980 7986 7981 MoveX = ScreenX * (float)(x - m_nDownX) * 0.25f / (float)(21 - m_nMouse);7982 MoveY = ScreenY * (float)(y - m_nDownY) * 0.25f / (float)(21 - m_nMouse);7987 MoveX = ScreenX * (float)(x - m_nDownX) * Sensitivity; 7988 MoveY = ScreenY * (float)(y - m_nDownY) * Sensitivity; 7983 7989 7984 7990 TotalMove = MoveX + MoveY + m_MouseSnapLeftover; … … 7988 7994 Vector3 MoveZ; 7989 7995 7990 MoveZ = ScreenZ * (float)(y - m_nDownY) * 0.25f / (float)(21 - m_nMouse);7996 MoveZ = ScreenZ * (float)(y - m_nDownY) * Sensitivity; 7991 7997 7992 7998 TotalMove = MoveZ + m_MouseSnapLeftover; … … 8006 8012 case LC_ACTION_ROTATE: 8007 8013 { 8014 float Sensitivity = 36.0f / (LC_MAX_MOUSE_SENSITIVITY+1 - g_App->m_MouseSensitivity); 8008 8015 lcCamera* Camera = m_ActiveView->GetCamera(); 8009 8016 bool Redraw; … … 8114 8121 } 8115 8122 8116 MoveX *= (float)(x - m_nDownX) * 36.0f / (21 - m_nMouse);8117 MoveY *= (float)(y - m_nDownY) * 36.0f / (21 - m_nMouse);8123 MoveX *= (float)(x - m_nDownX) * Sensitivity; 8124 MoveY *= (float)(y - m_nDownY) * Sensitivity; 8118 8125 8119 8126 m_nDownX = x; … … 8137 8144 Vector3 MoveX, MoveY; 8138 8145 8139 MoveX = ScreenX * (float)(x - m_nDownX) * 36.0f / (float)(21 - m_nMouse);8140 MoveY = ScreenY * (float)(y - m_nDownY) * 36.0f / (float)(21 - m_nMouse);8146 MoveX = ScreenX * (float)(x - m_nDownX) * Sensitivity; 8147 MoveY = ScreenY * (float)(y - m_nDownY) * Sensitivity; 8141 8148 8142 8149 Delta = MoveX + MoveY + m_MouseSnapLeftover; … … 8146 8153 Vector3 MoveZ; 8147 8154 8148 MoveZ = ScreenZ * (float)(y - m_nDownY) * 36.0f / (float)(21 - m_nMouse);8155 MoveZ = ScreenZ * (float)(y - m_nDownY) * Sensitivity; 8149 8156 8150 8157 Delta = MoveZ + m_MouseSnapLeftover; … … 8168 8175 break; 8169 8176 8170 m_ActiveView->GetCamera()-> DoZoom(y - m_nDownY, m_nMouse, m_ActiveModel->m_CurFrame, m_bAddKeys);8177 m_ActiveView->GetCamera()->Zoom(m_ActiveModel->m_CurFrame, m_bAddKeys, x - m_nDownX, y - m_nDownY); 8171 8178 m_nDownY = y; 8172 8179 SystemUpdateFocus(NULL); … … 8189 8196 break; 8190 8197 8191 m_ActiveView->GetCamera()-> DoPan(x - m_nDownX, y - m_nDownY, m_nMouse, m_ActiveModel->m_CurFrame, m_bAddKeys);8198 m_ActiveView->GetCamera()->Pan(m_ActiveModel->m_CurFrame, m_bAddKeys, x - m_nDownX, y - m_nDownY); 8192 8199 m_ActiveView->GetCamera()->Update(m_ActiveModel->m_CurFrame); 8193 8200 m_nDownX = x; … … 8226 8233 } 8227 8234 8228 Camera-> DoRotate(x - m_nDownX, y - m_nDownY, m_nMouse, m_ActiveModel->m_CurFrame, m_bAddKeys);8235 Camera->Rotate(m_ActiveModel->m_CurFrame, m_bAddKeys, x - m_nDownX, y - m_nDownY); 8229 8236 Camera->Update(m_ActiveModel->m_CurFrame); 8230 8237 … … 8267 8274 { 8268 8275 case LC_OVERLAY_XYZ: 8269 Camera-> DoOrbit(x - m_nDownX, y - m_nDownY, m_nMouse, m_ActiveModel->m_CurFrame, m_bAddKeys);8276 Camera->Orbit(m_ActiveModel->m_CurFrame, m_bAddKeys, x - m_nDownX, y - m_nDownY); 8270 8277 break; 8271 8278 8272 8279 case LC_OVERLAY_X: 8273 Camera-> DoOrbit(x - m_nDownX, 0, m_nMouse, m_ActiveModel->m_CurFrame, m_bAddKeys);8280 Camera->Orbit(m_ActiveModel->m_CurFrame, m_bAddKeys, x - m_nDownX, 0);
