16#pragma clang diagnostic push
17#pragma clang diagnostic ignored "-Wdocumentation"
19#pragma clang diagnostic pop
32 "VuoList_VuoLeapHand",
33 "VuoList_VuoLeapPointable",
48#if defined(__x86_64__) || defined(DOXYGEN)
55 return (millimeters / ibox.width()) * 2.;
78 case Leap::Pointable::ZONE_TOUCHING:
79 return VuoLeapTouchZone_Touching;
81 case Leap::Pointable::ZONE_HOVERING:
82 return VuoLeapTouchZone_Hovering;
84 case Leap::Pointable::ZONE_NONE:
85 return VuoLeapTouchZone_None;
120 this->receivedFrame = receivedFrame;
126 virtual void onInit(
const Leap::Controller&) {}
127 virtual void onDisconnect(
const Leap::Controller&) {}
128 virtual void onExit(
const Leap::Controller&) {}
129 virtual void onFocusGained(
const Leap::Controller&) {}
130 virtual void onFocusLost(
const Leap::Controller&) {}
132 virtual void onConnect(
const Leap::Controller &controller)
134 controller.enableGesture(Leap::Gesture::TYPE_CIRCLE);
135 controller.enableGesture(Leap::Gesture::TYPE_KEY_TAP);
136 controller.enableGesture(Leap::Gesture::TYPE_SCREEN_TAP);
137 controller.enableGesture(Leap::Gesture::TYPE_SWIPE);
139 controller.setPolicyFlags(Leap::Controller::POLICY_BACKGROUND_FRAMES);
142 virtual void onFrame(
const Leap::Controller &controller)
144 const Leap::Frame frame = controller.frame();
148 Leap::InteractionBox interactionBox = frame.interactionBox();
156 Leap::HandList allHands = frame.hands();
157 Leap::PointableList allPointables = frame.pointables();
159 for (Leap::PointableList::const_iterator pointable = allPointables.begin(); pointable != allPointables.end(); ++pointable)
163 VuoPoint3d tipPosition =
VuoPoint3d_make(stabilized.x, stabilized.y, position.z);
167 (*pointable).isFinger() ? VuoLeapPointableType_Finger : VuoLeapPointableType_Tool,
173 (*pointable).timeVisible(),
174 (*pointable).touchDistance(),
176 (*pointable).isExtended()
182 for(Leap::HandList::const_iterator hand = allHands.begin(); hand != allHands.end(); ++hand)
185 Leap::FingerList fingers = (*hand).fingers();
187 for (Leap::FingerList::const_iterator pointable = fingers.begin(); pointable != fingers.end(); ++pointable)
191 VuoPoint3d tipPosition =
VuoPoint3d_make(stabilized.x, stabilized.y, position.z);
195 VuoLeapPointableType_Finger,
201 (*pointable).timeVisible(),
202 (*pointable).touchDistance(),
204 (*pointable).isExtended()
208 Leap::Matrix basis = (*hand).basis();
209 if ((*hand).isLeft())
216 Leap::Matrix basisInverse = basis.rigidInverse();
217 VuoPoint3d basisPoint3d[3] = {
225 VuoPoint3d palmPosition =
VuoPoint3d_make(stabilized.x, stabilized.y, position.z);
236 (*hand).pinchStrength(),
237 (*hand).grabStrength(),
238 (*hand).timeVisible(),
240 (*hand).confidence(),
251typedef struct _VuoLeapInternal
253 Leap::Controller *controller;
271 leap->controller =
new Leap::Controller;
273 leap->controller->addListener(*leap->listener);
285 leap->controller->removeListener(*leap->listener);
287 delete leap->listener;
288 delete leap->controller;