Serialization?

Topics: Developer Forum
Jan 7, 2008 at 11:10 PM

Anyone have a suggestion on how I could go about serializing to disk the state of my current physics simulation?

Thanks, Andy.
Jan 8, 2008 at 8:14 PM
You could create your own Serializable classes like this below:

Serializable
public class xmlBody
{
public List<xmlGeom> XMLGeom;

public string Tag;

public float AngularVelocity = 0;
public bool IgnoreGravity = false;
public bool IsStatic = false;
public float LinearDragCoefficient = 0;
public Vector2 LinearVelocity = new Vector2(0, 0);
public float Mass = 0;
public float MomentOfInertia = 0;
public Vector2 Position = new Vector2(0, 0);
public float Rotation = 0;
public float RotationalDragCoefficient = 0;

public xmlBody()
{
XMLGeom = new List<xmlGeom>();
}
}