gameoverhack / ofxOpenNI

Wrapper for OpenNI, NITE and SensorKinect
gingold.com.au
Other
246 stars 121 forks source link

addAllHandFocusGestures() doesn't attach to handEvent() #19

Open kylemcdonald opened 11 years ago

kylemcdonald commented 11 years ago

as far as i can tell, calling addAllHandFocusGestures() (like in the simple hands example) doesn't actually call the testApp::handEvent() method. is there an extra line of code that's necessary to hook these up, is there a bug inside ofxOpenNI, or am i misunderstanding what kind of gestures "wave", "click" and '"raise arm" are? :)

jkosoy commented 11 years ago

Just encountered this myself and I'm betting given 7 months have passed you've solved this issue for yourself.

I can fork and do a pull request if you think that's valuable. There's just a few lines of code missing:

In testApp.h ::

    void gestureEvent(ofxOpenNIGestureEvent & evt);

In testApp.cpp ::

// add to setup
openNIDevice.addGestureGenerator();
ofAddListener(openNIDevice.gestureEvent, this, &testApp::gestureEvent);

// somewhere later in code
void testApp::gestureEvent(ofxOpenNIGestureEvent &evt) {
    cout << evt.gestureName << endl;
}