예제 #1
0
        public void Progress()
        {
            PointInfo point = info.GetNextPoint();

            x += info.directionX;
            y += info.directionY;

            if (alpha > 0)
            {
                if (point.distance > parent.halfRadius)
                {
                    alpha *= parent.falloff - (point.distance - parent.halfRadius) / parent.halfRadius;
                }
                else if (point.distance > parent.eighthRadius)
                {
                    alpha *= 0.99F;
                }
            }

            if (x >= 0 && x < parent.width && y >= 0 && y < parent.height)
            {
                alpha *= 1 - parent.heightMap[x, y];
                parent.alphaMap[x, y] += parent.inverted ? (1 - alpha) / 2 : alpha / 2;
            }
        }
예제 #2
0
        public void Progress()
        {
            PointInfo point = info.GetNextPoint();

            x += info.directionX;
            y += info.directionY;

            if (alpha > 0)
            {
                if (point.distance > halfRadius)
                {
                    alpha *= falloff - (point.distance - halfRadius) / halfRadius;
                }
                else if (point.distance > eighthRadius)
                {
                    alpha *= 0.99F;
                }
            }

            if (x >= 0 && x < width && y >= 0 && y < height)
            {
                alpha          *= 1 - heightMap[x, y];
                alphaMap[x, y] += inverted ? 1 - alpha : alpha;
            }

            List <LineOfSightInfo> childInfos = lineInfos[point.coordinateX, point.coordinateY];

            new SecondaryLineOfSight(childInfos[0], this).Complete();
            new SecondaryLineOfSight(childInfos[1], this).Complete();
        }