Example #1
0
        public TexturingInfo Clone()
        {
            var result = new TexturingInfo();

            result.Points = new HeadPoints <HeadPoint>();
            foreach (var point in Points)
            {
                result.Points.Add(point.Clone());
            }

            if (TexCoords != null)
            {
                result.TexCoords = new Vector2[TexCoords.Length];
                for (var i = 0; i < TexCoords.Length; i++)
                {
                    result.TexCoords[i] = TexCoords[i];
                }
            }

            if (Indices != null)
            {
                result.Indices = new Int32[Indices.Length];
                for (var i = 0; i < Indices.Length; i++)
                {
                    result.Indices[i] = Indices[i];
                }
            }

            return(result);
        }
Example #2
0
        public static TexturingInfo FromStream(BinaryReader br)
        {
            var result = new TexturingInfo();

            var cnt = br.ReadInt32();

            result.Points = new HeadPoints <HeadPoint>();
            for (var i = 0; i < cnt; i++)
            {
                result.Points.Add(HeadPoint.FromStream(br));
            }

            cnt = br.ReadInt32();
            if (cnt != 0)
            {
                result.TexCoords = new Vector2[cnt];
                for (var i = 0; i < cnt; i++)
                {
                    var v = new Vector2(br.ReadSingle(), br.ReadSingle());
                    result.TexCoords[i] = v;
                }
            }

            cnt            = br.ReadInt32();
            result.Indices = new int[cnt];
            for (var i = 0; i < cnt; i++)
            {
                result.Indices[i] = br.ReadInt32();
            }

            return(result);
        }