public void AddQuad(ref Vertex2D a, ref Vertex2D b, ref Vertex2D c, ref Vertex2D d) { while (indexCount + 6 > indices.Length) { Array.Resize(ref indices, indexCount * 2); } int i = vertexCount; indices[indexCount++] = i; indices[indexCount++] = i + 1; indices[indexCount++] = i + 2; indices[indexCount++] = i; indices[indexCount++] = i + 2; indices[indexCount++] = i + 3; //AddVertices(ref a, ref b, ref c, ref d); while (vertexCount + 4 > vertices.Length) { Array.Resize(ref vertices, vertexCount * 2); } a.CopyTo(out vertices[vertexCount++]); b.CopyTo(out vertices[vertexCount++]); c.CopyTo(out vertices[vertexCount++]); d.CopyTo(out vertices[vertexCount++]); }
public void AddVertex(ref Vertex2D vert) { if (vertexCount == vertices.Length) { Array.Resize(ref vertices, vertexCount * 2); } vert.CopyTo(out vertices[vertexCount++]); }
public void AddVertices(ref Vertex2D a, ref Vertex2D b) { while (vertexCount + 2 > vertices.Length) { Array.Resize(ref vertices, vertexCount * 2); } a.CopyTo(out vertices[vertexCount++]); b.CopyTo(out vertices[vertexCount++]); }
public void AddTriangle(ref Vertex2D a, ref Vertex2D b, ref Vertex2D c) { while (indexCount + 3 > indices.Length) { Array.Resize(ref indices, indexCount * 2); } int i = vertexCount; indices[indexCount++] = i; indices[indexCount++] = i + 1; indices[indexCount++] = i + 2; AddVertices(ref a, ref b, ref c); }
public void SetVertex(int i, ref Vertex2D vert) { vert.CopyTo(out vertices[i]); }
public void GetVertex(int i, out Vertex2D result) { vertices[i].CopyTo(out result); }
public void AddQuad(Vertex2D a, Vertex2D b, Vertex2D c, Vertex2D d) { AddQuad(ref a, ref b, ref c, ref d); }
public void AddTriangle(Vertex2D a, Vertex2D b, Vertex2D c) { AddTriangle(ref a, ref b, ref c); }
public void AddVertex(Vertex2D vert) { AddVertex(ref vert); }