Game Development Reference
In-Depth Information
if ( IsPinchZoomValid() )
{
if ( FPinchZoomWasValid )
g_Responder->Event_Pinch( FInitialPoint1,
FInitialPoint2, FCurrentPoint1,
FCurrentPoint2 );
else
g_Responder->Event_PinchStart( FInitialPoint1,
FInitialPoint2 );
FPinchZoomWasValid = true;
}
else if ( FPinchZoomWasValid )
{
FPinchZoomWasValid = false;
g_Responder->Event_PinchStop( FInitialPoint1,
FInitialPoint2, FCurrentPoint1, FCurrentPoint2 );
}
}
23. The UpdateGesture() function previously described uses the following helper
function:
static vec2 GetPositionDelta()
{ return FCurrentPoint.FPoint - FInitialPoint.FPoint; }
24. The drag or ling motion should be performed with a single inger. To distinguish
a drag from a ling, we use the IsDraggingValid() function:
static bool IsDraggingValid()
{
if ( FMotionDataValid && FMotionData.GetNumTouchPoints() == 1
&& FMotionData.GetTouchPointID( 0 ) == 0 )
{
if ( !FMoving )
{
FMoving = true;
FInitialPoint = FMotionData.GetTouchPoint( 0 );
return false;
}
FCurrentPoint = FMotionData.GetTouchPoint( 0 );
}
else
{
FMoving = false;
}
return FMoving;
}
 
Search WWH ::




Custom Search