ResetActor();
}
-void GestureProcessor::GetGesturedActor( Actor*& actor, GestureDetectorContainer& gestureDetectors, Functor& functor )
+void GestureProcessor::GetGesturedActor( Actor*& actor, GestureDetectorContainer& gestureDetectors )
{
while ( actor )
{
{
GestureDetector* current(*iter);
- // Check whether the gesture detector satisfies the current gesture's parameters.
- if ( functor( current, actor ) )
+ // Check deriving class for whether the current gesture satisfies the gesture detector's parameters.
+ if ( CheckGestureDetector( current, actor ) )
{
gestureDetectors.push_back(current);
}
}
}
-void GestureProcessor::ProcessAndEmit( HitTestAlgorithm::Results& hitTestResults, Functor& functor )
+void GestureProcessor::ProcessAndEmit( HitTestAlgorithm::Results& hitTestResults )
{
if ( hitTestResults.actor )
{
while ( actor )
{
GestureDetectorContainer gestureDetectors;
- GetGesturedActor( actor, gestureDetectors, functor );
+ GetGesturedActor( actor, gestureDetectors );
if ( actor && !gestureDetectors.empty() )
{
if ( actor == hitTestActor )
{
- // Our gesture detector's attached actor WAS the hit actor so we can call the emitting functor.
- functor( actor, gestureDetectors, hitTestResults.actorCoordinates );
+ // Our gesture detector's attached actor WAS the hit actor so we can can emit the signal.
+ EmitGestureSignal( actor, gestureDetectors, hitTestResults.actorCoordinates );
break; // We have found AND emitted a signal on the gestured actor, break out.
}
else
float distance( 0.0f );
if( actor->RayActorTest( hitTestResults.rayOrigin, hitTestResults.rayDirection, hitPointLocal, distance ) )
{
- // One of the hit actor's parents was the gestured actor so call the emitting functor.
- functor( actor, gestureDetectors, Vector2( hitPointLocal.x, hitPointLocal.y ) );
+ // One of the parents was the gestured actor so we can emit the signal for that actor.
+ EmitGestureSignal( actor, gestureDetectors, Vector2( hitPointLocal.x, hitPointLocal.y ) );
break; // We have found AND emitted a signal on the gestured actor, break out.
}
}
return mGesturedActorDisconnected ? NULL : mCurrentGesturedActor;
}
-void GestureProcessor::SceneObjectRemoved(ProxyObject& proxy)
+void GestureProcessor::SceneObjectRemoved(Object& object)
{
- if ( mCurrentGesturedActor == &proxy &&
+ if ( mCurrentGesturedActor == &object &&
!mGesturedActorDisconnected )
{
// Inform deriving classes.
OnGesturedActorStageDisconnection();
- // do not call proxy.RemoveObserver here, proxy is currently iterating through observers... you wouldnt want to upset proxy now would you?
+ // do not call object.RemoveObserver here, object is currently iterating through observers... you wouldnt want to upset object now would you?
mGesturedActorDisconnected = true;
}
}
-void GestureProcessor::ProxyDestroyed(ProxyObject& proxy)
+void GestureProcessor::ObjectDestroyed(Object& object)
{
- if ( mCurrentGesturedActor == &proxy )
+ if ( mCurrentGesturedActor == &object )
{
// Inform deriving classes.
OnGesturedActorStageDisconnection();