Beispiel #1
0
        public static WTSpline ReadBinary(BinaryReader reader)
        {
            var spline = new WTSpline
            {
                Name = reader.ReadNullTerminatedString()
            };

            spline.Position = reader.ReadVector3();

            int subSplineCount = reader.ReadUInt16();

            for (int j = 0; j < subSplineCount; j++)
            {
                var subspline = WTSubSpline.ReadBinary(reader);
                spline.SubSplines.Add(subspline);
            }

            bool additionalString = reader.ReadUInt16() != 0;

            if (additionalString)
            {
                string additionalStringval = reader.ReadNullTerminatedString();
                spline.Reference = additionalStringval;
            }

            return(spline);
        }
Beispiel #2
0
        public static WTSubSpline ReadBinary(BinaryReader reader)
        {
            var subspline = new WTSubSpline();

            int subSplinePtCount = reader.ReadUInt16();

            subspline.Closed = reader.ReadByte() != 0;

            for (int k = 0; k < subSplinePtCount; k++)
            {
                subspline.Points.Add(reader.ReadVector3());
            }

            return(subspline);
        }