//---------------------------------------------------- void TUI::IR_OnMouseMove(int x, int y){ if (!m_bReady) return; bool bRayUpdated = false; if (!EDevice.m_Camera.Process(m_ShiftState,x,y)){ if( m_MouseCaptured || m_MouseMultiClickCaptured ){ if( Tools->HiddenMode() ){ m_DeltaCpH.set(x,y); if( m_DeltaCpH.x || m_DeltaCpH.y ){ Tools->MouseMove(m_ShiftState); } }else{ IR_GetMousePosReal(EDevice.m_hRenderWnd, m_CurrentCp); EDevice.m_Camera.MouseRayFromPoint(m_CurrentRStart,m_CurrentRDir,m_CurrentCp); Tools->MouseMove(m_ShiftState); } RedrawScene(); bRayUpdated = true; } } if (!bRayUpdated){ IR_GetMousePosReal(EDevice.m_hRenderWnd, m_CurrentCp); EDevice.m_Camera.MouseRayFromPoint(m_CurrentRStart,m_CurrentRDir,m_CurrentCp); } // Out cursor pos OutUICursorPos (); }
void TUI::MouseRelease(TShiftState Shift, int X, int Y) { if (!m_bReady) return; m_ShiftState = Shift; if( EDevice.m_Camera.IsMoving() ){ if (EDevice.m_Camera.MoveEnd(m_ShiftState)) bMouseInUse = false; }else{ bMouseInUse = false; if( m_MouseCaptured ){ if( !Tools->HiddenMode() ){ IR_GetMousePosReal(EDevice.m_hRenderWnd, m_CurrentCp); EDevice.m_Camera.MouseRayFromPoint(m_CurrentRStart,m_CurrentRDir,m_CurrentCp ); } if( Tools->MouseEnd(m_ShiftState) ){ if( Tools->HiddenMode() ){ SetCursorPos(m_StartCpH.x,m_StartCpH.y); ShowCursor( TRUE ); } m_MouseCaptured = false; } } } // update tools (change action) Tools->OnFrame (); RedrawScene (); }
void TUI::MousePress(TShiftState Shift, int X, int Y) { if (!m_bReady) return; if (m_MouseCaptured) return; bMouseInUse = true; m_ShiftState = Shift; // camera activate if(!EDevice.m_Camera.MoveStart(m_ShiftState)){ if (Tools->Pick(Shift)) return; if( !m_MouseCaptured ){ if( Tools->HiddenMode() ){ IR_GetMousePosScreen(m_StartCpH); m_DeltaCpH.set(0,0); }else{ IR_GetMousePosReal(EDevice.m_hRenderWnd, m_CurrentCp); m_StartCp = m_CurrentCp; EDevice.m_Camera.MouseRayFromPoint(m_CurrentRStart, m_CurrentRDir, m_CurrentCp ); } if(Tools->MouseStart(m_ShiftState)){ if(Tools->HiddenMode()) ShowCursor( FALSE ); m_MouseCaptured = true; } } } RedrawScene(); }
void IInputReceiver::IR_GetMousePosIndependent (Fvector2 &f) { Ivector2 p; IR_GetMousePosReal(p); f.set( 2.f*float(p.x)/float(Device.dwWidth)-1.f, 2.f*float(p.y)/float(Device.dwHeight)-1.f ); }
void IInputReceiver::IR_GetMousePosReal (Ivector2 &p) { IR_GetMousePosReal(Device.m_hWnd,p); }
void IInputReceiver::IR_GetMousePosReal (Ivector2 &p) { IR_GetMousePosReal(RDEVICE.m_hWnd,p); }