Game Development Reference
In-Depth Information
*CONTROL_TCB_ROT_KEY 0
1.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
...
}
*CONTROL_SCALE_BEZIER {
*CONTROL_BEZIER_SCALE_KEY 0
1.1700
1.1700
1.1700
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
-0.0001
-0.0001
-0.00010
...
}
}
In this simplified parser we simply get at the main control values and store
these directly.
BOOL C3DSAscii::ReadAnimation(CStdioFile &file, CToon3DObject
*obj)
{
CString line;
int start,end, frame;
TOKEN tokens[5];
VECTOR rotaxis;
double rotangle;
start = file.GetPosition();
end = GetSectionEnd(file);
while (file.GetPosition()<(UINT)end){
if (!file.ReadString(line)) return FALSE;
if (line.Find("CONTROL_BEZIER_POS_KEY")!=-1){
if (ParseTokens(line,tokens,5)<5) return FALSE;
frame = (int)(atof(tokens[1].name)/ticksperframe);
obj->SetFrame(frame);
//Swap z andy and flip the z
obj->spos.x = atof(tokens[2].name);
obj->spos.y = atof(tokens[4].name);
obj->spos.z =-atof(tokens[3].name);
obj->CreateKey(frame);
}
if (line.Find("CONTROL_TCB_ROT_KEY")!=-1){
if (ParseTokens(line,tokens,5)<5) return FALSE;
Search Nedrilad ::




Custom Search