Esempio n. 1
0
        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++]);
        }
Esempio n. 2
0
 public void AddVertex(ref Vertex2D vert)
 {
     if (vertexCount == vertices.Length)
     {
         Array.Resize(ref vertices, vertexCount * 2);
     }
     vert.CopyTo(out vertices[vertexCount++]);
 }
Esempio n. 3
0
 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++]);
 }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 public void SetVertex(int i, ref Vertex2D vert)
 {
     vert.CopyTo(out vertices[i]);
 }
Esempio n. 6
0
 public void GetVertex(int i, out Vertex2D result)
 {
     vertices[i].CopyTo(out result);
 }
Esempio n. 7
0
 public void AddQuad(Vertex2D a, Vertex2D b, Vertex2D c, Vertex2D d)
 {
     AddQuad(ref a, ref b, ref c, ref d);
 }
Esempio n. 8
0
 public void AddTriangle(Vertex2D a, Vertex2D b, Vertex2D c)
 {
     AddTriangle(ref a, ref b, ref c);
 }
Esempio n. 9
0
 public void AddVertex(Vertex2D vert)
 {
     AddVertex(ref vert);
 }