using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using OpenTK;

namespace ObjectManager
{
    public class FaceVertex
    {
        public Mesh ReferenceMesh;
        public int VertexIndex;
        public Vector3d Normals;

        public Vertex Vertex
        {
            get
            {
                return this.ReferenceMesh.Vertices[VertexIndex];
            }
        }

        public Vertex TransformedVertex
        {
            get
            {
                return this.ReferenceMesh.TransformedVertices[VertexIndex];
            }
        }

        #region Constructors

        public FaceVertex(Mesh referenceMesh, int vertexIndex, Vector3d normals)
        {
            this.ReferenceMesh = referenceMesh;
            this.VertexIndex = vertexIndex;
            this.Normals = normals;
        }

        public FaceVertex(Mesh referenceMesh, int vertexIndex)
        {
            this.ReferenceMesh = referenceMesh;
            this.VertexIndex = vertexIndex;
            this.Normals = referenceMesh.Vertices[vertexIndex].PresetNormals;
        }

        public FaceVertex(int vertexIndex, Vector3d normals)
        {
            this.ReferenceMesh = null;
            this.VertexIndex = vertexIndex;
            this.Normals = normals;
        }

        public FaceVertex(int vertexIndex)
        {
            this.ReferenceMesh = null;
            this.VertexIndex = vertexIndex;
            this.Normals = Vector3d.Zero;
        }

        #endregion
    }
}
