示例#1
0
        public static TemplateMesh Quad(TemplateVertex bottomLeft, TemplateVertex topLeft, TemplateVertex bottomRight, TemplateVertex topRight)
        {
            var r = TemplateMesh.EmptyMesh();

            r.QuadPart(bottomLeft, topLeft, bottomRight, topRight);
            return(r);
        }
示例#2
0
 private void GrowVerticies(int by)
 {
     VertexCount += by;
     if (Verticies.Length < VertexCount)
     {
         var newVerts = new TemplateVertex[(int)Math.Ceiling(VertexCount * 1.5)];
         Verticies.CopyTo(newVerts, 0);
         Verticies = newVerts;
     }
 }
示例#3
0
        public void QuadPart(TemplateVertex bottomLeft, TemplateVertex topLeft, TemplateVertex bottomRight, TemplateVertex topRight)
        {
            var baseIndex = VertexCount;

            GrowVerticies(4);

            Verticies[baseIndex + 0] = topLeft.WithTextCoordinate(new Vector2(0.0f, 0.0f));
            Verticies[baseIndex + 1] = topRight.WithTextCoordinate(new Vector2(1.0f, 0.0f));
            Verticies[baseIndex + 2] = bottomRight.WithTextCoordinate(new Vector2(1.0f, 1.0f));
            Verticies[baseIndex + 3] = bottomLeft.WithTextCoordinate(new Vector2(0.0f, 1.0f));
        }