#include "NiBVHName.h" using namespace jbxl; using namespace jbxwl; /** @see llfloatermodelpreview.cpp */ tList* jbxwl::setBVHJointName(void) { tList* lt = add_bvh_name(NULL, -1, "BVH Name List"); tList* pp = lt; // NI: PELVIS, WAIST, TORSO, ....., R_TOE see NiJointsTool.cpp for (int j=0; jldat.key.buf)) { return pp->ldat.id; } pp = pp->next; } return -1; } ////////////////////////////////////////////////////////////////////////////////////////////////////// // Hierarchy tTree* jbxwl::makeBVH_SLHierarchy(void) { tTree* root = NULL; tTree* chst = NULL; tTree* head = NULL; tTree* tree = NULL; root = add_tTree_node_bystr(NULL, BVH_NODE_ROOT, 6, "hip", "PXPYPZRYRXRZ", NULL, 0); tree = add_tTree_node_bystr(root, BVH_NODE_JOINT, 3, "abdomen", "RYRXRZ", NULL, 0); chst = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "chest", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(chst, BVH_NODE_JOINT, 3, "neck", "RYRXRZ", NULL, 0); head = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "head", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(head, BVH_NODE_JOINT, 3, "mSkull", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(head, BVH_NODE_JOINT, 3, "mEyeLeft", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(head, BVH_NODE_JOINT, 3, "mEyeRight", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(chst, BVH_NODE_JOINT, 3, "lCollar", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "lShldr", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "lForeArm", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "lHand", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(chst, BVH_NODE_JOINT, 3, "rCollar", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "rShldr", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "rForeArm", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "rHand", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(root, BVH_NODE_JOINT, 3, "lThigh", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "lShin", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "mAnkleLeft", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "lFoot", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "mToeLeft", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(root, BVH_NODE_JOINT, 3, "rThigh", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "rShin", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "mAnkleRight","RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "rFoot", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "mToeRight", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); return root; } tTree* jbxwl::makeBVH_QAvHierarchy(void) { tTree* root = NULL; tTree* chst = NULL; tTree* tree = NULL; root = add_tTree_node_bystr(NULL, BVH_NODE_ROOT, 6, "hip", "PXPYPZRYRXRZ", NULL, 0); tree = add_tTree_node_bystr(root, BVH_NODE_JOINT, 3, "abdomen", "RYRXRZ", NULL, 0); chst = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "chest", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(chst, BVH_NODE_JOINT, 3, "neck", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "head", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(chst, BVH_NODE_JOINT, 3, "lCollar", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "lShldr", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "lForeArm", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "lHand", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(chst, BVH_NODE_JOINT, 3, "rCollar", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "rShldr", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "rForeArm", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "rHand", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(root, BVH_NODE_JOINT, 3, "lThigh", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "lShin", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "lFoot", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(root, BVH_NODE_JOINT, 3, "rThigh", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "rShin", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "rFoot", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); return root; } tTree* jbxwl::makeBVH_NiHierarchy(void) { tTree* root = NULL; tTree* chst = NULL; tTree* head = NULL; tTree* tree = NULL; root = add_tTree_node_bystr(NULL, BVH_NODE_ROOT, 6, "PELVIS", "PXPYPZRYRXRZ", NULL, 0); tree = add_tTree_node_bystr(root, BVH_NODE_JOINT, 3, "WAIST", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "TORSO", "RYRXRZ", NULL, 0); chst = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "CHEST", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(chst, BVH_NODE_JOINT, 3, "NECK", "RYRXRZ", NULL, 0); head = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "HEAD", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(head, BVH_NODE_JOINT, 3, "SKULL", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(head, BVH_NODE_JOINT, 3, "L_EYE", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(head, BVH_NODE_JOINT, 3, "R_EYE", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(chst, BVH_NODE_JOINT, 3, "L_BUST", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(chst, BVH_NODE_JOINT, 3, "R_BUST", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(chst, BVH_NODE_JOINT, 3, "L_COLLAR", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "L_SHLDR", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "L_ELBOW", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "L_WRIST", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "L_HAND", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "L_FNGRTIP","RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(chst, BVH_NODE_JOINT, 3, "R_COLLAR", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "R_SHLDR", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "R_ELBOW", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "R_WRIST", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "R_HAND", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "R_FNGRTIP","RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(root, BVH_NODE_JOINT, 3, "L_HIP", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "L_KNEE", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "L_ANKLE", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "L_FOOT", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "L_TOE", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); tree = add_tTree_node_bystr(root, BVH_NODE_JOINT, 3, "R_HIP", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "R_KNEE", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "R_ANKLE", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "R_FOOT", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_JOINT, 3, "R_TOE", "RYRXRZ", NULL, 0); tree = add_tTree_node_bystr(tree, BVH_NODE_END, 0, "Site", NULL, NULL, 0); return root; } double _QAV_Offset[] = { 0.000000, 0.000000, 0.000000, // ROOT hip 0.000000, 3.422050, 0.000000, // JOINT abdomen 0.000000, 8.486693, -0.684411, // JOINT chest 0.000000, 10.266162, -0.273764, // JOINT neck 0.000000, 3.148285, 0.000000, // JOINT head 0.000000, 3.148289, 0.000000, // End Site 3.422053, 6.707223, -0.821293, // JOINT lCollar 3.285171, 0.000000, 0.000000, // JOINT lShldr 10.129278, 0.000000, 0.000000, // JOINT lForeArm 8.486692, 0.000000, 0.000000, // JOINT lHand 4.106464, 0.000000, 0.000000, // End Site -3.558935, 6.707223, -0.821293, // JOINT rCollar -3.148289, 0.000000, 0.000000, // JOINT rShldr -10.266159, 0.000000, 0.000000, // JOINT rForeArm -8.349810, 0.000000, 0.000000, // JOINT rHand -4.106464, 0.000000, 0.000000, // End Site 5.338403, -1.642589, 1.368821, // JOINT lThigh -2.053232, -20.121670, 0.000000, // JOINT lShin 0.000000, -19.300380, -1.231939, // JOINT lFoot 0.000000, -2.463878, 4.653993, // End Site -5.338403, -1.642589, 1.368821, // OINT rThigh 2.053232, -20.121670, 0.000000, // JOINT rShin 0.000000, -19.300380, -1.231939, // JOINT rFoot 0.000000, -2.463878, 4.653993 // End Site }; vector jbxwl::getQAvBVHOffset(int joint) { vector vect; memset(&vect, 0, sizeof(vect)); if (joint<0) return vect; vect.x = _QAV_Offset[joint*3]; vect.y = _QAV_Offset[joint*3+1]; vect.z = _QAV_Offset[joint*3+2]; return vect; }