Game Development Reference
In-Depth Information
frame = (int)(atof(tokens[1].name)/ticksperframe);
obj->SetFrame(frame);
rotaxis.x = atof(tokens[2].name);
rotaxis.y = atof(tokens[4].name);
rotaxis.z = atof(tokens[3].name);
rotangle = atof(tokens[5].name);
AngleAxisToEuler(rotaxis, rotangle, obj->srot);
obj->CreateKey(frame);
}
if (line.Find("CONTROL_BEZIER_SCALE_KEY")!=-1){
if (ParseTokens(line,tokens,5)<5) return FALSE;
frame = (int)(atof(tokens[1].name)/ticksperframe);
obj->SetFrame(frame);
obj->sscale.x = atof(tokens[2].name);
obj->sscale.y = atof(tokens[3].name);
obj->sscale.z = atof(tokens[4].name);
obj->CreateKey(frame);
}
}
return TRUE;
}
Reading the CAMERAOBJECT section
A camera section is easily read. The important elements are the NODE_
TM, which is the same as the data for an object, and the CAMERA_FOV
component that sets up whether this is a long lens or wide angle.
BOOL C3DSAscii::ReadCamera(CStdioFile &file)
{
CString line;
int start,end;
TOKEN tokens[5];
double fov;
start = file.GetPosition();
end = GetSectionEnd(file);
while(file.GetPosition()<(UINT)end){
file.ReadString(line);
Search Nedrilad ::




Custom Search