Beispiel #1
0
void Batch::Write(Archive& ar)
{
	static int BATCH_VERSION=1;

	ar.WriteInt("version",BATCH_VERSION);
	ar.WriteInt("primitive",primitive);    	

	ar.Push("ambient" );ambient.Write (ar);ar.Pop("ambient");
	ar.Push("diffuse" );diffuse.Write (ar);ar.Pop("diffuse");
	ar.Push("specular");specular.Write(ar);ar.Pop("specular");
	ar.Push("emission");emission.Write(ar);ar.Pop("emission");
	ar.WriteFloat("shininess",shininess);

	ar.Push("matrix"   );matrix.Write(ar);ar.Pop("matrix");

	ar.Push("vertices" );ar.WriteSmartPointer(vertices);ar.Pop("vertices");
	ar.Push("normals"  );ar.WriteSmartPointer(normals );ar.Pop("normals");
	ar.Push("colors"   );ar.WriteSmartPointer(colors  );ar.Pop("colors");
	ar.WriteString("texture0",this->texture0?texture0->filename:"");
	ar.Push("texture0coords");ar.WriteSmartPointer(texture0coords);ar.Pop("texture0coords");
	ar.WriteString("texture1",this->texture1?texture1->filename:"");
	ar.Push("texture1coords");ar.WriteSmartPointer(texture1coords);ar.Pop("texture1coords");

	//important: I do not write the bounding box getBox();
}