diff --git a/src/ofxKinect2.cpp b/src/ofxKinect2.cpp index 9d16292..6102b09 100644 --- a/src/ofxKinect2.cpp +++ b/src/ofxKinect2.cpp @@ -1269,7 +1269,6 @@ void Body::drawBone(JointType joint0, JointType joint1, int x, int y, int w, int { if(is_tracked) { - ofPushStyle(); TrackingState state0 = joints[joint0].TrackingState; TrackingState state1 = joints[joint1].TrackingState; @@ -1283,6 +1282,7 @@ void Body::drawBone(JointType joint0, JointType joint1, int x, int y, int w, int return; } + ofPushStyle(); if((state0 == TrackingState_Tracked) && (state1 == TrackingState_Tracked)) { ofSetColor(ofColor::green); diff --git a/src/ofxKinect2.h b/src/ofxKinect2.h index ab28532..c53f207 100644 --- a/src/ofxKinect2.h +++ b/src/ofxKinect2.h @@ -365,7 +365,7 @@ class ofxKinect2::Body inline bool isTracked() const { return is_tracked;} inline HandState getLeftHandState() const { return left_hand_state; } - inline HandState getRightHandState() const { return left_hand_state; } + inline HandState getRightHandState() const { return right_hand_state; } inline size_t getNumJoints() { return JointType_Count; } @@ -444,8 +444,6 @@ class ofxKinect2::BodyStream : public Stream OF_DEPRECATED_MSG("Use getPixels() instead ", ofShortPixels& getPixelsRef() { return pix.getFrontBuffer(); }); OF_DEPRECATED_MSG("Use getPixels() instead ", ofShortPixels getPixelsRef(int _near, int _far, bool invert = false);); - ofPoint righthand_pos_; - protected: DoubleBuffer pix; vector bodies; diff --git a/src/utils/MeshGenerator.h b/src/utils/MeshGenerator.h index 69e38c1..c06f244 100644 --- a/src/utils/MeshGenerator.h +++ b/src/utils/MeshGenerator.h @@ -22,8 +22,8 @@ class ofxKinect2::MeshGenerator float fovH = depth_stream.getHorizontalFieldOfView(); float fovV = depth_stream.getVerticalFieldOfView(); - xzFactor = tan(fovH * 0.5) * 2; - yzFactor = tan(fovV * 0.5) * -2; + xzFactor = tan(ofDegToRad(fovH) * 0.5) * 2; + yzFactor = tan(ofDegToRad(fovV) * 0.5) * -2; } const ofMesh& update(const ofShortPixels& depth, const ofPixels& color = ofPixels())