Skeleton::Skeleton(char* filenameASF, char* filenameAMC) { jointsOn = true; sceneAxisOn = true; jointAxisOn = true; floorOn = false; headOn = true; numBones = 1; numOfFrames = 0; buffSize = 200; maxBones = 60; angle = 0; floorMode = 2; currentCharacter = 0; root = (bone*) malloc(sizeof(bone) * maxBones); for (int i = 0; i < 60; i++) { root[i].numChildren = 0; root[i].dirx = 0; root[i].diry = 0; root[i].dirz = 0; root[i].rotx = 0; root[i].roty = 0; root[i].rotz = 0; root[i].dof = DOF_NONE; root[i].length = 0; root[i].name = NULL; root[i].children = (bone**) malloc(sizeof(bone*) * 5); //Challenge stuff root[i].currentTranslatex = 0; root[i].currentTranslatey = 0; root[i].currentTranslatez = 0; root[i].currentRotationx = 0; root[i].currentRotationy = 0; root[i].currentRotationz = 0; } char*name = (char*) malloc(sizeof(char) * 5); name[0] = 'r'; name[1] = name[2] = 'o'; name[3] = 't'; name[4] = '\0'; root[0].name = name; root[0].dof = DOF_ROOT; readASF(filenameASF); // Read in the AMC file, store as frames. FILE* amc = fopen(filenameAMC, "r"); readAMC(amc); }
Skeleton::Skeleton(char* filename) { numBones = 1; buffSize = 200; maxBones = 60; angle = 0; root = (bone*) malloc(sizeof(bone) * maxBones); for (int i = 0; i < 60; i++) { root[i].numChildren = 0; root[i].dirx = 0; root[i].diry = 0; root[i].dirz = 0; root[i].rotx = 0; root[i].roty = 0; root[i].rotz = 0; root[i].dof = DOF_NONE; root[i].length = 0; root[i].name = NULL; root[i].children = (bone**) malloc(sizeof(bone*) * 5); //Challenge stuff root[i].currentTranslatex = 0; root[i].currentTranslatey = 0; root[i].currentTranslatez = 0; root[i].currentRotationx = 0; root[i].currentRotationy = 0; root[i].currentRotationz = 0; } char*name = (char*) malloc(sizeof(char) * 5); name[0] = 'r'; name[1] = name[2] = 'o'; name[3] = 't'; name[4] = '\0'; root[0].name = name; root[0].dof = DOF_ROOT; readASF(filename); }