fBaseXtensions.Navigation.Navigation.FindLocationBehindObject C# (CSharp) Method

FindLocationBehindObject() public method

public FindLocationBehindObject ( CacheObject obj ) : System.Vector3
obj fBaseXtensions.Cache.Internal.Objects.CacheObject
return System.Vector3
        public Vector3 FindLocationBehindObject(CacheObject obj)
        {
            float rotation=FindDirection(FunkyGame.Hero.Position, obj.Position, true);
            Vector3 startLocation=MathEx.GetPointAt(obj.Position, obj.Radius, rotation);

            DirectionPoint dp = new DirectionPoint(startLocation, rotation, 35f);
            LocationalRects.Add(new GPRectangle(dp));

            DirectionPoint dp2 = new DirectionPoint(startLocation, MathEx.WrapAngle(rotation + 0.7f), 35f);
            LocationalRects.Add(new GPRectangle(dp2));

            DirectionPoint dp3 = new DirectionPoint(startLocation, MathEx.WrapAngle(rotation - 0.7f), 35f);
            LocationalRects.Add(new GPRectangle(dp3));

            List<GridPoint> blacklisted = new List<GridPoint>();
            Vector3 safespot=Vector3.Zero;
            foreach (var gpr in LocationalRects)
            {
                bool found=gpr.TryFindSafeSpot(FunkyGame.Hero.Position, out safespot, Vector3.Zero, PointCheckingFlags.AvoidanceIntersection | PointCheckingFlags.RaycastWalkable, blacklisted);
                if (found)
                {
                    break;
                }
            }

            return safespot;
        }