C# 클래스 FlatRedBall.AI.LineOfSight.VisibilityGrid

Represents a 2D grid of cells which identify what can be seen given a list of IViewers. This supports line of sight.
파일 보기 프로젝트 열기: vchelaru/FlatRedBall 1 사용 예제들

공개 메소드들

메소드 설명
Activity ( ) : bool

Checks if any viewers have changed since last Update, and if so it updates the grid.

AddViewer ( IViewer viewerToAdd ) : void

Adds an IViewer to this grid.

BleedDirectlyVisibleToWalls ( ) : void

Makes walls visible if they are adjacent to visible non-walls.

BlockWorld ( float worldX, float worldY ) : void

Adds a block (or wall) at a given world location.

ClearBlockedTiles ( ) : void

Clears all blocked tiles.

Destroy ( ) : void

Destroys the VisibilityGrid - specifically disposing its internal fog texture.

ForceUpdateImageData ( ) : void
ForceUpdateVisibilityGrid ( ) : void
IndexToWorld ( int xIndex, int yIndex, float &worldX, float &worldY ) : void
IsPositionInDirectView ( IViewer viewer, Microsoft.Xna.Framework.Vector3 &targetPosition ) : bool

Returns whether a given world position is in view of a given viewer.

IsRevealed ( int xIndex, int yIndex ) : bool

Returns whether a given X and Y index is revealed.

IsRevealedWorld ( float worldX, float worldY ) : bool

Returns whether a given world coordinate is relealed.

MakeAllHidden ( ) : void

Hides the entire grid (makes it not revealed).

MakeAllRevealed ( ) : void

Reveals the entire grid.

RemoveViewer ( IViewer viewerToRemove ) : void

Removes a viewer.

RevealArea ( int x0, int y0, int x1, int y1 ) : void
RevealAreaWorld ( float worldX1, float worldY1, float worldX2, float worldY2 ) : void
RevealCircle ( int xIndex, int yIndex, int tileRadius ) : void
RevealCircleWorld ( float worldX, float worldY, float worldRadius ) : void

Reveals a circle around the given world coordinate using a given radius

RevealLine ( int x0, int y0, int x1, int y1 ) : void
RevealLineWorld ( float worldX1, float worldY1, float worldX2, float worldY2 ) : void
UnBlockWorld ( float X, float Y ) : void

Unblocks a tile that was previously marked as a world blocker

UpdateDisplay ( ) : void
UpdateFog ( ) : void
UpdateFog ( bool fullUpdate ) : void
VisibilityGrid ( float xSeed, float ySeed, float gridSpacing, int numberOfXTiles, int numberOfYTiles ) : System

Instantiates a new VisibilityGrid.

WorldToIndex ( float worldX, float worldY, float &xIndex, float &yIndex ) : void
WorldToIndex ( float worldX, float worldY, int &xIndex, int &yIndex ) : void

비공개 메소드들

메소드 설명
CalculateFogColorByDistance ( float x, float y, byte alpha ) : byte
CalculateFogColorByDistance ( float x, float y, byte alpha, IViewer viewer ) : byte
UpdateRevealedFromViewers ( ) : void
UpdateViewersLocalVisibilityGrid ( IViewer viewer, ViewerInformation viewerInformation ) : void

메소드 상세

Activity() 공개 메소드

Checks if any viewers have changed since last Update, and if so it updates the grid.
public Activity ( ) : bool
리턴 bool

AddViewer() 공개 메소드

Adds an IViewer to this grid.
public AddViewer ( IViewer viewerToAdd ) : void
viewerToAdd IViewer The viewer to add.
리턴 void

BleedDirectlyVisibleToWalls() 공개 메소드

Makes walls visible if they are adjacent to visible non-walls.
public BleedDirectlyVisibleToWalls ( ) : void
리턴 void

BlockWorld() 공개 메소드

Adds a block (or wall) at a given world location.
public BlockWorld ( float worldX, float worldY ) : void
worldX float The world coordinate X.
worldY float The world coordinate Y.
리턴 void

ClearBlockedTiles() 공개 메소드

Clears all blocked tiles.
public ClearBlockedTiles ( ) : void
리턴 void

Destroy() 공개 메소드

Destroys the VisibilityGrid - specifically disposing its internal fog texture.
public Destroy ( ) : void
리턴 void

ForceUpdateImageData() 공개 메소드

public ForceUpdateImageData ( ) : void
리턴 void

