예제 #1
0
        /// <summary>
        /// Function to initialize the vertex
        /// </summary>
        /// <param name="vertexCount">Number of vertices in this renderable object.</param>
        protected void InitializeVertices(int vertexCount)
        {
            VertexCount = vertexCount;

            Vertices = new Gorgon2DVertex[vertexCount];

            for (int i = 0; i < Vertices.Length; i++)
            {
                Vertices[i].Color    = new GorgonColor(1.0f, 1.0f, 1.0f, 1.0f);
                Vertices[i].Position = new Vector4(0, 0, 0, 1.0f);
                Vertices[i].UV       = Vector2.Zero;
            }

            InitializeCustomVertexInformation();
        }
예제 #2
0
 /// <summary>
 /// Function to convert a Gorgon2D vertex to a polygon point.
 /// </summary>
 /// <param name="vertex">Vertex to convert.</param>
 /// <returns>The converted point.</returns>
 public static GorgonPolygonPoint FromGorgon2DVertex(ref Gorgon2DVertex vertex)
 {
     return(new GorgonPolygonPoint((Vector2)vertex.Position, vertex.Color, vertex.UV));
 }