95 "PELVIS",
"WAIST",
"TORSO",
"CHEST",
"NECK",
"HEAD",
"SKULL",
97 "L_EYE",
"R_EYE",
"L_BUST",
"R_BUST",
99 "L_COLLAR",
"L_SHLDR",
"L_ELBOW",
"L_WRIST",
"L_HAND",
"L_FNGRTIP",
101 "R_COLLAR",
"R_SHLDR",
"R_ELBOW",
"R_WRIST",
"R_HAND",
"R_FNGRTIP",
103 "L_HIP",
"L_KNEE",
"L_ANKLE",
"L_FOOT",
"L_TOE",
105 "R_HIP",
"R_KNEE",
"R_ANKLE",
"R_FOOT",
"R_TOE",
107 "L_FINGER",
"R_FINGER",
"FACE",
"AVATAR"
119 std::string str =
"";
148 17, 18, 19, 20, 21, 22,
149 11, 12, 13, 14, 15, 16,
158 18, 12, 19, 13, 21, 15,
160 28, 23, 29, 24, 31, 26
190 std::string str =
"";
222 11, 12, 13, 14, 15, 16,
234 11, 10, 13, 12, 15, 14
252 17, 18, 19, 20, 21, 22,
253 11, 12, 13, 14, 15, 16,
292 0, -1, 3, -1, 2, 1, -1,
294 -1, 12, 13, 15, -1, -1,
304 0, -1, 9, -1, 2, 1, -1,
316 0, -1, 1, -1, 2, 3, -1,
319 -1, 8, 9, 10, 11, -1,
372 0, -1, 3, -1, 2, -1, -1,
374 -1, 12, 13, -1, -1, -1,
375 -1, 6, 7, -1, -1, -1,
384 0, -1, 9, -1, 2, -1, -1,
386 -1, 4, 6, -1, -1, -1,
387 -1, 3, 5, -1, -1, -1,
396 0, -1, 1, -1, 2, 3, -1,
399 -1, 8, 9, 10, -1, -1,
408 0, 1, 2, 3, 4, 5, -1,
410 11, 12, 13, 14, 15, -1,
411 17, 18, 19, 20, 21, -1,
465 if (!strcasecmp(jname, (
char*)
_NiJointName[j].c_str()))
break;
656 Vector<int>* crd,
double* agl, CRingBuffer* vrg, CRingBuffer* qrg)
720 if (jnum<0)
return NULL;
723 if (frmdata==NULL)
return NULL;
726 for (
int i=0; i<frame; i++) {
727 if (frame_num!=NULL) {
728 frmdata[i].
frmn = frame_num[i];
729 frmdata[i].
msec = frame_num[i];
735 frmdata[i].
jnum = jnum;
737 if (frmdata[i].jnum>0) {
739 if (frmdata[i].jdat==NULL) {
744 for (
int j=0; j<frmdata[i].
jnum; j++) {
752 frmdata[i].
jdat = NULL;
790 if (frmdata==NULL || frm_num<=0)
return;
792 for (
int i=0; i<frm_num; i++) {
793 if (frmdata[i].jdat!=NULL) {
794 ::free(frmdata[i].jdat);
795 frmdata[i].
jdat = NULL;
925 if (rb.tmin==0.0)
return;
927 Vector<double> eul[2];
929 eul[0].set(0.0, 0.0, 0.0, 0.0, -1.0);
931 if (eul[0].c==-1.0)
return;
935 if (eul[0].x<rb.xmin) { eul[0].x = rb.xmin; chgf = TRUE;}
936 else if (eul[0].x>rb.xmax) { eul[0].x = rb.xmax; chgf = TRUE;}
937 if (eul[0].y<rb.ymin) { eul[0].y = rb.ymin; chgf = TRUE;}
938 else if (eul[0].y>rb.ymax) { eul[0].y = rb.ymax; chgf = TRUE;}
939 if (eul[0].z<rb.zmin) { eul[0].z = rb.zmin; chgf = TRUE;}
940 else if (eul[0].z>rb.zmax) { eul[0].z = rb.zmax; chgf = TRUE;}
945 if (eul[1].x<rb.xmin) { eul[1].x = rb.xmin; chgf = TRUE;}
946 else if (eul[1].x>rb.xmax) { eul[1].x = rb.xmax; chgf = TRUE;}
947 if (eul[1].y<rb.ymin) { eul[1].y = rb.ymin; chgf = TRUE;}
948 else if (eul[1].y>rb.ymax) { eul[1].y = rb.ymax; chgf = TRUE;}
949 if (eul[1].z<rb.zmin) { eul[1].z = rb.zmin; chgf = TRUE;}
950 else if (eul[1].z>rb.zmax) { eul[1].z = rb.zmax; chgf = TRUE;}
963 if (vect==NULL)
return;
965 Vector<double> vt[2];
966 vt[0].set(0.0, 0.0, 0.0, 0.0, -1.0);
969 Quaternion2ExtEulerXZY(*quat, vt);
971 vect[0].set(vt[0].element1(), vt[0].element3(), vt[0].element2());
972 vect[1].set(vt[1].element1(), vt[1].element3(), vt[1].element2());
976 Quaternion2ExtEulerYXZ(*quat, vt);
978 vect[0].set(vt[0].element2(), vt[0].element1(), vt[0].element3());
979 vect[1].set(vt[1].element2(), vt[1].element1(), vt[1].element3());
983 Quaternion2ExtEulerYZX(*quat, vt);
985 vect[0].set(vt[0].element3(), vt[0].element1(), vt[0].element2());
986 vect[1].set(vt[1].element3(), vt[1].element1(), vt[1].element2());
990 Quaternion2ExtEulerYXZ(*quat, vt);
992 vect[0].set(vt[0].element2(), vt[0].element1(), vt[0].element3());
993 vect[1].set(vt[1].element2(), vt[1].element1(), vt[1].element3());
997 Quaternion2ExtEulerYZX(*quat, vt);
999 vect[0].set(vt[0].element3(), vt[0].element1(), vt[0].element2());
1000 vect[1].set(vt[1].element3(), vt[1].element1(), vt[1].element2());
1004 Quaternion2ExtEulerZXY(*quat, vt);
1005 if (vt[0].c!=-1.0) {
1006 vect[0].set(vt[0].element2(), vt[0].element3(), vt[0].element1());
1007 vect[1].set(vt[1].element2(), vt[1].element3(), vt[1].element1());
1018 Quaternion<double> qut[2], rot[2];
1019 Vector<double> eul[2];
1022 eul[0].set(vect[0].x, vect[0].z, vect[0].y);
1023 eul[1].set(vect[1].x, vect[1].z, vect[1].y);
1024 qut[0].setExtEulerXZY(eul[0]);
1025 qut[1].setExtEulerXZY(eul[1]);
1028 eul[0].set(vect[0].y, vect[0].x, vect[0].z);
1029 eul[1].set(vect[1].y, vect[1].x, vect[1].z);
1030 qut[0].setExtEulerYXZ(eul[0]);
1031 qut[1].setExtEulerYXZ(eul[1]);
1034 eul[0].set(vect[0].y, vect[0].z, vect[0].x);
1035 eul[1].set(vect[1].y, vect[1].z, vect[1].x);
1036 qut[0].setExtEulerYZX(eul[0]);
1037 qut[1].setExtEulerYZX(eul[1]);
1040 eul[0].set(vect[0].y, vect[0].x, vect[0].z);
1041 eul[1].set(vect[1].y, vect[1].x, vect[1].z);
1042 qut[0].setExtEulerYXZ(eul[0]);
1043 qut[1].setExtEulerYXZ(eul[1]);
1046 eul[0].set(vect[0].y, vect[0].z, vect[0].x);
1047 eul[1].set(vect[1].y, vect[1].z, vect[1].x);
1048 qut[0].setExtEulerYZX(eul[0]);
1049 qut[1].setExtEulerYZX(eul[1]);
1052 eul[0].set(vect[0].z, vect[0].x, vect[0].y);
1053 eul[1].set(vect[1].z, vect[1].x, vect[1].y);
1054 qut[0].setExtEulerZXY(eul[0]);
1055 qut[1].setExtEulerZXY(eul[1]);
1059 rot[0] = qut[0]*~(*quat);
1060 rot[1] = qut[1]*~(*quat);
1062 if (rot[0].getAngle()<=rot[1].getAngle()) {
1087 DEBUG_INFO(
"DESTRUCTOR: CBaseFrameTool\n");
1143 for (
int j=0; j<jnum; j++) {
1157 for (
int j=0; j<jnum; j++) {
void clearNiJointsData(void)
Quaternion< double > niRotQuat[NI_TOTAL_JOINT_NUM]
void copyJoints2NiJoints(BOOL mirror)
Vector< double > * posVect
void connectJointsData(Vector< double > *vct, Quaternion< double > *qut, Vector< int > *crd, double *agl, CRingBuffer *vrg, CRingBuffer *qrg)
Vector< double > niPosVect[NI_TOTAL_JOINT_NUM]
double niJntAngl[NI_TOTAL_JOINT_NUM]
Quaternion< double > * rotQuat
NiFrameData * makeFramesData(int frame, int joint_num, int *frame_num)
std::string NiJointName(int n)
void NiInitRBoundJointsRotation(void)
void NiSetOpenNI2JointNums(void)
void NiSetJointEuler(int joint, Vector< double > *vect, Quaternion< double > *quat)
int JointName2NiSDK(char *jname, NiSDK_Lib lib)
void NiCorrectJointsRotation(Quaternion< double > *quat, NiSDK_Lib lib)
int NiSDKMirrorJointNum(int joint, NiSDK_Lib lib)
void NiGetJointEuler(int joint, Quaternion< double > *quat, Vector< double > *vect)
void NiCorrectJointEuler(int joint, Quaternion< double > *quat, RBound< double > rb)
int Ni2SDKPosJointNum(int joint, NiSDK_Lib lib)
void NiSetKinectJointNums(void)
void freeFramesData(NiFrameData *frmdata, int frm_num)
void NiSetOpenNIJointNums(void)
std::string NiSDK2JointName(int joint, NiSDK_Lib lib)
int Ni2SDKRotJointNum(int joint, NiSDK_Lib lib)
int NiJointNum(char *name)
Quaternion< double > quat