I'm working with LeapMotion. I have this code in my main class:
public void onFrame(Controller controller) {
Frame frame = controller.frame();
GestoPistola gesto;
if (!frame.hands().isEmpty())
{
System.out.println("ENTER");
gesto.reconocer(frame);
}
…
}
And then, this is the class GestoPistola, which is the one that has to make all the job.
public class GestoPistola {
public enum ESTADO{
DESCARGADA, CARGADA
}
ESTADO _estado;
public void GestoPistola(){
_estado = ESTADO.DESCARGADA;
}
public void reconocer(Frame f)
{
System.out.println("LET'S START");
if (!f.hands().isEmpty()) {
System.out.println("Hay mano");
Hand hand = f.hands().get(0);
FingerList fingers = hand.fingers();
switch(_estado)
{
…
}
}
}
}
So, the consol shows "ENTER", but never "LET'START".
I know it's a really simple question, but I'm not such an expert with JAVA.
Hope someone can help me!