Ok,
another progress :
i'm really close to have it finished.
next_position=animation[nextframe].position; //x y z of joint positionnext_position[0]=physics_ragdoll.position.x;next_position[1]=physics_ragdoll.position.y;next_position[2]=physics_ragdoll.position.z;interpJoint.pos[0] = actualposition[0] + animTime*(position[0] - actualposition[0]);interpJoint.pos[1] = actualposition[1] + animTime*(position[1] - actualposition[1]);interpJoint.pos[2] = actualposition[2] + animTime*(position[2] - actualposition[2]);interpJoint.quat = slerp(frame.joints.quat, nextFrame.joints.quat, animTime);
// interpolate between the joints of the current frame and those of the next // frame and store them in interpFrame for ( int i=0; i < numJoints; i++ ) { Joint &interpJoint = interpFrame.joints; // linearly interpolate between joint positions float *pos1 = frame.joints.pos, *pos2 = nextFrame.joints.pos; interpJoint.pos[0] = pos1[0] + animTime*(pos2[0] - pos1[0]); interpJoint.pos[1] = pos1[1] + animTime*(pos2[1] - pos1[1]); interpJoint.pos[2] = pos1[2] + animTime*(pos2[2] - pos1[2]); interpJoint.quat = slerp(frame.joints.quat, nextFrame.joints.quat, animTime); } buildVerts(interpFrame);
for ( int i=0; i < numJoints; i++ ) { neV3 bp; bp=Bones.Body->GetPos(); //physics ragdoll joints.pos[0]=bp.X(); joints.pos[1]=bp.Y(); joints.pos[2]=bp.Z();}buildVerts();
for ( int i=0; i < numJoints; i++ ) { neV3 bp; bp=Bones.Body->GetPos(); joints.pos[0]=bp.X(); joints.pos[1]=bp.Y(); joints.pos[2]=bp.Z(); Joints.Position.Set(joints.pos); neT3 transform; transform=Bones.Body->GetTransform(); joints.pos[0]=transform.pos.X(); joints.pos[1]=transform.pos.Y(); joints.pos[2]=transform.pos.Z(); neQ qqq; qqq=Bones.Body->GetRotationQ(); joints.quat=buildQuat(qqq.X,qqq.Y,qqq.Z); joints.quat.normalize(); }