コード例 #1
0
 public PhysicsInertiaData(PhysicsInertiaData source)
 {
     TotalMass       = source.TotalMass;
     CenterOfMass    = source.CenterOfMass;
     Inertia         = source.Inertia;
     InertiaRotation = source.InertiaRotation;
 }
コード例 #2
0
        public static PhysicsInertiaData FromXml2(string text)
        {
            if (text == String.Empty)
            {
                return(null);
            }

            bool error;
            PhysicsInertiaData v;
            UTF8Encoding       enc = new UTF8Encoding();

            using (MemoryStream ms = new MemoryStream(enc.GetBytes(text)))
                using (XmlTextReader xreader = new XmlTextReader(ms))
                {
                    xreader.ProhibitDtd = true;

                    v = new PhysicsInertiaData();
                    v.FromXml2(xreader, out error);
                }

            if (error)
            {
                return(null);
            }

            return(v);
        }
コード例 #3
0
        public static PhysicsInertiaData FromXml2(string text)
        {
            if (text == String.Empty)
            {
                return(null);
            }

            UTF8Encoding  enc     = new UTF8Encoding();
            MemoryStream  ms      = new MemoryStream(enc.GetBytes(text));
            XmlTextReader xreader = new XmlTextReader(ms);

            PhysicsInertiaData v = new PhysicsInertiaData();
            bool error;

            v.FromXml2(xreader, out error);

            xreader.Close();

            if (error)
            {
                return(null);
            }

            return(v);
        }
コード例 #4
0
        public static PhysicsInertiaData FromXml2(XmlReader reader)
        {
            PhysicsInertiaData data = new PhysicsInertiaData();

            bool errors = false;

            data.FromXml2(reader, out errors);
            if (errors)
            {
                return(null);
            }

            return(data);
        }