|
From: julien r. <jul...@us...> - 2004-09-28 18:03:21
|
Update of /cvsroot/epfl/tgengine-0.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4663 Modified Files: md5instance.cc md5mesh10.h scenemanager.h vshader.h Log Message: GetCamera() Index: md5mesh10.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/md5mesh10.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** md5mesh10.h 26 Sep 2004 13:15:24 -0000 1.1.1.1 --- md5mesh10.h 28 Sep 2004 18:03:12 -0000 1.2 *************** *** 61,64 **** --- 61,71 ---- inline int anim_joint_GetParent (int i, int j) { return pAnimations[i].pJointInfos[j].iParent; } inline int anim_joint_GetFlags (int i, int j) { return pAnimations[i].pJointInfos[j].iFlags; } + /*inline bool anim_joint_IsX (int i, int j) { return pAnimations[i].pJointInfos[i].iFlags.X; } + inline bool anim_joint_IsY (int i, int j) { return pAnimations[i].pJointInfos[i].iFlags.Y; } + inline bool anim_joint_IsZ (int i, int j) { return pAnimations[i].pJointInfos[i].iFlags.Z; } + inline bool anim_joint_IsQX (int i, int j) { return pAnimations[i].pJointInfos[i].iFlags.QX; } + inline bool anim_joint_IsQY (int i, int j) { return pAnimations[i].pJointInfos[i].iFlags.QY; } + inline bool anim_joint_IsQZ (int i, int j) { return pAnimations[i].pJointInfos[i].iFlags.QZ; }*/ + inline int anim_joint_GetStartIndex (int i, int j) { return pAnimations[i].pJointInfos[j].iStartIndex; } *************** *** 79,82 **** --- 86,105 ---- std::vector<_MD5Anim> pAnimations; + /*struct _MD5Attribute + { + union + { + struct + { + int X:1; + int Y:1; + int Z:1; + int QX:1; + int QY:1; + int QZ:1; + }; + int flag; + }; + };*/ struct _MD5Anim *************** *** 92,100 **** { int iParent; ! int iFlags; //les flags indiquant quelles composantes du bone sont animees int iStartIndex; }; _MD5JointInfos* pJointInfos; //un tableau de iNumJoints }; struct _MD5Joint --- 115,126 ---- { int iParent; ! //_MD5Attribute iFlags; //les flags indiquant quelles composantes du bone sont animees ! int iFlags; int iStartIndex; }; _MD5JointInfos* pJointInfos; //un tableau de iNumJoints }; + + struct _MD5Joint Index: scenemanager.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/scenemanager.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** scenemanager.h 26 Sep 2004 13:15:15 -0000 1.1.1.1 --- scenemanager.h 28 Sep 2004 18:03:12 -0000 1.2 *************** *** 40,43 **** --- 40,44 ---- void SetCamera (Camera* pcam); + Camera* GetCamera() { return pCamera; } void AddParticlesEmitter (ParticleEmitter* p, std::string name); void RemoveParticlesEmitter (std::string name); Index: vshader.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/vshader.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** vshader.h 28 Sep 2004 09:44:26 -0000 1.4 --- vshader.h 28 Sep 2004 18:03:12 -0000 1.5 *************** *** 25,27 **** } ! #endif \ No newline at end of file --- 25,28 ---- } ! #endif ! Index: md5instance.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/md5instance.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** md5instance.cc 27 Sep 2004 14:45:59 -0000 1.3 --- md5instance.cc 28 Sep 2004 18:03:12 -0000 1.4 *************** *** 87,90 **** --- 87,91 ---- fPreviousTime = fCurrentTime; iFrame++; + //std::cout << "frame " << iFrame << std::endl; if (iFrame >= pData->anim_GetNumFrames(iCurrentAnimation)) iFrame = 0; *************** *** 153,169 **** - /* next variables are unused int flags = pData->anim_joint_GetFlags(iCurrentAnimation, pJoint->iNumber); int n=0; int sIndex = pData->anim_joint_GetStartIndex(iCurrentAnimation, pJoint->iNumber); ! bool bR=false; //doit-on recalculer 'r' du quaternion ? ! */ //glPushMatrix (); // std::cout << "flags : " << std::endl; ! #if 0 if (flags & 1) //Tx est anime { ! //std::cout << "Tx" << std::endl; animatedPosition.x = pData->anim_GetFrameElement(iCurrentAnimation, iFrame, sIndex+n); n++; --- 154,168 ---- int flags = pData->anim_joint_GetFlags(iCurrentAnimation, pJoint->iNumber); int n=0; int sIndex = pData->anim_joint_GetStartIndex(iCurrentAnimation, pJoint->iNumber); ! //glPushMatrix (); // std::cout << "flags : " << std::endl; ! //std::cout << "joint : " << pJoint->iNumber << std::endl; if (flags & 1) //Tx est anime { ! // std::cout << "Tx"; animatedPosition.x = pData->anim_GetFrameElement(iCurrentAnimation, iFrame, sIndex+n); n++; *************** *** 171,175 **** if (flags & 2) //Ty est anime { ! //std::cout << "Ty" << std::endl; animatedPosition.y = pData->anim_GetFrameElement(iCurrentAnimation, iFrame, sIndex+n); n++; --- 170,174 ---- if (flags & 2) //Ty est anime { ! // std::cout << " Ty"; animatedPosition.y = pData->anim_GetFrameElement(iCurrentAnimation, iFrame, sIndex+n); n++; *************** *** 177,181 **** if (flags & 4) //Tz est anime { ! //std::cout << "Tz" << std::endl; animatedPosition.z = pData->anim_GetFrameElement(iCurrentAnimation, iFrame, sIndex+n); n++; --- 176,180 ---- if (flags & 4) //Tz est anime { ! // std::cout << " Tz"; animatedPosition.z = pData->anim_GetFrameElement(iCurrentAnimation, iFrame, sIndex+n); n++; *************** *** 183,206 **** if (flags & 8) //Qx est anime { ! //std::cout << "Qx" << std::endl; animatedOrientation.x = pData->anim_GetFrameElement(iCurrentAnimation, iFrame, sIndex+n); n++; - bR = true; } if (flags & 16) //Qy est anime { ! //std::cout << "Qy" << std::endl; animatedOrientation.y = pData->anim_GetFrameElement(iCurrentAnimation, iFrame, sIndex+n); n++; - bR = true; } if (flags & 32) //Qz est anime { ! //std::cout << "Qz" << std::endl; animatedOrientation.z = pData->anim_GetFrameElement(iCurrentAnimation, iFrame, sIndex+n); n++; - bR = true; } ! #endif animatedOrientation.ComputeR(); if (pJoint->iParent < 0) //pas de parent --- 182,203 ---- if (flags & 8) //Qx est anime { ! // std::cout << " Qx"; animatedOrientation.x = pData->anim_GetFrameElement(iCurrentAnimation, iFrame, sIndex+n); n++; } if (flags & 16) //Qy est anime { ! // std::cout << " Qy"; animatedOrientation.y = pData->anim_GetFrameElement(iCurrentAnimation, iFrame, sIndex+n); n++; } if (flags & 32) //Qz est anime { ! // std::cout << " Qz"; animatedOrientation.z = pData->anim_GetFrameElement(iCurrentAnimation, iFrame, sIndex+n); n++; } ! //std::cout << std::endl; ! animatedOrientation.ComputeR(); if (pJoint->iParent < 0) //pas de parent *************** *** 215,219 **** pJoint->qOrientation = animatedOrientation*q; } ! for (int i = 0; i < pJoint->iNumChildrens; i++) { --- 212,217 ---- pJoint->qOrientation = animatedOrientation*q; } ! ! //std::cout << pJoint->vPosition << std::endl; for (int i = 0; i < pJoint->iNumChildrens; i++) { |