SharpNav.PolyMesh.AddVertex C# (CSharp) Method

AddVertex() private static method

Generate a new vertices with (x, y, z) coordiates and return the hash code index
private static AddVertex ( int>.Dictionary vertDict, PolyVertex v, List verts ) : int
vertDict int>.Dictionary Vertex dictionary that maps coordinates to index
v PolyVertex A vertex.
verts List The list of vertices
return int
        private static int AddVertex(Dictionary<PolyVertex, int> vertDict, PolyVertex v, List<PolyVertex> verts)
        {
            int index;
            if (vertDict.TryGetValue(v, out index))
            {
                return index;
            }

            index = verts.Count;
            verts.Add(v);
            vertDict.Add(v, index);
            return index;
        }