This section is no longer being used. Please join the discussion in the Developer Forums.

LEAPCircleGesture direction??

Votes Replies Views Asked by
0 1 127 Alex Cheng about 7 months ago

Hi, I'm obj-c developer.

Is there anyway to check the Circle gesture's direction?
I would like to know it's clockwise rotation or counter-clockwise rotation.

According the sample code, I think it could be determined by sweptAngle.
any hint to make that ??

Tags

Not the question you were looking for? Browse other questions tagged:

gestures   13
1 answer
Votes Answered by
0 Joe Ward LM about 7 months ago

Compare the direction of the pointable making the gesture to the normal of the circle. If they are pointing in generally the same direction then the circle is clockwise. There are examples for this in all the samples except the ObjectiveC and JavaScript samples. In Java:

            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";
            }
1 comment
By Joe Ward LM
on 2013-03-13

I just noticed that you are working in Objective C. The angleTo function isn't in the Objective C wrapper yet. Should be in the next release. In the meantime, here's an implementation.

Markdown for editing

We are using "GitHub Flavored Markdown" (GFM) for our discussions. It differs from standard Markdown (SM) in a few significant ways and adds some additional functionality.

If you're not already familiar with Markdown, you should spend 15 minutes and go over the excellent Markdown Syntax Guide at Daring Fireball.

How to Format
  • Put returns between paragraphs
  • For linebreak, add 2 spaces at the end
  • Make text _italic_ or **bold**
  • Indent code by 4 spaces
  • Backtick escapes `like_so`
  • Quote by placing > at the start of a line
  • To make links:
    <http://foo.com>
    [foo](http://foo.com)
    <a href="http://z.com">z</a>
  • basic HTML also allowed