private void ProcessInput()
{
have_left = false;
have_right = false;
have_left_punch = false;
have_right_punch = false;
if (left_mom.m00 > 1000000)
{
have_left = true;
if (left_mom.m00 - last_left_m00 > 100000)
{
left_state=1;
left_dist++;
}
else if (left_state > 0)
{
left_state++;
}
if (left_state == 3)
{
left_state = 0;
if (left_dist > 2)
{
have_left_punch = true;
}
left_dist = 0;
}
}
else
{
left_state = 0;
left_dist = 0;
}
if (right_mom.m00 > 1000000)
{
have_right = true;
if (right_mom.m00 - last_right_m00 > 100000)
{
right_state = 1;
right_dist++;
}
else if (right_state > 0)
{
right_state++;
}
if (right_state == 3)
{
right_state = 0;
if (right_dist > 2)
{
have_right_punch = true;
}
right_dist = 0;
}
}
else
{
right_state = 0;
right_dist = 0;
}
last_left_m00 = left_mom.m00;
last_right_m00 = right_mom.m00;
}