void CMultiShapeActorsTest::HandleInput( const InputData& input ) { /* if( m_pUIInputHandler ) { // CInputHandler::ProcessInput() does not take const SInputData& SInputData input_copy = input; m_pUIInputHandler->ProcessInput( input_copy ); if( m_pUIInputHandler->PrevInputProcessed() ) return; }*/ static int m_CurrentMouseX = -1; static int m_CurrentMouseY = -1; static bool m_MouseLButtonPressed = false; static bool m_MouseRButtonPressed = false; static bool m_ShiftKeyPressed = false; int x=0,y=0;//,dx=0,dy=0; switch( input.iGICode ) { case 'C': case GIC_LSHIFT: m_ShiftKeyPressed = ( input.iType == ITYPE_KEY_PRESSED ) ? true : false; m_CurrentMouseX = -1; m_CurrentMouseY = -1; break; case GIC_MOUSE_BUTTON_L: m_MouseLButtonPressed = ( input.iType == ITYPE_KEY_PRESSED ) ? true : false; break; case GIC_MOUSE_BUTTON_R: m_MouseRButtonPressed = ( input.iType == ITYPE_KEY_PRESSED ) ? true : false; break; case GIC_MOUSE_AXIS_X: if( !m_StartPhysicsSimulation || !m_ShiftKeyPressed ) { m_CurrentMouseX = x; m_CurrentMouseY = y; break; } x = (int)input.GetParamH16(); if( m_CurrentMouseX < 0 ) m_CurrentMouseX = x; // init else { MoveClothHolderActor( Vector3( (float)(x - m_CurrentMouseX) * 0.005f, 0.0f, 0.0f ) ); m_CurrentMouseX = x; } break; case GIC_MOUSE_AXIS_Y: if( !m_StartPhysicsSimulation || !m_ShiftKeyPressed ) { m_CurrentMouseX = x; m_CurrentMouseY = y; break; } y = (int)input.GetParamL16(); if( m_CurrentMouseY < 0 ) m_CurrentMouseY = y; // init else { MoveClothHolderActor( Vector3( 0.0f, (float)(y - m_CurrentMouseY) * 0.005f, 0.0f ) ); m_CurrentMouseY = y; } break; case GIC_SPACE: if( input.iType == ITYPE_KEY_PRESSED ) m_StartPhysicsSimulation = true; break; case GIC_ENTER: if( input.iType == ITYPE_KEY_PRESSED ) { // m_pSampleUI->GetDialog(UIID_DLG_RESOLUTION)->Open(); } break; case 'V': if( input.iType == ITYPE_KEY_PRESSED ) { physics::CRay ray; ray.Direction = GetCurrentCamera().GetPose().matOrient.GetColumn(2); ray.Origin = GetCurrentCamera().GetPose().vPosition; if( !m_pPhysScene ) return; CRaycastHit hit; CShape *pShape = m_pPhysScene->RaycastClosestShape( ray, hit, 0, 100.0f ); if( !pShape ) return; pShape->GetActor().AddWorldForce( ray.Direction, ForceMode::Impulse ); } break; default: CGraphicsTestBase::HandleInput( input ); break; } }