Example #1
0
        public void Progress()
        {
            var 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.minRadius)
                {
                    alpha *= Parent.preFalloff;
                }
            }

            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;
            }
        }
Example #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 > minRadius)
                {
                    alpha *= preFalloff;
                }
            }

            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();
        }