00001
00007 #include "../SCOLBasic/SO3Loader3d.h"
00008 #include "SO3EntityFap.h"
00009 #include "SO3SkeletonBap.h"
00010 #include "SO3Scene.h"
00011 #include "../SO3Animation/SO3VertexAnimation.h"
00012
00013 namespace SO3
00014 {
00015
00016 SEntityFap::SEntityFap(SScene* parent, std::string entityName, std::string meshName, std::string pathStdFDP, std::string pathStdIndices) : SEntity(parent,std::string("General"),entityName,meshName)
00017 {
00018 verticesNeedUpdate = false;
00019 FAPs = new FAPdata();
00020 fapPoseCreated = false;
00021 nbFAPFrames = 0;
00022 animFAP = 0;
00023 hasFapPoses = false;
00024
00025
00026 for(int i=0; i<NUMBER_OF_FAPS; i++)
00027 FAPValues[i] = 0;
00028
00029 Ogre::MeshPtr faceMesh = Ogre::MeshManager::getSingleton().getByName(meshName);
00030 initFAPAnimation(faceMesh);
00031
00032 manualAnimState = getOgreEntityPointer()->getAnimationState(GetName() + "FAP_Animation");
00033 fapPoseCreated = true;
00034 }
00035
00036 SEntityFap::SEntityFap()
00037 {
00038 }
00039
00040 SEntityFap::~SEntityFap()
00041 {
00042 hasFapPoses = false;
00043 SAFE_DELETE(FAPs);
00044 }
00045
00046 void SEntityFap::readIndices(std::vector<std::vector<int> >* groups, string fileName)
00047 {
00048
00049 FILE* f;
00050 if(!(f=fopen(fileName.c_str(), "r")))
00051 {
00052 printf("ERROR: cant read \"%s\"\n", fileName.c_str());
00053 }
00054 else
00055 {
00056 groups->resize(NUMBER_OF_FAPS);
00057 char cbuf[10000];
00058 sprintf_s(cbuf,10000,"");
00059 int v, size;
00060 for(int i=1;i<NUMBER_OF_FAPS;i++)
00061 {
00062
00063 while(cbuf[0]!='#') fgets(cbuf,10000,f);
00064 sscanf(cbuf, "# %d", &v);
00065
00066
00067 fgets(cbuf,10000,f);
00068 sscanf(cbuf,"SIZE %d", &size);
00069
00070
00071 (*groups)[v].resize(3*size);
00072
00073
00074 for(int j=0;j<size;j++)
00075 {
00076 fgets(cbuf,10000,f);
00077 sscanf(cbuf,"%d %d %d", &((*groups)[v][j*3]), &((*groups)[v][j*3+1]), &((*groups)[v][j*3+2]));
00078 }
00079 }
00080 fclose(f);
00081 }
00082 }
00083
00084 void SEntityFap::readFDPs(std::vector<std::vector<Ogre::Vector3> >* FDPs, std::vector<Ogre::Vector3>* vertices, Ogre::String fileName)
00085 {
00086
00087 FILE* f;
00088 if(!(f=fopen(fileName.c_str(),"r")))
00089 {
00090 printf("FDP ERROR: cant read %s\n", fileName.c_str());
00091 }
00092 else
00093 {
00094 FDPs->clear();
00095 FDPs->resize(11);
00096 char cbuf[1024];
00097
00098
00099 fgets(cbuf,1024,f);
00100
00101 while(strcmp(cbuf,"#START\n"))
00102 fgets(cbuf,1024,f);
00103
00104 for(int i=2;i<=11;i++)
00105 {
00106 int id, size;
00107 fgets(cbuf,1024,f);
00108 sscanf(cbuf, "GROUP %d %d", &id, &size);
00109 (*FDPs)[id].resize(size+1);
00110 }
00111
00112 while(strcmp(cbuf,"END\n")!=0)
00113 fgets(cbuf,1024,f);
00114
00115 while(cbuf[0]=='#')
00116 fgets(cbuf,1024,f);
00117
00118
00119 float f0, f1, f2;
00120 int ref;
00121 for(unsigned int i=2;i<(*FDPs).size();i++)
00122 {
00123 fgets(cbuf,1024,f);
00124 for(unsigned int j=1;j<(*FDPs)[i].size();j++)
00125 {
00126 fgets(cbuf,1024,f);
00127 sscanf(cbuf, "%f %f %f #%i", &f0, &f1, &f2, &ref);
00128
00129 if(ref<0)
00130 (*FDPs)[i][j] = Ogre::Vector3(f0,f1,f2);
00131 else
00132 (*FDPs)[i][j] = (*vertices)[ref];
00133 }
00134 }
00135 fclose(f);
00136 }
00137 }
00138
00139 void SEntityFap::clear(std::vector<bool>* v)
00140 {
00141 for(unsigned int i=0;i<v->size();i++)
00142 (*v)[i]=false;
00143 }
00144
00145 void SEntityFap::add(std::vector<bool>* v, std::vector<int>* indices)
00146 {
00147 for (unsigned int i=0;i<indices->size();i++)
00148 (*v)[(*indices)[i]] = true;
00149 }
00150
00151 void SEntityFap::createPose2(Ogre::Pose* pose, std::vector<Ogre::Vector3>* geomety, std::vector<bool>* zones, Ogre::Vector3* FDP, axeType axe, double x, double y, double z, double div, double coef)
00152 {
00153 double val;
00154 double x_ = 0;
00155 double y_ = 0;
00156 double z_ = 0;
00157 double* axe_ = &x_;
00158 if (axe==Y) axe_ = &y_;
00159 if (axe==Z) axe_ = &z_;
00160 Ogre::Pose::VertexOffsetMap offsets = pose->getVertexOffsets();
00161 for(unsigned int i=0;i<zones->size();i++)
00162 {
00163 if((*zones)[i])
00164 {
00165 val = sqrt( pow(((*geomety)[i].x-FDP->x),2) *x +
00166 pow(((*geomety)[i].y-FDP->y),2) *y +
00167 pow(((*geomety)[i].z-FDP->z),2) *z )
00168 / div;
00169
00170 if(val<SO3_PI/4.0)
00171 {
00172 *axe_ = (cos(val)-sqrt(2.0)/2.0)*3.41*coef;
00173
00174
00175
00176
00177 if(offsets.count(i) == 0)
00178 {
00179 pose->addVertex(i,Ogre::Vector3(x_,y_,z_));
00180 }
00181 else
00182 {
00183
00184 pose->addVertex(i,offsets[i]+Ogre::Vector3(x_,y_,z_));
00185 }
00186
00187
00188 }
00189 }
00190 }
00191 }
00192
00193 void SEntityFap::clearAndAdd(std::vector<bool>* v, std::vector<std::vector<int> >* groups, int numberOfGroups,...)
00194 {
00195 va_list varg;
00196 this->clear(v);
00197 va_start(varg, numberOfGroups);
00198
00199 for(int i=0; i<numberOfGroups; i++)
00200 add(v,&((*groups)[va_arg(varg, int)]));
00201
00202 va_end(varg);
00203 }
00204
00205 void SEntityFap::createPose(Ogre::Pose* pose, std::vector<Ogre::Vector3>* geomety, std::vector<bool>* zones, Ogre::Vector3* FDP, axeType axe, double x, double y, double z, double div, double coef, int power,double pi_)
00206 {
00207 double val;
00208 double x_ = 0;
00209 double y_ = 0;
00210 double z_ = 0;
00211 double* axe_ = &x_;
00212 double scalex = O3SceneNode->getScale().x;
00213 double scaley = O3SceneNode->getScale().y;
00214 double scalez = O3SceneNode->getScale().z;
00215
00216
00217 div = div/(2*(O3SceneNode->getScale().x));
00218
00219 if (axe==Y)
00220 axe_ = &y_;
00221
00222 if (axe==Z)
00223 axe_ = &z_;
00224
00225 Ogre::Pose::VertexOffsetMap offsets = pose->getVertexOffsets();
00226 for(unsigned int i=0;i<zones->size();i++)
00227 {
00228 if((*zones)[i])
00229 {
00230 val = sqrt( pow(((*geomety)[i].x-FDP->x),2) *x +
00231 pow(((*geomety)[i].y-FDP->y),2) *y +
00232 pow(((*geomety)[i].z-FDP->z),2) *z )
00233 / div;
00234
00235 if(val<pi_)
00236 {
00237 *axe_ = pow((1.0+cos(val))*0.5,power)*coef;
00238 if(offsets.count(i)==0)
00239 pose->addVertex(i,Ogre::Vector3(x_,y_,z_));
00240 else
00241 pose->addVertex(i,offsets[i]+Ogre::Vector3(x_,y_,z_));
00242 }
00243 }
00244 }
00245 }
00246
00247 void SEntityFap::scalepose(Ogre::Pose* pose, std::vector<bool>* zones, axeType axe, double factor)
00248 {
00249 double x_ = 1;
00250 double y_ = 1;
00251 double z_ = 1;
00252 double* axe_ = &x_;
00253
00254 if (axe==Y)
00255 axe_ = &y_;
00256
00257 if (axe==Z)
00258 axe_ = &z_;
00259
00260 *axe_ = factor;
00261 Ogre::Pose::VertexOffsetMap offsets = pose->getVertexOffsets();
00262 for(unsigned int i=0;i<zones->size();i++)
00263 {
00264 if((*zones)[i])
00265 {
00266 if(offsets.count(i)!=0)
00267 pose->addVertex(i,Ogre::Vector3(offsets[i].x * x_,
00268 offsets[i].y * y_,
00269 offsets[i].z * z_));
00270
00271 }
00272 }
00273 }
00274
00275 void SEntityFap::initFapMesh(Ogre::MeshPtr faceMesh, std::string pathStdFDP, std::string pathStdIndices)
00276 {
00277
00278 unsigned short target = faceMesh->getSubMesh(0)->useSharedVertices ? 0 : 1;
00279
00280 std::vector<Ogre::Vector3> vertices;
00281 getSubMeshVertices(&vertices, 0, faceMesh) ;
00282
00283
00284 std::vector<bool> verticesInPose;
00285 verticesInPose.resize(vertices.size());
00286
00287
00288 std::vector<std::vector<int>> groups;
00289 readIndices(&groups,pathStdIndices.c_str());
00290
00291
00292 readFDPs(&(FDPs), &vertices, pathStdFDP.c_str());
00293
00294
00295 IRISD0 = FDPs[3][1].distance(FDPs[3][3]) / 1024.0;
00296
00297 IRISD = fabs(FDPs[3][1].y - FDPs[3][3].y) / 1024.0;
00298 ES = fabs(((FDPs[3][1].x - FDPs[3][2].x) + (FDPs[3][3].x - FDPs[3][4].x)) / 2) / 1024.0;
00299 ENS = fabs((FDPs[3][1].y + FDPs[3][3].y + FDPs[3][2].y + FDPs[3][4].y ) / 4 - FDPs[9][15].y) / 1024;
00300 MNS = fabs(FDPs[9][15].y - FDPs[2][2].y) / 1024.0;
00301 MW = fabs(FDPs[8][3].x - FDPs[8][4].x) / 1024.0;
00302 MH = fabs(FDPs[8][1].y - FDPs[8][2].y) / 1024.0;
00303 LCB = fabs(FDPs[8][3].z - FDPs[5][1].z) / 1024.0;
00304 RCB = fabs(FDPs[8][4].z - FDPs[5][2].z) / 1024.0;
00305 LLP = fabs(FDPs[8][2].z - FDPs[2][10].z) / 1024.0;
00306 ULP = fabs(FDPs[8][1].z - FDPs[9][15].z) / 1024.0;
00307 FI = fabs((FDPs[4][1].z + FDPs[4][2].z) / 2 - FDPs[6][1].z) / 1024.0;
00308 JH = fabs(FDPs[8][2].y - FDPs[2][1].y) / 1024.0;
00309 UL = fabs(FDPs[8][1].y - FDPs[2][2].y) / 1024.0;
00310 LL = fabs(FDPs[8][2].y - FDPs[2][3].y) / 1024.0;
00311
00312 numberOfPoses = 46;
00313 poses = (Ogre::Pose**) malloc(sizeof(Ogre::Pose*)*(numberOfPoses));
00314 indexOfPose = (int*) malloc(sizeof(int)*(numberOfPoses));
00315 FAPOfPoses = (int*) malloc(sizeof(int)*(numberOfPoses));
00316
00317
00318
00319
00320 int poseIndex = 0;
00321 poses[0] = faceMesh->createPose(target,"FAP_3");
00322 FAPOfPoses[0] = 3;
00323 indexOfPose[0] = poseIndex++;
00324 clearAndAdd(&verticesInPose, &groups, 20, 1, 2, 39, 40, 41, 42, 43, 44, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 67, 68);
00325 createPose(poses[0],&vertices,&verticesInPose, &(FDPs[2][1]), Y, 1.0/16.0, 1, 0.25, 3.5, -(MNS));
00326
00327 poses[1] = faceMesh->createPose(target,"FAP_4");
00328 FAPOfPoses[1] = 4;
00329 indexOfPose[1] = poseIndex++;
00330 clearAndAdd(&verticesInPose,&groups,14, 33, 34, 35, 36, 37, 38, 45, 46, 47, 48, 49, 50, 51, 52);
00331 createPose(poses[1],&vertices,&verticesInPose, &(FDPs[2][2]), Y, 1.0/3.0, 0.1, 1, 1, -0.72*(MNS));
00332
00333 poses[2] = faceMesh->createPose(target,"FAP_5");
00334 FAPOfPoses[2] = 5;
00335 indexOfPose[2] = poseIndex++;
00336 clearAndAdd(&verticesInPose,&groups,10, 41, 42, 43, 44, 55, 56, 57, 58, 59, 60);
00337 createPose(poses[2],&vertices,&verticesInPose, &(FDPs[2][3]), Y, 1, 4, 1, 1.5, 0.561*(MH));
00338
00339 FAP_6 = faceMesh->createPose(target,"FAP_6");
00340 index_Pose_FAP_6 = poseIndex++;
00341 clearAndAdd(&verticesInPose,&groups, 13, 1, 33, 35, 37, 39, 41, 43, 47, 49, 51, 53, 55, 59);
00342 createPose(FAP_6,&vertices,&verticesInPose, &(FDPs[2][4]), X, 1, 1, 1, 1, -0.3*(MNS), 2);
00343
00344 FAP_7 = faceMesh->createPose(target,"FAP_7");
00345 index_Pose_FAP_7 = poseIndex++;
00346 clearAndAdd(&verticesInPose,&groups, 13, 2, 34, 36, 38, 40, 42, 44, 48, 50, 52, 54, 56, 60);
00347 createPose(FAP_7,&vertices,&verticesInPose, &(FDPs[2][5]), X, 1, 1, 1, 1, 0.3*(MNS), 2);
00348
00349 poses[3] = faceMesh->createPose(target,"FAP_8");
00350 FAPOfPoses[3] = 8;
00351 indexOfPose[3] = poseIndex++;
00352 clearAndAdd(&verticesInPose,&groups,14, 33, 34, 35, 36, 37, 38, 45, 46, 47, 48, 49, 50, 51, 52);
00353 createPose(poses[3],&vertices,&verticesInPose, &(FDPs[2][6]), Y, 0.1, 0.5, 0.2, 1, -0.3*(MNS), 4);
00354
00355 poses[4] = faceMesh->createPose(target,"FAP_9");
00356 FAPOfPoses[4] = 9;
00357 indexOfPose[4] = poseIndex++;
00358 createPose(poses[4],&vertices,&verticesInPose, &(FDPs[2][7]), Y, 0.1, 0.5, 0.2, 1, -0.3*(MNS), 4);
00359
00360 poses[5] = faceMesh->createPose(target,"FAP_10");
00361 FAPOfPoses[5] = 10;
00362 indexOfPose[5] = poseIndex++;
00363 clearAndAdd(&verticesInPose,&groups,14, 39, 40, 41, 42, 43, 44, 51, 52, 53, 54, 55, 56, 57, 58);
00364 createPose(poses[5],&vertices,&verticesInPose, &(FDPs[2][9]), Y, 1, 2, 1.0/1.1, 1.5, 0.3*(MNS));
00365
00366 poses[6] = faceMesh->createPose(target,"FAP_11");
00367 FAPOfPoses[6] = 11;
00368 indexOfPose[6] = poseIndex++;
00369 createPose(poses[6],&vertices,&verticesInPose, &(FDPs[2][8]), Y, 1, 2, 1.0/1.1, 1.5, 0.3*(MNS));
00370
00371 FAP_12_0 = faceMesh->createPose(target,"FAP_12_0");
00372 index_Pose_FAP_12_0 = poseIndex++;
00373 clearAndAdd(&verticesInPose,&groups, 13, 1, 33, 35, 37, 39, 41, 43, 47, 49, 51, 53, 55, 59);
00374 createPose(FAP_12_0,&vertices,&verticesInPose, &(FDPs[2][4]),Y, 1, 1, 1, 1, 0.3*(MNS), 2);
00375 FAP_12_1 = faceMesh->createPose(target,"FAP_12_1");
00376 index_Pose_FAP_12_1 = poseIndex++;
00377 createPose(FAP_12_1,&vertices,&verticesInPose, &(FDPs[2][4]),Z, 1, 1, 1, 1, -0.09*(LCB), 2);
00378
00379 FAP_13_0 = faceMesh->createPose(target,"FAP_13_0");
00380 index_Pose_FAP_13_0 = poseIndex++;
00381 clearAndAdd(&verticesInPose,&groups, 13, 2, 34, 36, 38, 40, 42, 44, 48, 50, 52, 54, 56, 60);
00382 createPose(FAP_13_0,&vertices,&verticesInPose, &(FDPs[2][5]), Y, 1, 1, 1, 1, 0.3*(MNS), 2);
00383 FAP_13_1 = faceMesh->createPose(target,"FAP_13_1");
00384 index_Pose_FAP_13_1 = poseIndex++;
00385 createPose(FAP_13_1,&vertices,&verticesInPose, &(FDPs[2][5]),Z, 1, 1, 1, 1, -0.09*(LCB), 2);
00386
00387 poses[7] = faceMesh->createPose(target,"FAP_14");
00388 FAPOfPoses[7] = 14;
00389 indexOfPose[7] = poseIndex++;
00390 clearAndAdd(&verticesInPose,&groups,19, 1, 2, 39, 40, 41, 42, 43, 44, 51, 52, 53, 55, 56, 57, 58, 59, 60, 67, 68);
00391 createPose(poses[7],&vertices,&verticesInPose, &(FDPs[2][1]), Z, 1.0/16.0, 1, 0.25, 3.5, (MNS));
00392
00393 poses[8] = faceMesh->createPose(target,"FAP_15");
00394 FAPOfPoses[8] = 15;
00395 indexOfPose[8] = poseIndex++;
00396 createPose(poses[8],&vertices,&verticesInPose, &(FDPs[2][1]), X, 1.0/16.0, 1, 0.25, 3.5, -(MNS));
00397
00398 poses[9] = faceMesh->createPose(target,"FAP_16");
00399 FAPOfPoses[9] = 16;
00400 indexOfPose[9] = poseIndex++;
00401 clearAndAdd(&verticesInPose,&groups,10, 41, 42, 43, 44, 55, 56, 57, 58, 59, 60);
00402 createPose(poses[9],&vertices,&verticesInPose, &(FDPs[2][3]), Z, 1, 4, 1, 1.5, 3.523*(LLP));
00403 add(&verticesInPose,&(groups[39]));add(&verticesInPose,&(groups[40]));add(&verticesInPose,&(groups[51]));
00404 add(&verticesInPose,&(groups[52]));add(&verticesInPose,&(groups[52]));add(&verticesInPose,&(groups[54]));
00405 createPose(poses[9],&vertices,&verticesInPose, &(FDPs[8][2]), Z, 0.2, 3, 1, 1.5, 1.761*(LLP));
00406
00407 poses[10] = faceMesh->createPose(target,"FAP_17");
00408 FAPOfPoses[10] = 17;
00409 indexOfPose[10] = poseIndex++;
00410 clearAndAdd(&verticesInPose,&groups,14, 33, 34, 35, 36, 37, 38, 45, 46, 47, 48, 49, 50, 51, 52);
00411 createPose(poses[10],&vertices,&verticesInPose, &(FDPs[2][2]), Z, 1.0/3.0, 0.1, 1, 1, (ULP));
00412 add(&verticesInPose,&(groups[3]));add(&verticesInPose,&(groups[4]));
00413 createPose(poses[10],&vertices,&verticesInPose, &(FDPs[8][1]), Z, 1, 7, 1, 2.5, 0.2*(MNS));
00414
00415 poses[11] = faceMesh->createPose(target,"FAP_18");
00416 FAPOfPoses[11] = 18;
00417 indexOfPose[11] = poseIndex++;
00418 clearAndAdd(&verticesInPose,&groups,18, 39, 40, 41, 42, 43, 44, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 67, 68);
00419 createPose(poses[11],&vertices,&verticesInPose, &(FDPs[2][10]), Y, 1.0/12.0, 1, 1, 1, (MNS));
00420 createPose(poses[11],&vertices,&verticesInPose, &(FDPs[2][10]), Z, 1.0/12.0, 1, 1, 1, 1.057*(LLP));
00421
00422 poses[12] = faceMesh->createPose(target,"FAP_19");
00423 FAPOfPoses[12] = 19;
00424 indexOfPose[12] = poseIndex++;
00425 clearAndAdd(&verticesInPose, &groups, 2, 9, 11);
00426 createPose2(poses[12],&vertices,&verticesInPose, &(FDPs[3][1]), Y, 1.0, 1.0, 1.0, 5.3, -(IRISD));
00427 clearAndAdd(&verticesInPose, &groups, 1, 11);
00428 scalepose(poses[12],&verticesInPose,Y,0.4);
00429
00430
00431 poses[13] = faceMesh->createPose(target,"FAP_20");
00432 FAPOfPoses[13] = 20;
00433 indexOfPose[13] = poseIndex++;
00434 clearAndAdd(&verticesInPose, &groups, 2, 10,12);
00435 createPose2(poses[13],&vertices,&verticesInPose, &(FDPs[3][2]), Y, 1.0, 1.0, 1.0, 5.3, -(IRISD));
00436 clearAndAdd(&verticesInPose, &groups, 1, 12);
00437 scalepose(poses[13],&verticesInPose,Y,0.4);
00438
00439
00440 poses[14] = faceMesh->createPose(target,"FAP_21");
00441 FAPOfPoses[14] = 21;
00442 indexOfPose[14] = poseIndex++;
00443 clearAndAdd(&verticesInPose, &groups, 2, 5, 7);
00444 createPose2(poses[14],&vertices,&verticesInPose, &(FDPs[3][3]), Y, 1.0, 1.0, 1.0, 5.3, (IRISD));
00445 clearAndAdd(&verticesInPose, &groups, 1, 7);
00446 scalepose(poses[14],&verticesInPose,Y,0.4);
00447
00448
00449 poses[15] = faceMesh->createPose(target,"FAP_22");
00450 FAPOfPoses[15] = 22;
00451 indexOfPose[15] = poseIndex++;
00452 clearAndAdd(&verticesInPose, &groups, 2, 6, 8);
00453 createPose2(poses[15],&vertices,&verticesInPose, &(FDPs[3][4]), Y, 1.0, 1.0, 1.0, 5.3, (IRISD));
00454 clearAndAdd(&verticesInPose, &groups, 1, 8);
00455 scalepose(poses[15],&verticesInPose,Y,0.4);
00456
00457
00458
00459 poses[16] = faceMesh->createPose(target,"FAP_31");
00460 FAPOfPoses[16] = 31;
00461 indexOfPose[16] = poseIndex++;
00462 clearAndAdd(&verticesInPose, &groups, 8, 13, 15, 19, 21, 27, 29, 31,11);
00463 createPose(poses[16],&vertices,&verticesInPose, &(FDPs[4][1]), Y, 1.7, 0.5, 1, 2.6, (ENS), 2);
00464 FAP_31_ = faceMesh->createPose(target,"FAP_31_");
00465 index_Pose_FAP_31_ = poseIndex++;
00466
00467 createPose(FAP_31_,&vertices,&verticesInPose, &(FDPs[4][1]), Z, 1.7, 0.5, 1, 2.6, 0.1*(FI), 2);
00468 clearAndAdd(&verticesInPose, &groups, 1, 11);
00469 scalepose(poses[16],&verticesInPose,Y,0.5);
00470
00471
00472 poses[17] = faceMesh->createPose(target,"FAP_32");
00473 FAPOfPoses[17] = 32;
00474 indexOfPose[17] = poseIndex++;
00475 clearAndAdd(&verticesInPose, &groups, 8, 14, 16, 20, 22, 28, 30, 32, 12);
00476 createPose(poses[17],&vertices,&verticesInPose, &(FDPs[4][2]), Y, 1.7, 0.5, 1, 2.6, (ENS), 2);
00477 FAP_32_ = faceMesh->createPose(target,"FAP_32_");
00478 index_Pose_FAP_32_ = poseIndex++;
00479
00480 createPose(FAP_32_,&vertices,&verticesInPose, &(FDPs[4][2]), Z, 1.7, 0.5, 1, 2.6, 0.1*(FI), 2);
00481 clearAndAdd(&verticesInPose, &groups, 1, 12);
00482 scalepose(poses[17],&verticesInPose,Y,0.5);
00483
00484
00485 poses[18] = faceMesh->createPose(target,"FAP_33");
00486 FAPOfPoses[18] = 33;
00487 indexOfPose[18] = poseIndex++;
00488 clearAndAdd(&verticesInPose, &groups, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 11);
00489 createPose(poses[18],&vertices,&verticesInPose, &(FDPs[4][3]), Y, 2, 0.5, 1, 3.5, (ENS), 2);
00490 FAP_33_ = faceMesh->createPose(target,"FAP_33_");
00491 index_Pose_FAP_33_ = poseIndex++;
00492
00493 createPose(FAP_33_,&vertices,&verticesInPose, &(FDPs[4][3]), Z, 2, 0.5, 1, 3.5, 0.1*(FI), 2);
00494 clearAndAdd(&verticesInPose, &groups, 1, 11);
00495 scalepose(poses[18],&verticesInPose,Y,0.6);
00496
00497
00498 poses[19] = faceMesh->createPose(target,"FAP_34");
00499 FAPOfPoses[19] = 34;
00500 indexOfPose[19] = poseIndex++;
00501 clearAndAdd(&verticesInPose, &groups, 11, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 12);
00502 createPose(poses[19],&vertices,&verticesInPose, &(FDPs[4][4]), Y, 2.0, 0.5, 1.0, 3.5, (ENS), 2);
00503 FAP_34_ = faceMesh->createPose(target,"FAP_34_");
00504 index_Pose_FAP_34_ = poseIndex++;
00505
00506 createPose(FAP_34_,&vertices,&verticesInPose, &(FDPs[4][4]), Z, 2.0, 0.5, 1.0, 3.5, 0.1*(FI), 2);
00507 clearAndAdd(&verticesInPose, &groups, 1, 12);
00508 scalepose(poses[19],&verticesInPose,Y,0.6);
00509
00510
00511 poses[20] = faceMesh->createPose(target,"FAP_35");
00512 FAPOfPoses[20] = 35;
00513 indexOfPose[20] = poseIndex++;
00514 clearAndAdd(&verticesInPose, &groups, 8, 15, 17, 21, 23, 25, 27, 31, 11);
00515 createPose(poses[20],&vertices,&verticesInPose, &(FDPs[4][5]), Y, 1, 1, 1, 3, (ENS), 2);
00516 FAP_35_ = faceMesh->createPose(target,"FAP_35_");
00517 index_Pose_FAP_35_ = poseIndex++;
00518
00519 createPose(FAP_35_,&vertices,&verticesInPose, &(FDPs[4][5]), Z, 1, 1, 1, 3, 0.3*(FI), 2);
00520 clearAndAdd(&verticesInPose, &groups, 1, 11);
00521 scalepose(poses[20],&verticesInPose,Y,0.3);
00522
00523
00524 poses[21] = faceMesh->createPose(target,"FAP_36");
00525 FAPOfPoses[21] = 36;
00526 indexOfPose[21] = poseIndex++;
00527 clearAndAdd(&verticesInPose, &groups, 8, 16, 18, 22, 24, 26, 28, 32, 12);
00528 createPose(poses[21],&vertices,&verticesInPose, &(FDPs[4][6]), Y, 1, 1, 1, 3, (ENS), 2);
00529 FAP_36_ = faceMesh->createPose(target,"FAP_36_");
00530 index_Pose_FAP_36_ = poseIndex++;
00531
00532 createPose(FAP_36_,&vertices,&verticesInPose, &(FDPs[4][6]), Z, 1, 1, 1, 3, 0.3*(FI), 2);
00533 clearAndAdd(&verticesInPose, &groups, 1, 12);
00534 scalepose(poses[21],&verticesInPose,Y,0.3);
00535
00536
00537 poses[22] = faceMesh->createPose(target,"FAP_37");
00538 FAPOfPoses[22] = 37;
00539 indexOfPose[22] = poseIndex++;
00540 clearAndAdd(&verticesInPose, &groups, 2, 19, 29);
00541 createPose(poses[22],&vertices,&verticesInPose, &(FDPs[4][1]), Z, 10, 2.0/3.0, 1, 2.3, 0.4*(ENS), 1, SO3_PI/2.0);
00542
00543
00544
00546 clearAndAdd(&verticesInPose, &groups, 8, 11, 13, 15, 19, 21, 27, 29, 31);
00547 createPose(poses[22],&vertices,&verticesInPose, &(FDPs[4][1]), Z, 1.7, 0.5, 1, 2.6, 0.119*(FI), 2);
00548 createPose(poses[22],&vertices,&verticesInPose, &(FDPs[4][1]), X, 1.7, 0.5, 1, 2.6, -(ENS), 4);
00549 clearAndAdd(&verticesInPose, &groups, 11, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31);
00550 createPose(poses[22],&vertices,&verticesInPose, &(FDPs[4][3]), X, 2, 0.5, 1, 3.5, -0.576*(ES), 2);
00551
00552
00553
00554 poses[23] = faceMesh->createPose(target,"FAP_38");
00555 FAPOfPoses[23] = 38;
00556 indexOfPose[23] = poseIndex++;
00557 clearAndAdd(&verticesInPose, &groups, 2, 20, 30);
00558 createPose(poses[23],&vertices,&verticesInPose, &(FDPs[4][2]), Z, 10, 20/3.0, 1, 2.3, 0.4*(ENS), 1, SO3_PI/2.0);
00559
00560
00561
00562
00563 clearAndAdd(&verticesInPose, &groups, 8, 12, 14, 16, 20, 22, 28, 30, 32);
00564 createPose(poses[23],&vertices,&verticesInPose, &(FDPs[4][2]), Z, 1.7, 0.5, 1, 2.6, 0.119*(FI), 2);
00565 createPose(poses[23],&vertices,&verticesInPose, &(FDPs[4][2]), X, 1.7, 0.5, 1, 2.6, (ENS), 4);
00566 clearAndAdd(&verticesInPose, &groups, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32);
00567 createPose(poses[23],&vertices,&verticesInPose, &(FDPs[4][4]), X, 2, 0.5, 1, 3.5, 0.576*(ES), 2);
00568
00569
00570
00571 poses[24] = faceMesh->createPose(target,"FAP_39");
00572 FAPOfPoses[24] = 39;
00573 indexOfPose[24] = poseIndex++;
00574 clearAndAdd(&verticesInPose, &groups, 12, 1, 35, 37, 39, 41, 47, 49, 51, 53, 55, 59, 67);
00575 createPose(poses[24],&vertices,&verticesInPose, &(FDPs[5][1]), X, 1, 0.5, 1, 3, (ENS), 2);
00576 FAP_39_ = faceMesh->createPose(target,"FAP_39_");
00577 index_Pose_FAP_39_ = poseIndex++;
00578 createPose(FAP_39_,&vertices,&verticesInPose, &(FDPs[5][1]), Z, 1, 0.5, 1, 3, 0.5*(LCB), 2);
00579
00580 poses[25] = faceMesh->createPose(target,"FAP_40");
00581 FAPOfPoses[25] = 40;
00582 indexOfPose[25] = poseIndex++;
00583 clearAndAdd(&verticesInPose, &groups, 12, 2, 36, 38, 40, 42, 48, 50, 52, 54, 56, 60, 68);
00584 createPose(poses[25],&vertices,&verticesInPose, &(FDPs[5][2]), X, 1, 0.5, 1, 3, -(ENS), 2);
00585 FAP_40_ = faceMesh->createPose(target,"FAP_40_");
00586 index_Pose_FAP_40_ = poseIndex++;
00587 createPose(FAP_40_,&vertices,&verticesInPose, &(FDPs[5][2]), Z, 1, 0.5, 1, 3, 0.5*(RCB), 2);
00588
00589 poses[26] = faceMesh->createPose(target,"FAP_41");
00590 FAPOfPoses[26] = 41;
00591 indexOfPose[26] = poseIndex++;
00592 clearAndAdd(&verticesInPose, &groups, 5, 1, 3, 7, 49, 51);
00593 createPose(poses[26],&vertices,&verticesInPose, &(FDPs[5][3]), Y, 1, 1, 1, 3, (ENS), 2);
00594 FAP_41_0 = faceMesh->createPose(target,"FAP_41_0");
00595 index_Pose_FAP_41_0 = poseIndex++;
00596 createPose(FAP_41_0,&vertices,&verticesInPose, &(FDPs[5][3]), Z, 1, 1, 1, 3, 0.5*(LCB), 2);
00597 FAP_41_1 = faceMesh->createPose(target,"FAP_41_1");
00598 index_Pose_FAP_41_1 = poseIndex++;
00599 createPose(FAP_41_1,&vertices,&verticesInPose, &(FDPs[5][3]), Z, 1, 1, 1, 3, -0.1*(LCB), 2);
00600
00601 poses[27] = faceMesh->createPose(target,"FAP_42");
00602 FAPOfPoses[27] = 42;
00603 indexOfPose[27] = poseIndex++;
00604 clearAndAdd(&verticesInPose, &groups, 5, 2, 4, 8, 50, 52);
00605 createPose(poses[27],&vertices,&verticesInPose, &(FDPs[5][4]), Y, 1, 1, 1, 3, (ENS), 2);
00606 FAP_42_0 = faceMesh->createPose(target,"FAP_42_0");
00607 index_Pose_FAP_42_0 = poseIndex++;
00608 createPose(FAP_42_0,&vertices,&verticesInPose, &(FDPs[5][4]), Z, 1, 1, 1, 3, 0.5*(RCB), 2);
00609 FAP_42_1 = faceMesh->createPose(target,"FAP_42_1");
00610 index_Pose_FAP_42_1 = poseIndex++;
00611 createPose(FAP_42_1,&vertices,&verticesInPose, &(FDPs[5][4]), Z, 1, 1, 1, 3, -0.1*(RCB), 2);
00612
00613
00614
00615 poses[28] = faceMesh->createPose(target,"FAP_51");
00616 FAPOfPoses[28] = 51;
00617 indexOfPose[28] = poseIndex++;
00618 clearAndAdd(&verticesInPose, &groups, 16, 3, 4, 33, 34, 35, 36, 37, 38, 45, 46, 47, 48, 49, 50, 51, 52);
00619 createPose(poses[28],&vertices,&verticesInPose, &(FDPs[8][1]), Y, 1, 7, 1, 2.5, -1.8*(UL));
00620
00621 poses[29] = faceMesh->createPose(target,"FAP_52");
00622 FAPOfPoses[29] = 52;
00623 indexOfPose[29] = poseIndex++;
00624 clearAndAdd(&verticesInPose, &groups, 16, 39, 40, 41, 42, 43, 44, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60);
00625 createPose(poses[29],&vertices,&verticesInPose, &(FDPs[8][2]), Y, 0.2, 3, 1, 1.5, 0.7*(LL));
00626
00627 poses[30] = faceMesh->createPose(target,"FAP_53");
00628 FAPOfPoses[30] = 53;
00629 indexOfPose[30] = poseIndex++;
00630 clearAndAdd(&verticesInPose, &groups, 15, 1, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59);
00631 createPose(poses[30],&vertices,&verticesInPose, &(FDPs[8][3]), X, 1, 1, 1, 3, (MW), 2);
00632 createPose(poses[30],&vertices,&verticesInPose, &(FDPs[8][3]), Z, 1, 1, 1, 3, -3.0*(LCB), 2);
00633 clearAndAdd(&verticesInPose, &groups, 16, 3, 4, 33, 34, 35, 36, 37, 38, 45, 46, 47, 48, 49, 50, 51, 52);
00634 createPose(poses[30],&vertices,&verticesInPose, &(FDPs[8][1]), Y, 1, 7, 1, 2.5, -0.06*(MW));
00635 clearAndAdd(&verticesInPose, &groups, 7, 33, 35, 37, 45, 47, 49, 51);
00636 createPose(poses[30],&vertices,&verticesInPose, &(FDPs[8][5]), Y, 1, 1.5, 1, 1.5, -0.03*(MW));
00637 createPose(poses[30],&vertices,&verticesInPose, &(FDPs[8][5]), X, 1, 1.5, 1, 1.5, 0.08*(MW));
00638 clearAndAdd(&verticesInPose, &groups, 7, 34, 36, 38, 46, 48, 50, 52);
00639 createPose(poses[30],&vertices,&verticesInPose, &(FDPs[8][6]), Y, 1, 1.5, 1, 1.5, -0.03*(MW));
00640 createPose(poses[30],&vertices,&verticesInPose, &(FDPs[8][6]), X, 1, 1.5, 1, 1.5, -0.08*(MW));
00641 clearAndAdd(&verticesInPose, &groups, 7, 39, 41, 43, 53, 55, 57, 59);
00642 createPose(poses[30],&vertices,&verticesInPose, &(FDPs[8][7]), Y, 1, 1.5, 1, 1.5, 0.03*(MW));
00643 clearAndAdd(&verticesInPose, &groups, 7, 40, 42, 44, 54, 56, 58, 60);
00644 createPose(poses[30],&vertices,&verticesInPose, &(FDPs[8][8]), Y, 1, 1.5, 1, 1.5, 0.03*(MW));
00645 clearAndAdd(&verticesInPose, &groups, 14, 39, 40, 41, 42, 43, 44, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60);
00646 createPose(poses[30],&vertices,&verticesInPose, &(FDPs[8][2]), Y, 1.0/3.0, 2, 1, 1.5, 0.08*(MW));
00647
00648 poses[31] = faceMesh->createPose(target,"FAP_54");
00649 FAPOfPoses[31] = 54;
00650 indexOfPose[31] = poseIndex++;
00651 createPose(poses[31],&vertices,&verticesInPose, &(FDPs[8][2]), Y, 1.0/3.0, 2, 1, 1.5, 0.08*(MW));
00652 clearAndAdd(&verticesInPose, &groups, 15, 2, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60);
00653 createPose(poses[31],&vertices,&verticesInPose, &(FDPs[8][4]), X, 1, 1, 1, 3, -(MW), 2);
00654 createPose(poses[31],&vertices,&verticesInPose, &(FDPs[8][4]), Z, 1, 1, 1, 3, -3.0*(RCB), 2);
00655 clearAndAdd(&verticesInPose, &groups, 16, 3, 4, 33, 34, 35, 36, 37, 38, 45, 46, 47, 48, 49, 50, 51, 52);
00656 createPose(poses[31],&vertices,&verticesInPose, &(FDPs[8][1]), Y, 1, 7, 1, 2.5, -0.06*(MW));
00657 clearAndAdd(&verticesInPose, &groups, 7, 33, 35, 37, 45, 47, 49, 51);
00658 createPose(poses[31],&vertices,&verticesInPose, &(FDPs[8][5]), Y, 1, 1.5, 1, 1.5, -0.03*(MW));
00659 createPose(poses[31],&vertices,&verticesInPose, &(FDPs[8][5]), X, 1, 1.5, 1, 1.5, 0.08*(MW));
00660 clearAndAdd(&verticesInPose, &groups, 7, 34, 36, 38, 46, 48, 50, 52);
00661 createPose(poses[31],&vertices,&verticesInPose, &(FDPs[8][6]), Y, 1, 1.5, 1, 1.5, -0.03*(MW));
00662 createPose(poses[31],&vertices,&verticesInPose, &(FDPs[8][6]), X, 1, 1.5, 1, 1.5, -0.08*(MW));
00663 clearAndAdd(&verticesInPose, &groups, 7, 39, 41, 43, 53, 55, 57, 59);
00664 createPose(poses[31],&vertices,&verticesInPose, &(FDPs[8][7]), Y, 1, 1.5, 1, 1.5, 0.03*(MW));
00665 clearAndAdd(&verticesInPose, &groups, 7, 40, 42, 44, 54, 56, 58, 60);
00666 createPose(poses[31],&vertices,&verticesInPose, &(FDPs[8][8]), Y, 1, 1.5, 1, 1.5, 0.03*(MW));
00667
00668 poses[32] = faceMesh->createPose(target,"FAP_55");
00669 FAPOfPoses[32] = 55;
00670 indexOfPose[32] = poseIndex++;
00671 clearAndAdd(&verticesInPose, &groups, 7, 33, 35, 37, 45, 47, 49, 51);
00672 createPose(poses[32],&vertices,&verticesInPose, &(FDPs[8][5]), Y, 1, 1.5, 1, 1.5, -0.9*(UL));
00673 FAP_55_ = faceMesh->createPose(target,"FAP_55_");
00674 index_Pose_FAP_55_ = poseIndex++;
00675 clearAndAdd(&verticesInPose, &groups, 1, 3);
00676 createPose(FAP_55_,&vertices,&verticesInPose, &(FDPs[9][1]), Y, 1, 1, 1, 1, -0.5*(MNS));
00677 add(&verticesInPose,&(groups[1]));add(&verticesInPose,&(groups[7]));
00678 createPose(FAP_55_,&vertices,&verticesInPose, &(FDPs[5][3]), X, 1, 1, 1, 2.2, 0.2*(MNS));
00679 createPose(FAP_55_,&vertices,&verticesInPose, &(FDPs[5][3]), Z, 1, 1, 1, 2.2, -0.2*(MNS));
00680
00681 poses[33] = faceMesh->createPose(target,"FAP_56");
00682 FAPOfPoses[33] = 56;
00683 indexOfPose[33] = poseIndex++;
00684 clearAndAdd(&verticesInPose, &groups, 7, 34, 36, 38, 46, 48, 50, 52);
00685 createPose(poses[33],&vertices,&verticesInPose, &(FDPs[8][6]), Y, 1, 1.5, 1, 1.5, -0.9*(UL));
00686 FAP_56_ = faceMesh->createPose(target,"FAP_56_");
00687 index_Pose_FAP_56_ = poseIndex++;
00688 clearAndAdd(&verticesInPose, &groups, 1, 4);
00689 createPose(FAP_56_,&vertices,&verticesInPose, &(FDPs[9][2]), Y, 1, 1, 1, 1, -0.5*(MNS));
00690 add(&verticesInPose,&(groups[2]));add(&verticesInPose,&(groups[8]));
00691 createPose(FAP_56_,&vertices,&verticesInPose, &(FDPs[5][4]), X, 1, 1, 1, 2.2, -0.2*(MNS));
00692 createPose(FAP_56_,&vertices,&verticesInPose, &(FDPs[5][4]), Z, 1, 1, 1, 2.2, -0.2*(MNS));
00693
00694 poses[34] = faceMesh->createPose(target,"FAP_57");
00695 FAPOfPoses[34] = 57;
00696 indexOfPose[34] = poseIndex++;
00697 clearAndAdd(&verticesInPose, &groups, 7, 39, 41, 43, 53, 55, 57, 59);
00698 createPose(poses[34],&vertices,&verticesInPose, &(FDPs[8][7]), Y, 1, 1.5, 1, 1.5, 0.1*(LL));
00699
00700 poses[35] = faceMesh->createPose(target,"FAP_58");
00701 FAPOfPoses[35] = 58;
00702 indexOfPose[35] = poseIndex++;
00703 clearAndAdd(&verticesInPose, &groups, 7, 40, 42, 44, 54, 56, 58, 60);
00704 createPose(poses[35],&vertices,&verticesInPose, &(FDPs[8][8]), Y, 1, 1.5, 1, 1.5, 0.1*(LL));
00705
00706 poses[36] = faceMesh->createPose(target,"FAP_59");
00707 FAPOfPoses[36] = 59;
00708 indexOfPose[36] = poseIndex++;
00709 clearAndAdd(&verticesInPose, &groups, 15, 1, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59);
00710 createPose(poses[36],&vertices,&verticesInPose, &(FDPs[8][3]), Y, 1, 1, 1, 3, (MNS), 2);
00711 FAP_59_ = faceMesh->createPose(target,"FAP_59_");
00712 index_Pose_FAP_59_ = poseIndex++;
00713 clearAndAdd(&verticesInPose, &groups, 3, 1,3,7);
00714 createPose(FAP_59_,&vertices,&verticesInPose, &(FDPs[5][3]), X, 1, 1, 1, 2.2, -0.2*(MNS));
00715 createPose(FAP_59_,&vertices,&verticesInPose, &(FDPs[5][3]), Z, 1, 1, 1, 2.2, 0.2*(MNS));
00716
00717 poses[37] = faceMesh->createPose(target,"FAP_60");
00718 FAPOfPoses[37] = 60;
00719 indexOfPose[37] = poseIndex++;
00720 clearAndAdd(&verticesInPose, &groups, 15, 2, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60);
00721 createPose(poses[37],&vertices,&verticesInPose, &(FDPs[8][4]), Y, 1, 1, 1, 3, (MNS), 2);
00722 FAP_60_ = faceMesh->createPose(target,"FAP_60_");
00723 index_Pose_FAP_60_ = poseIndex++;
00724 clearAndAdd(&verticesInPose, &groups, 3, 2,4,8);
00725 createPose(FAP_60_,&vertices,&verticesInPose, &(FDPs[5][4]), X, 1, 1, 1, 2.2, 0.2*(MNS));
00726 createPose(FAP_60_,&vertices,&verticesInPose, &(FDPs[5][4]), Z, 1, 1, 1, 2.2, 0.2*(MNS));
00727
00728 poses[38] = faceMesh->createPose(target,"FAP_61");
00729 FAPOfPoses[38] = 61;
00730 indexOfPose[38] = poseIndex++;
00731 clearAndAdd(&verticesInPose, &groups, 1, 3);
00732 createPose(poses[38],&vertices,&verticesInPose, &(FDPs[9][1]), X, 1, 1, 1, 1, (ENS));
00733
00734 poses[39] = faceMesh->createPose(target,"FAP_62");
00735 FAPOfPoses[39] = 62;
00736 indexOfPose[39] = poseIndex++;
00737 clearAndAdd(&verticesInPose, &groups, 1, 4);
00738 createPose(poses[39],&vertices,&verticesInPose, &(FDPs[9][2]),X, 1, 1, 1, 1, -(ENS));
00739
00740 poses[40] = faceMesh->createPose(target,"FAP_63");
00741 FAPOfPoses[40] = 63;
00742 indexOfPose[40] = poseIndex++;
00743 clearAndAdd(&verticesInPose, &groups, 2, 3,4);
00744 createPose(poses[40],&vertices,&verticesInPose, &(FDPs[9][3]), Y, 1, 0.25, 1, 1.5, (ENS));
00745
00746 poses[41] = faceMesh->createPose(target,"FAP_64");
00747 FAPOfPoses[41] = 64;
00748 indexOfPose[41] = poseIndex++;
00749 createPose(poses[41],&vertices,&verticesInPose, &(FDPs[9][3]), X, 1, 0.25, 1, 1.5, -(ENS));
00750
00751 poses[42] = faceMesh->createPose(target,"FAP_65");
00752 FAPOfPoses[42] = 65;
00753 indexOfPose[42] = poseIndex++;
00754 clearAndAdd(&verticesInPose, &groups, 1, 61);
00755 createPose(poses[42],&vertices,&verticesInPose, &(FDPs[10][1]), Y, 8, 1, 1, 4, (ENS));
00756
00757 poses[43] = faceMesh->createPose(target,"FAP_66");
00758 FAPOfPoses[43] = 66;
00759 indexOfPose[43] = poseIndex++;
00760 clearAndAdd(&verticesInPose, &groups, 1, 62);
00761 createPose(poses[43],&vertices,&verticesInPose, &(FDPs[10][2]), Y, 8, 1, 1, 4, (ENS));
00762
00763 poses[44] = faceMesh->createPose(target,"FAP_67");
00764 FAPOfPoses[44] = 67;
00765 indexOfPose[44] = poseIndex++;
00766 clearAndAdd(&verticesInPose, &groups, 1, 61);
00767 createPose(poses[44],&vertices,&verticesInPose, &(FDPs[10][3]), X, 8, 1, 1, 4, (ENS));
00768
00769 poses[45] = faceMesh->createPose(target,"FAP_68");
00770 FAPOfPoses[45] = 68;
00771 indexOfPose[45] = poseIndex++;
00772 clearAndAdd(&verticesInPose, &groups, 1, 62);
00773 createPose(poses[45],&vertices,&verticesInPose, &(FDPs[10][4]), X, 8, 1, 1, 4, -(ENS));
00774
00775 Ogre::VertexData* vdata = faceMesh->getSubMesh(0)->vertexData;
00776
00777
00778 #if OGRE_VERSION < ((1 << 16) | (8 << 8) | 0)
00779 Ogre::VertexDeclaration* newdcl = vdata->vertexDeclaration->getAutoOrganisedDeclaration(false, true);
00780 #else
00781 Ogre::VertexDeclaration* newdcl = vdata->vertexDeclaration->getAutoOrganisedDeclaration(false, true, false);
00782 #endif
00783 vdata->reorganiseBuffers(newdcl);
00784 }
00785
00786 void SEntityFap::initFAPAnimation(Ogre::MeshPtr faceMesh)
00787 {
00788 std::string fapAnimationName = name + "FAP_Animation";
00789
00790
00791 Ogre::Animation* newOgreAnimation = faceMesh->createAnimation(fapAnimationName, 1);
00792 Ogre::VertexAnimationTrack* newOgreAnimationTrack = newOgreAnimation->createVertexTrack(1, Ogre::VAT_POSE);
00793 Ogre::VertexPoseKeyFrame* newOgreKeyFrame = newOgreAnimationTrack->createVertexPoseKeyFrame(0);
00794 newOgreKeyFrame->addPoseReference(0, 0.0);
00795
00796
00797 SAnim* newAnimation = new SVertexAnimation(GetParentScene(), fapAnimationName, this, 1);
00798 AddAnimation(newAnimation);
00799 }
00800
00801 void SEntityFap::playFAPFrame()
00802 {
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007
01008 }
01009
01010 bool SEntityFap::linkToBone(SNode* parentBone)
01011 {
01012
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023
01024
01025
01026
01027
01028
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043 return true;
01044 }
01045
01046 }