Engines/FlatRedBallXNA/FlatRedBall/AI/LineOfSight/VisibilityGrid.cs
/// <summary>
/// Returns whether a given world position is in view of a given viewer.
/// </summary>
/// <param name="viewer">The viewer to check visibility for.</param>
/// <param name="targetPosition">The world coordinates.</param>
/// <returns>Whether in view.</returns>
Returns whether a given world position is in view of a given viewer.
Returns whether a given world position is in view of a given viewer .
public bool IsPositionInDirectView(IViewer viewer, ref Vector3 targetPosition)
        {
            if (mViewers.ContainsKey(viewer)) 
            {
                VisibilityGrid grid = mViewers[viewer].LocalVisibilityGrid;
                return grid.IsRevealedWorld(targetPosition.X, targetPosition.Y);
            }
#if DEBUG
            else 
            {
                throw new InvalidOperationException("Viewer does not exist in Visbility grid");
            }
#else
            return false;
#endif
        }
public bool IsPositionInDirectView ( IViewer viewer , ref Vector3 targetPosition ) { if ( mViewers . ContainsKey ( viewer ) ) { VisibilityGrid grid = mViewers [ viewer ] . LocalVisibilityGrid ; return grid . IsRevealedWorld ( targetPosition . X , targetPosition . Y ) ; } if DEBUG else { throw new InvalidOperationException ( " " ) ; } else return false ; endif }
Returns whether a given world position is in view of a given viewer.
Returns whether a given world position is in view of a given viewer .
Whether in view.
Whether in view .
viewer
IViewer
The viewer to check visibility for.
The viewer to check visibility for .
Vector3
ref
targetPosition
The world coordinates.
The world coordinates .