| 1 | using System.Xml; | 
 
 
 
 
 | 2 | using Oni.Metadata; | 
 
 
 
 
 | 3 | using Oni.Xml; | 
 
 
 
 
 | 4 |  | 
 
 
 
 
 | 5 | namespace Oni.Physics | 
 
 
 
 
 | 6 | { | 
 
 
 
 
 | 7 | internal class ObjectXmlReader | 
 
 
 
 
 | 8 | { | 
 
 
 
 
 | 9 | public static ObjectParticle ReadParticle(XmlReader xml) | 
 
 
 
 
 | 10 | { | 
 
 
 
 
 | 11 | xml.ReadStartElement("Particle"); | 
 
 
 
 
 | 12 |  | 
 
 
 
 
 | 13 | var particle = new ObjectParticle | 
 
 
 
 
 | 14 | { | 
 
 
 
 
 | 15 | ParticleClass = xml.ReadElementContentAsString("Class", ""), | 
 
 
 
 
 | 16 | Tag = xml.ReadElementContentAsString("Tag", ""), | 
 
 
 
 
 | 17 | Matrix = xml.ReadElementContentAsMatrix43("Transform"), | 
 
 
 
 
 | 18 | DecalScale = xml.ReadElementContentAsVector2("DecalScale"), | 
 
 
 
 
 | 19 | Flags = xml.ReadElementContentAsEnum<Objects.ParticleFlags>("Flags") & Objects.ParticleFlags.NotInitiallyCreated | 
 
 
 
 
 | 20 | }; | 
 
 
 
 
 | 21 |  | 
 
 
 
 
 | 22 | xml.ReadEndElement(); | 
 
 
 
 
 | 23 |  | 
 
 
 
 
 | 24 | return particle; | 
 
 
 
 
 | 25 | } | 
 
 
 
 
 | 26 | } | 
 
 
 
 
 | 27 | } |