Exemplo n.º 1
0
 public void UpdateVertexIndex(int oldIndex, int newIndex)
 {
     for (int index = 0; index < VertexIndexList.Count(); index++)
     {
         if (originalVertexIndexList[index] == oldIndex)
         {
             VertexIndexList[index] = newIndex;
             return;
         }
     }
 }
Exemplo n.º 2
0
        // HACKHACK this will write invalid files if there are no texture vertices in
        // the faces, need to identify that and write an alternate format
        public override string ToString()
        {
            StringBuilder b = new StringBuilder();

            b.Append("f");

            for (int i = 0; i < VertexIndexList.Count(); i++)
            {
                b.AppendFormat(" {0}/{1}", VertexIndexList[i], TextureVertexIndexList[i]);
            }

            return(b.ToString());
        }
Exemplo n.º 3
0
        public void UpdateVertexIndex(int oldIndex, int newIndex, bool retain = true)
        {
            for (int index = 0; index < VertexIndexList.Count(); index++)
            {
                if (originalVertexIndexList[index] == oldIndex)
                {
                    VertexIndexList[index] = newIndex;

                    if (!retain)
                    {
                        originalVertexIndexList[index] = newIndex;
                    }
                    return;
                }
            }
        }
Exemplo n.º 4
0
        // HACKHACK this will write invalid files if there are no texture vertices in
        // the faces, need to identify that and write an alternate format
        public override string ToString()
        {
            StringBuilder b = new StringBuilder();

            b.Append("f");

            for (int i = 0; i < VertexIndexList.Count(); i++)
            {
                if (i < TextureVertexIndexList.Length)
                {
                    b.AppendFormat(" {0}/{1}/{2}", VertexIndexList[i], TextureVertexIndexList[i], VertexNormalIndexList[i]);
                }
                else
                {
                    b.AppendFormat(" {0}", VertexIndexList[i]);
                }
            }

            return(b.ToString());
        }
Exemplo n.º 5
0
        // HACKHACK this will write invalid files if there are no texture vertices in
        // the faces, need to identify that and write an alternate format
        public string ToString(int pVertexIndexOffset = 0)
        {
            StringBuilder b = new StringBuilder();

            b.Append("f");

            for (int i = 0; i < VertexIndexList.Count(); i++)
            {
                /*if (i < TextureVertexIndexList.Length)
                 * {
                 *      b.AppendFormat(" {0}/{1}",
                 *              VertexIndexList[i] + pVertexIndexOffset,
                 *              TextureVertexIndexList[i] + pVertexIndexOffset);
                 * }
                 * else
                 * {
                 *      b.AppendFormat(" {0}", VertexIndexList[i] + pVertexIndexOffset);
                 * }*/
                b.AppendFormat(" {0}", VertexIndexList[i] + pVertexIndexOffset);
            }

            return(b.ToString());
        }