Example #1
0
        private OBJIndex ParseOBJIndex(String token)
        {
            String[] values = token.Split('/');

            OBJIndex result = new OBJIndex();

            result.SetVertexIndex(Utils.ParseInt(values[0]) - 1);

            if (values.Length > 1)
            {
                if (!String.IsNullOrEmpty(values[1]))
                {
                    m_hasTexCoords = true;
                    result.SetTexCoordIndex(Utils.ParseInt(values[1]) - 1);
                }

                if (values.Length > 2)
                {
                    m_hasNormals = true;
                    result.SetNormalIndex(Utils.ParseInt(values[2]) - 1);
                }
            }

            return(result);
        }