Hey guys,
I am currently trying to get a custom swipe gesture implemented using the latest Leap stuff.
I have it working reliably with right to left but can't seem to make it do left to right reliably. Basically, I would like to be able to swipe left or right so the application can be aware which direction the swipe is going.
This is what I have so far:
(Update)
if(currentCooldown > 0.0f)
{
currentCooldown -= Time.deltaTime;
if(currentCooldown < 0.0f){
currentCooldown = 0.0f;
}
}
if (SwipeGesture())
{
if (currentCooldown <= 0.0f)
{
currentCooldown = coolDown;
if (firstHand.PalmVelocity.x >= 10)
{
Debug.Log("RIGHT");
return;
}
if (firstHand.PalmVelocity.x <= -10)
{
Debug.Log("LEFT");
return;
}
}
}
}
(Swipe Method)
private bool SwipeGesture(){
if ((((HandPalmRoll < 0.5f && HandPalmRoll > -2.8f) == true) & ((HandPalmYaw < -0.5f && HandPalmYaw > -2.6f) == true) & ((pinch > 0.3f) == true))){
return true;
}
else{
return false;
}
}
Thanks guys!