language: C++ 4.7.2 (gcc-4.7.2)
date: 392 days 6 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 *  JointHitDetector.h
 *  emptyExample
 *
 *  Created by Ryan Challinor on 5/17/11.
 *  Copyright 2011 aww bees. All rights reserved.
 *
 */
 
#pragma once
 
#include <ofMain.h>
//#include <ofxOpenNI.h>
//include "UDPMessenger.h"
 
class JointHitDetector : public IMessageReceiver
{
public:
   JointHitDetector(XnSkeletonJoint joint, XnSkeletonJoint refJoint, string name, float requiredLength = 150);
   ~JointHitDetector();
   
   void Poll(float dt);
   void Draw() const;
   
   void SetJoint(XnSkeletonJoint joint);
   void OnMessage(const ofxOscMessage& msg);
   
private:
   enum HitDirection
   {
      kHitForward,
      kHitUp,
      kHitRight,
      kHitDown,
      kHitLeft,
      kHitBack,
      kNumHitDirections
   };
   
   bool DetectHit(ofxVec3f& vDir);
   bool LongEnough(const ofxVec3f& vec) const;
   void DrawHitDirection(HitDirection hitDirection) const;
   bool MatchesDir(const ofxVec3f& vMatchDir, const ofxVec3f& vCheckDir, const ofxVec3f& vRefDir) const;
   void BroadcastTuningInfo();
   bool NeedDistFromRef() const { return mJoint == XN_SKEL_RIGHT_HAND || mJoint == XN_SKEL_LEFT_HAND; }
   
   XnSkeletonJoint mJoint;
   XnSkeletonJoint mRefJoint;
   std::vector<ofxVec3f> mPoints;
   float mHitAreaDisplay[kNumHitDirections];
   int mPointHistorySize;
   float mRequiredLength;
   string mName;
   float mMessageWorldJointPos;
   float mMessageBodyJointPos;
   float mMessageScreenJointPos;
};
 
prog.cpp:10:9: warning: #pragma once in main file
prog.cpp:12:20: error: ofMain.h: No such file or directory
prog.cpp:17: error: expected class-name before ‘{’ token
prog.cpp:19: error: expected `)' before ‘joint’
prog.cpp:25: error: ‘XnSkeletonJoint’ has not been declared
prog.cpp:26: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:26: error: ISO C++ forbids declaration of ‘ofxOscMessage’ with no type
prog.cpp:40: error: ‘ofxVec3f’ has not been declared
prog.cpp:41: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:41: error: ISO C++ forbids declaration of ‘ofxVec3f’ with no type
prog.cpp:43: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:43: error: ISO C++ forbids declaration of ‘ofxVec3f’ with no type
prog.cpp:47: error: ‘XnSkeletonJoint’ does not name a type
prog.cpp:48: error: ‘XnSkeletonJoint’ does not name a type
prog.cpp:49: error: ISO C++ forbids declaration of ‘vector’ with no type
prog.cpp:49: error: invalid use of ‘::’
prog.cpp:49: error: expected ‘;’ before ‘<’ token
prog.cpp:53: error: ‘string’ does not name a type
prog.cpp: In member function ‘bool JointHitDetector::NeedDistFromRef() const’:
prog.cpp:45: error: ‘mJoint’ was not declared in this scope
prog.cpp:45: error: ‘XN_SKEL_RIGHT_HAND’ was not declared in this scope
prog.cpp:45: error: ‘XN_SKEL_LEFT_HAND’ was not declared in this scope