Game Development Reference
In-Depth Information
//Load the motion
//Look for the MOTION key word if it is not found before the end
//of the file then the current bone hierarchy is cleared and the
//function returns.
while (1){
if (!file.ReadString(str)){
bones.ClearAll();
return;
}
if (str.Find(”MOTION”)!=-1) break;
}
//Read frame total and frame time
file.ReadString(str);
str = str.Right(str.GetLength()-7);
frames = atoi(LPCTSTR(str));
file.ReadString(str);
str = str.Right(str.GetLength()-11);
frametime = atof(LPCTSTR(str));
CBone *bone = bones.next;
char *cp;
//For each bone create storage for the key values
while(bone){
if (!bone->CreateKeys(frames)){
bones.ClearAll();
return;
}
bone = bone->next;
}
//Store the keys into all active channels available
for (int i=0; i<frames; i++){
file.ReadString(str);
cp = str.GetBuffer(0);
bone = bones.next;
while (bone){
cp = bone->SetKey(i, cp);
Search Nedrilad ::




Custom Search