Changeset 435 for cafu/trunk

Show
Ignore:
Timestamp:
11/27/11 16:14:43 (6 months ago)
Author:
Carsten
Message:

Model Editor:
Minor fixes to the 3D view and camera navigation to improve the behavior when the user is doing a detail inspection of models.

Location:
cafu/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • cafu/trunk/CaWE/Generic3DWindow.cpp

    r285 r435  
    599599void Generic3DWindowT::OnMouseWheel(wxMouseEvent& ME) 
    600600{ 
    601     m_Camera->Pos+=normalizeOr0(WindowToWorld(ME.GetPosition()) - m_Camera->Pos)*(ME.GetWheelRotation()/2); 
     601    int factor=2; 
     602 
     603    // It would probably be better to use WXK_ALT here, or even better to have a "mouse sensitivity" state/member. 
     604    if (wxGetKeyState(WXK_SHIFT  )) factor*=4; 
     605    if (wxGetKeyState(WXK_CONTROL)) factor*=4; 
     606 
     607    m_Camera->Pos+=normalizeOr0(WindowToWorld(ME.GetPosition()) - m_Camera->Pos)*(ME.GetWheelRotation()/factor); 
    602608    InfoCameraChanged(); 
    603609} 
  • cafu/trunk/CaWE/ModelEditor/ModelDocument.cpp

    r428 r435  
    8181    m_Cameras.PushBack(new CameraT); 
    8282    m_Cameras[0]->Pos.y=-500.0f; 
     83    m_Cameras[0]->NearPlaneDist=1.0f; 
    8384 
    8485    m_LightSources.PushBack(new LightSourceT(true,  true, Vector3fT(200.0f,   0.0f, 200.0f), 1500.0f, wxColour(255, 235, 215))); 
  • cafu/trunk/Libs/Models/AnimPose.cpp

    r429 r435  
    728728    // If we miss the bounding-box, then we miss all the triangles as well. 
    729729    float Fraction=0.0f; 
    730     if (!GetBB().TraceRay(RayOrigin, RayDir, Fraction)) return false; 
     730    if (!GetBB()/*.GetEpsilonBox(...)*/.Contains(RayOrigin) && !GetBB().TraceRay(RayOrigin, RayDir, Fraction)) return false; 
    731731 
    732732    typedef CafuModelT::MeshT MeshT;