Changeset 713

Show
Ignore:
Timestamp:
08/23/07 21:56:54 (16 months ago)
Author:
leo
Message:

Camera cleanup.

Location:
trunk
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • trunk/common/camera.cpp

    r673 r713  
    1 // Camera object. 
    2  
    31#include "lc_global.h" 
    42#include <stdlib.h> 
     
    108#include "file.h" 
    119#include "camera.h" 
    12 #include "tr.h" 
    1310 
    1411#define LC_CAMERA_SAVE_VERSION 6 // LeoCAD 0.73 
     
    218215// Camera operations 
    219216 
    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     else 
    235     { 
    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 vector 
    255         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     else 
    270     { 
    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         else 
    287         { 
    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     else 
    309     { 
    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 both 
    315         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  
    372217void Camera::DoRoll(int dx, int mouse, unsigned short nTime, bool bAddKey) 
    373218{ 
     
    466311    UpdatePosition(nTime); 
    467312} 
    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  
    3636    m_ActiveProject = NULL; 
    3737    m_Library = NULL; 
     38    m_MouseSensitivity = Sys_ProfileLoadInt("Default", "Mouse", 11); 
    3839} 
    3940 
  • trunk/common/lc_application.h

    r663 r713  
    77class PiecesLibrary; 
    88class PiecePreview; 
     9 
     10#define LC_MAX_MOUSE_SENSITIVITY 20 
    911 
    1012class lcApplication 
     
    3941public: 
    4042    PiecePreview* m_PiecePreview; 
     43    int m_MouseSensitivity; 
    4144 
    4245protected: 
  • trunk/common/lc_camera.cpp

    r709 r713  
    44 
    55#include "lc_colors.h" 
     6#include "lc_application.h" 
    67#include "opengl.h" 
    78 
     
    232233} 
    233234 
    234 void lcCamera::SetRoll(u32 Time, bool AddKey, const float NewRoll) 
     235void lcCamera::SetRoll(u32 Time, bool AddKey, float NewRoll) 
    235236{ 
    236237    ChangeKey(Time, AddKey, LC_CAMERA_ROLL, NewRoll); 
    237238} 
    238239 
    239 void lcCamera::Roll(u32 Time, bool AddKey, float MouseX, float MouseY) 
    240 { 
    241     float NewRoll = m_Roll + MouseX / 100; 
     240void 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; 
    242246    SetRoll(Time, AddKey, NewRoll); 
    243247} 
    244248 
    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 { 
     249void 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 
    256254    if (m_Flags & LC_CAMERA_ORTHOGRAPHIC) 
    257255    { 
    258256        // TODO: have a different option to change the FOV. 
    259         m_FOV += MouseY; 
     257        m_FOV += dy; 
    260258        m_FOV = lcClamp(m_FOV, 0.001f, 179.999f); 
    261259    } 
    262260    else 
    263261    { 
    264         Vector3 Delta = Vector3(m_ViewWorld[2]) * MouseY; 
     262        Vector3 Delta = Vector3(m_ViewWorld[2]) * dy; 
    265263 
    266264        // TODO: option to move eye, target or both 
     
    272270} 
    273271 
    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; 
     272void 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; 
    277279 
    278280    if (m_Children) 
     
    282284} 
    283285 
    284 void lcCamera::Orbit(float MouseX, float MouseY, u32 Time, bool AddKey) 
    285 { 
     286void 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 
    286292    Vector3 Dir = m_WorldPosition - m_Children->m_WorldPosition; 
    287293 
    288294    // 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; 
    292298        Matrix33 RotX = MatrixFromAxisAngle(Vector4(0, 0, 1, AngleX)); 
    293299 
     
    296302 
    297303    // 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; 
    301307        Matrix33 RotY = MatrixFromAxisAngle(Vector4(m_WorldView[0][0], m_WorldView[1][0], m_WorldView[2][0], AngleY)); 
    302308 
     
    307313} 
    308314 
    309 void lcCamera::Rotate(float MouseX, float MouseY, u32 Time, bool AddKey) 
    310 { 
     315void 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 
    311321    Vector3 Dir = m_Children->m_WorldPosition - m_WorldPosition; 
    312322 
    313323    // 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; 
    317327        Matrix33 RotX = MatrixFromAxisAngle(Vector4(0, 0, 1, AngleX)); 
    318328 
     
    321331 
    322332    // 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; 
    326336        Matrix33 RotY = MatrixFromAxisAngle(Vector4(m_WorldView[0][0], m_WorldView[1][0], m_WorldView[2][0], AngleY)); 
    327337 
     
    331341    m_Children->SetPosition(Time, AddKey, Dir + m_ParentPosition); 
    332342} 
    333  
    334 // FIXME: Move this to the View class, or remove. 
    335 void lcCamera::GetFrustumPlanes(float Aspect, Vector4 Planes[6]) const 
    336 { 
    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 = crash 
    350         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     else 
    359     { 
    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  
    6161    } 
    6262 
     63    // FIXME: remove IsSide 
     64    bool IsSide() const 
     65    { return m_CameraType < LC_CAMERA_MAIN; } 
     66 
    6367    // Change the roll value. 
    64     void SetRoll(u32 Time, bool AddKey, const float NewRoll); 
     68    void SetRoll(u32 Time, bool AddKey, float NewRoll); 
    6569 
    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); 
    6872 
    6973    // 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); 
    7175 
    7276    // 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); 
    7478 
    7579    // 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); 
    7781 
    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); 
    8084 
    8185    // Base class implementation. 
     
    8791    // Base class overrides. 
    8892    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() const 
    104     { return m_CameraType < LC_CAMERA_MAIN; } 
    10593 
    10694public: 
  • trunk/common/project.cpp

    r712 r713  
    7979    m_pBackground = new Texture(); 
    8080    m_nAutosave = Sys_ProfileLoadInt ("Settings", "Autosave", 10); 
    81     m_nMouse = Sys_ProfileLoadInt ("Default", "Mouse", 11); 
    8281    strcpy(m_strModelsPath, Sys_ProfileLoadString ("Default", "Projects", "")); 
    8382 
     
    53835382        { 
    53845383            LC_PREFERENCESDLG_OPTS opts; 
    5385             opts.nMouse = m_nMouse; 
     5384            opts.nMouse = g_App->m_MouseSensitivity; 
    53865385            opts.nSaveInterval = m_nAutosave; 
    53875386            strcpy(opts.strUser, Sys_ProfileLoadString ("Default", "User", "")); 
     
    54045403            if (SystemDoDialog(LC_DLG_PREFERENCES, &opts)) 
    54055404            { 
    5406                 m_nMouse = opts.nMouse; 
     5405                g_App->m_MouseSensitivity = opts.nMouse; 
    54075406                m_nAutosave = opts.nSaveInterval; 
    54085407                strcpy(m_strModelsPath, opts.strPath); 
     
    54375436        case LC_VIEW_ZOOM: 
    54385437        { 
    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); 
    54405439            SystemUpdateFocus(NULL); 
    54415440            UpdateOverlayScale(); 
     
    54455444        case LC_VIEW_ZOOMIN: 
    54465445        { 
    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); 
    54485447            SystemUpdateFocus(NULL); 
    54495448            UpdateOverlayScale(); 
     
    54535452        case LC_VIEW_ZOOMOUT: 
    54545453        { 
    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); 
    54565455            SystemUpdateFocus(NULL); 
    54575456            UpdateOverlayScale(); 
     
    57545753            y -= y > 0 ? 5 : -5; 
    57555754 
    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); 
    57575756            m_ActiveView->GetCamera()->Update(m_ActiveModel->m_CurFrame); 
    57585757            m_nDownX = x; 
     
    77897788        case LC_ACTION_SPOTLIGHT: 
    77907789        { 
     7790            /* 
     7791            // fixme: move this to lc_action_move 
    77917792            float mouse = 10.0f/(21 - m_nMouse); 
    77927793            Vector3 Delta((ptx - m_fTrack[0])*mouse, (pty - m_fTrack[1])*mouse, (ptz - m_fTrack[2])*mouse); 
     
    78057806            SystemUpdateFocus(NULL); 
    78067807            UpdateAllViews(); 
     7808            */ 
    78077809        } break; 
    78087810 
    78097811        case LC_ACTION_CAMERA: 
    78107812        { 
     7813            /* 
     7814            // fixme: move this to lc_action_move 
    78117815            float mouse = 10.0f/(21 - m_nMouse); 
    78127816            Vector3 Delta((ptx - m_fTrack[0])*mouse, (pty - m_fTrack[1])*mouse, (ptz - m_fTrack[2])*mouse); 
     
    78257829            SystemUpdateFocus(NULL); 
    78267830            UpdateAllViews(); 
     7831            */ 
    78277832        } break; 
    78287833 
     
    78337838                break; 
    78347839 
     7840            float Sensitivity = 0.25f / (LC_MAX_MOUSE_SENSITIVITY+1 - g_App->m_MouseSensitivity); 
    78357841            lcCamera* Camera = m_ActiveView->GetCamera(); 
    78367842            bool Redraw; 
     
    79567962                } 
    79577963 
    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; 
    79607966 
    79617967                m_nDownX = x; 
     
    79797985                    Vector3 MoveX, MoveY; 
    79807986 
    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; 
    79837989 
    79847990                    TotalMove = MoveX + MoveY + m_MouseSnapLeftover; 
     
    79887994                    Vector3 MoveZ; 
    79897995 
    7990                     MoveZ = ScreenZ * (float)(y - m_nDownY) * 0.25f / (float)(21 - m_nMouse); 
     7996                    MoveZ = ScreenZ * (float)(y - m_nDownY) * Sensitivity; 
    79917997 
    79927998                    TotalMove = MoveZ + m_MouseSnapLeftover; 
     
    80068012        case LC_ACTION_ROTATE: 
    80078013        { 
     8014            float Sensitivity = 36.0f / (LC_MAX_MOUSE_SENSITIVITY+1 - g_App->m_MouseSensitivity); 
    80088015            lcCamera* Camera = m_ActiveView->GetCamera(); 
    80098016            bool Redraw; 
     
    81148121                } 
    81158122 
    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; 
    81188125 
    81198126                m_nDownX = x; 
     
    81378144                    Vector3 MoveX, MoveY; 
    81388145 
    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; 
    81418148 
    81428149                    Delta = MoveX + MoveY + m_MouseSnapLeftover; 
     
    81468153                    Vector3 MoveZ; 
    81478154 
    8148                     MoveZ = ScreenZ * (float)(y - m_nDownY) * 36.0f / (float)(21 - m_nMouse); 
     8155                    MoveZ = ScreenZ * (float)(y - m_nDownY) * Sensitivity; 
    81498156 
    81508157                    Delta = MoveZ + m_MouseSnapLeftover; 
     
    81688175                break; 
    81698176 
    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); 
    81718178            m_nDownY = y; 
    81728179            SystemUpdateFocus(NULL); 
     
    81898196                break; 
    81908197 
    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); 
    81928199            m_ActiveView->GetCamera()->Update(m_ActiveModel->m_CurFrame); 
    81938200            m_nDownX = x; 
     
    82268233            } 
    82278234 
    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); 
    82298236            Camera->Update(m_ActiveModel->m_CurFrame); 
    82308237 
     
    82678274            { 
    82688275                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); 
    82708277                    break; 
    82718278 
    82728279                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);