Esempio n. 1
0
        protected override Punto CalculateNormalForPunto(int posVertexActual, Punto verticeActual, int posSeccionActual, Seccion seccionActual)
        {
            Punto puntoNorte = null;
            Punto puntoSur   = null;
            Punto puntoEste  = null;
            Punto puntoOeste = null;

            if (posSeccionActual + 1 < (this.Width * this.VertexRatio) - 1)
            {
                puntoNorte = this.secciones[posSeccionActual + 1].Vertices[posVertexActual];
            }
            if (posSeccionActual - 1 > 0)
            {
                puntoSur = this.secciones[posSeccionActual - 1].Vertices[posVertexActual];
            }
            if (posVertexActual + 1 < (this.Height * this.VertexRatio) - 1)
            {
                puntoEste = this.secciones[posSeccionActual].Vertices[posVertexActual + 1];
            }
            if (posVertexActual - 1 > 0)
            {
                puntoOeste = this.secciones[posSeccionActual].Vertices[posVertexActual - 1];
            }

            return(Punto.CalcularNormal(this.secciones[posSeccionActual].Vertices[posVertexActual], puntoNorte, puntoEste, puntoSur, puntoOeste, true));
        }