private FaceVertex ParseFaceVertex(string vertexString) { var fields = vertexString.Split(new[]{'/'}, StringSplitOptions.None); var vertexIndex = fields[0].ParseInvariantInt(); var faceVertex = new FaceVertex(vertexIndex, 0, 0); if(fields.Length > 1) { var textureIndex = fields[1].Length == 0 ? 0 : fields[1].ParseInvariantInt(); faceVertex.TextureIndex = textureIndex; } if(fields.Length > 2) { var normalIndex = fields.Length > 2 && fields[2].Length == 0 ? 0 : fields[2].ParseInvariantInt(); faceVertex.NormalIndex = normalIndex; } return faceVertex; }
public void AddVertex(FaceVertex vertex) { _vertices.Add(vertex); }