Esempio n. 1
0
 protected internal override Matrix Deserialize(XmlListReader input)
 {
     if (input == null)
     {
         throw new ArgumentNullException("input");
     }
     return(new Matrix
     {
         M11 = MathTypeSerializer <Matrix> .ReadSingle(input),
         M12 = MathTypeSerializer <Matrix> .ReadSingle(input),
         M13 = MathTypeSerializer <Matrix> .ReadSingle(input),
         M14 = MathTypeSerializer <Matrix> .ReadSingle(input),
         M21 = MathTypeSerializer <Matrix> .ReadSingle(input),
         M22 = MathTypeSerializer <Matrix> .ReadSingle(input),
         M23 = MathTypeSerializer <Matrix> .ReadSingle(input),
         M24 = MathTypeSerializer <Matrix> .ReadSingle(input),
         M31 = MathTypeSerializer <Matrix> .ReadSingle(input),
         M32 = MathTypeSerializer <Matrix> .ReadSingle(input),
         M33 = MathTypeSerializer <Matrix> .ReadSingle(input),
         M34 = MathTypeSerializer <Matrix> .ReadSingle(input),
         M41 = MathTypeSerializer <Matrix> .ReadSingle(input),
         M42 = MathTypeSerializer <Matrix> .ReadSingle(input),
         M43 = MathTypeSerializer <Matrix> .ReadSingle(input),
         M44 = MathTypeSerializer <Matrix> .ReadSingle(input)
     });
 }
        protected internal override void Serialize(IntermediateWriter output, Vector2 value, ContentSerializerAttribute format)
        {
            if (output == null)
            {
                throw new ArgumentNullException("output");
            }
            MathTypeSerializer <Vector2> .WritePart(output, value.X);

            MathTypeSerializer <Vector2> .WriteLast(output, value.Y);
        }
 protected internal override Vector2 Deserialize(XmlListReader input)
 {
     if (input == null)
     {
         throw new ArgumentNullException("input");
     }
     return(new Vector2
     {
         X = MathTypeSerializer <Vector2> .ReadSingle(input),
         Y = MathTypeSerializer <Vector2> .ReadSingle(input)
     });
 }
Esempio n. 4
0
 protected internal override Quaternion Deserialize(XmlListReader input)
 {
     if (input == null)
     {
         throw new ArgumentNullException("input");
     }
     return(new Quaternion
     {
         X = MathTypeSerializer <Quaternion> .ReadSingle(input),
         Y = MathTypeSerializer <Quaternion> .ReadSingle(input),
         Z = MathTypeSerializer <Quaternion> .ReadSingle(input),
         W = MathTypeSerializer <Quaternion> .ReadSingle(input)
     });
 }
Esempio n. 5
0
        protected internal override Plane Deserialize(XmlListReader input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }
            Plane result = default(Plane);

            result.Normal.X = MathTypeSerializer <Plane> .ReadSingle(input);

            result.Normal.Y = MathTypeSerializer <Plane> .ReadSingle(input);

            result.Normal.Z = MathTypeSerializer <Plane> .ReadSingle(input);

            result.D = MathTypeSerializer <Plane> .ReadSingle(input);

            return(result);
        }
        protected internal override CurveKey Deserialize(XmlListReader input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }
            float position = MathTypeSerializer <CurveKey> .ReadSingle(input);

            float value = MathTypeSerializer <CurveKey> .ReadSingle(input);

            float tangentIn = MathTypeSerializer <CurveKey> .ReadSingle(input);

            float tangentOut = MathTypeSerializer <CurveKey> .ReadSingle(input);

            CurveContinuity continuity = (CurveContinuity)Enum.Parse(typeof(CurveContinuity), input.ReadString());

            return(new CurveKey(position, value, tangentIn, tangentOut, continuity));
        }
        protected internal override void Serialize(IntermediateWriter output, CurveKey value, ContentSerializerAttribute format)
        {
            if (output == null)
            {
                throw new ArgumentNullException("output");
            }
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            MathTypeSerializer <CurveKey> .WritePart(output, value.Position);

            MathTypeSerializer <CurveKey> .WritePart(output, value.Value);

            MathTypeSerializer <CurveKey> .WritePart(output, value.TangentIn);

            MathTypeSerializer <CurveKey> .WritePart(output, value.TangentOut);

            output.Xml.WriteString(value.Continuity.ToString());
        }
Esempio n. 8
0
        protected internal override void Serialize(IntermediateWriter output, Matrix value, ContentSerializerAttribute format)
        {
            if (output == null)
            {
                throw new ArgumentNullException("output");
            }
            MathTypeSerializer <Matrix> .WritePart(output, value.M11);

            MathTypeSerializer <Matrix> .WritePart(output, value.M12);

            MathTypeSerializer <Matrix> .WritePart(output, value.M13);

            MathTypeSerializer <Matrix> .WritePart(output, value.M14);

            MathTypeSerializer <Matrix> .WritePart(output, value.M21);

            MathTypeSerializer <Matrix> .WritePart(output, value.M22);

            MathTypeSerializer <Matrix> .WritePart(output, value.M23);

            MathTypeSerializer <Matrix> .WritePart(output, value.M24);

            MathTypeSerializer <Matrix> .WritePart(output, value.M31);

            MathTypeSerializer <Matrix> .WritePart(output, value.M32);

            MathTypeSerializer <Matrix> .WritePart(output, value.M33);

            MathTypeSerializer <Matrix> .WritePart(output, value.M34);

            MathTypeSerializer <Matrix> .WritePart(output, value.M41);

            MathTypeSerializer <Matrix> .WritePart(output, value.M42);

            MathTypeSerializer <Matrix> .WritePart(output, value.M43);

            MathTypeSerializer <Matrix> .WriteLast(output, value.M44);
        }