ForceUpdateVisibilityGrid() 공개 메소드

public ForceUpdateVisibilityGrid ( ) : void
리턴 void

IndexToWorld() 공개 메소드

public IndexToWorld ( int xIndex, int yIndex, float &worldX, float &worldY ) : void
xIndex int
yIndex int
worldX float
worldY float
리턴 void

IsPositionInDirectView() 공개 메소드

Returns whether a given world position is in view of a given viewer.
public IsPositionInDirectView ( IViewer viewer, Microsoft.Xna.Framework.Vector3 &targetPosition ) : bool
viewer IViewer The viewer to check visibility for.
targetPosition Microsoft.Xna.Framework.Vector3 The world coordinates.
리턴 bool

IsRevealed() 공개 메소드

Returns whether a given X and Y index is revealed.
public IsRevealed ( int xIndex, int yIndex ) : bool
xIndex int The x index
yIndex int The y index
리턴 bool

IsRevealedWorld() 공개 메소드

Returns whether a given world coordinate is relealed.
public IsRevealedWorld ( float worldX, float worldY ) : bool
worldX float The world x coordinate.
worldY float The world y coordinate.
리턴 bool

MakeAllHidden() 공개 메소드

Hides the entire grid (makes it not revealed).
public MakeAllHidden ( ) : void
리턴 void

MakeAllRevealed() 공개 메소드

Reveals the entire grid.
public MakeAllRevealed ( ) : void
리턴 void

RemoveViewer() 공개 메소드

Removes a viewer.
public RemoveViewer ( IViewer viewerToRemove ) : void
viewerToRemove IViewer The argument IViewer to remove.
리턴 void

RevealArea() 공개 메소드

public RevealArea ( int x0, int y0, int x1, int y1 ) : void
x0 int
y0 int
x1 int
y1 int
리턴 void

RevealAreaWorld() 공개 메소드

public RevealAreaWorld ( float worldX1, float worldY1, float worldX2, float worldY2 ) : void
worldX1 float
worldY1 float
worldX2 float
worldY2 float
리턴 void

RevealCircle() 공개 메소드

public RevealCircle ( int xIndex, int yIndex, int tileRadius ) : void
xIndex int
yIndex int
tileRadius int
리턴 void

RevealCircleWorld() 공개 메소드

Reveals a circle around the given world coordinate using a given radius
public RevealCircleWorld ( float worldX, float worldY, float worldRadius ) : void
worldX float The world coordinate X
worldY float The world coordinate Y
worldRadius float The radius in world units
리턴 void

RevealLine() 공개 메소드

public RevealLine ( int x0, int y0, int x1, int y1 ) : void
x0 int
y0 int
x1 int
y1 int
리턴 void

RevealLineWorld() 공개 메소드

public RevealLineWorld ( float worldX1, float worldY1, float worldX2, float worldY2 ) : void
worldX1 float
worldY1 float
worldX2 float
worldY2 float
리턴 void

UnBlockWorld() 공개 메소드

Unblocks a tile that was previously marked as a world blocker
public UnBlockWorld ( float X, float Y ) : void
X float The X coordinate of the tile
Y float The Y coordinate of the tile
리턴 void

UpdateDisplay() 공개 메소드

public UpdateDisplay ( ) : void
리턴 void

UpdateFog() 공개 메소드

public UpdateFog ( ) : void
리턴 void

UpdateFog() 공개 메소드

public UpdateFog ( bool fullUpdate ) : void
fullUpdate bool
리턴 void

VisibilityGrid() 공개 메소드

Instantiates a new VisibilityGrid.
public VisibilityGrid ( float xSeed, float ySeed, float gridSpacing, int numberOfXTiles, int numberOfYTiles ) : System
xSeed float The absolute x coordinate seed value.
ySeed float The absolute y coordinate seed value.
gridSpacing float The amount of distance in world coordinates between rows and columns.
numberOfXTiles int Number of tiles wide (on the X axis)
numberOfYTiles int Number of tiles heigh (on the Y axis)
리턴 System

WorldToIndex() 공개 메소드

public WorldToIndex ( float worldX, float worldY, float &xIndex, float &yIndex ) : void
worldX float
worldY float
xIndex float
yIndex float
리턴 void

WorldToIndex() 공개 메소드

public WorldToIndex ( float worldX, float worldY, int &xIndex, int &yIndex ) : void
worldX float
worldY float
xIndex int
yIndex int
리턴 void