Package com.leapmotion.leap

Examples of com.leapmotion.leap.CircleGesture


    PApplet parent = this.leap.getParent();

    if (parent != null) {
      switch (gesture.type()) {
        case TYPE_CIRCLE:
          CircleGesture circleGesture = new CircleGesture(gesture);
          String clockwiseness;
          if (circleGesture.pointable().direction().angleTo(circleGesture.normal()) <= Math.PI / 4) {
            // Clockwise if angle is less than 90 degrees
            clockwiseness = "clockwise";
          } else {
            clockwiseness = "counterclockwise";
          }
View Full Code Here


  }

  private void printGestureDetails(Gesture gesture, Controller controller) {
    switch (gesture.type()) {
      case TYPE_CIRCLE:
        CircleGesture circle = new CircleGesture(gesture);

        // Calculate clock direction using the angle between circle normal and pointable
        String clockwiseness;
        if (circle.pointable().direction().angleTo(circle.normal()) <= Math.PI / 4) {
          // Clockwise if angle is less than 90 degrees
          clockwiseness = "clockwise";
        } else {
          clockwiseness = "counterclockwise";
        }

        // Calculate angle swept since last frame
        double sweptAngle = 0;
        if (circle.state() != State.STATE_START) {
          CircleGesture previousUpdate =
              new CircleGesture(controller.frame(1).gesture(circle.id()));
          sweptAngle = (circle.progress() - previousUpdate.progress()) * 2 * Math.PI;
        }

        System.out.println("Circle id: " + circle.id() + ", " + circle.state() + ", progress: "
            + circle.progress() + ", radius: " + circle.radius() + ", angle: "
            + Math.toDegrees(sweptAngle) + ", " + clockwiseness);
View Full Code Here

TOP

Related Classes of com.leapmotion.leap.CircleGesture

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.