Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,3 @@ Makefile.am
libLeap.dylib

log.txt

package.txt
7 changes: 4 additions & 3 deletions Dispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@
using namespace Leap;

void Dispatcher::onInit(const Controller& controller) {
post("Leap Motion for Pd by Chikashi Miyama Ver 0.1");
post("Leap Motion for Pd Ver 0.1.1 by Jakub Valtar");
post(" based on Ver 0.1 by Chikashi Miyama");
}

void Dispatcher::onConnect(const Controller& controller) {
post("Leap:connectd");
post("Leap:connected");
}

void Dispatcher::onDisconnect(const Controller& controller) {
post("Leap:disconnected");
}

void Dispatcher::onExit(const Controller& controller) {
post("Leap:Exited");
post("Leap:exited");
}

void Dispatcher::onFrame(const Controller& controller) {
Expand Down
10 changes: 7 additions & 3 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ class leapmotion: public flext_base
FLEXT_ADDMETHOD_(0, "gestures", m_gestures);
FLEXT_ADDMETHOD_(0, "info", m_info);

// Set policy flag so that patch can receive events from
// the controller even when the patch window is in background
controller.setPolicyFlags(Controller::POLICY_BACKGROUND_FRAMES);

// Have the sample listener receive events from the controller
controller.addListener(dispatcher);
general_flag = true;
Expand Down Expand Up @@ -205,9 +209,9 @@ class leapmotion: public flext_base
// normal
SETFLOAT(&handInfo[0], i);
SETSYMBOL(&handInfo[1], gensym("palm_normal"));
SETFLOAT(&handInfo[2], hand.palmVelocity().x);
SETFLOAT(&handInfo[3], hand.palmVelocity().y);
SETFLOAT(&handInfo[4], hand.palmVelocity().z);
SETFLOAT(&handInfo[2], hand.palmNormal().x);
SETFLOAT(&handInfo[3], hand.palmNormal().y);
SETFLOAT(&handInfo[4], hand.palmNormal().z);
ToOutAnything(1, gensym("hand"), 5, handInfo);
}
if(hands_sphere_radius_flag){
Expand Down
3 changes: 3 additions & 0 deletions package.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NAME=leapmotion
SRCDIR=.
SRCS=main.cpp Dispatcher.cpp