C# Class SharpNav.TiledNavMesh

A TiledNavMesh is a continuous region, which is used for pathfinding.
Afficher le fichier Open project: Robmaister/SharpNav Class Usage Examples

Méthodes publiques

Méthode Description
AddTile ( SharpNav.NavMeshBuilder data ) : NavPolyId

Build a tile and link all the polygons togther, both internally and externally. Make sure to link off-mesh connections as well.

AddTileAt ( NavTile tile, NavPolyId id ) : void
CalcTileLoc ( Microsoft.Xna.Framework.Vector3 &pos, int &tx, int &ty ) : void

Calculates the tile location.

GetNeighborTilesAt ( Vector2i location, BoundarySide side ) : IEnumerable
GetNeighborTilesAt ( int x, int y, BoundarySide side ) : IEnumerable

Gets the neighboring tile at that position

GetNextTileRef ( ) : NavPolyId
GetOffMeshConnectionPolyEndPoints ( NavPolyId prevRef, NavPolyId polyRef, Microsoft.Xna.Framework.Vector3 &startPos, Microsoft.Xna.Framework.Vector3 &endPos ) : bool

Retrieve the endpoints of the offmesh connection at the specified polygon

GetTileAt ( Vector2i location, int layer ) : NavTile

Find the tile at a specific location.

GetTileAt ( int x, int y, int layer ) : NavTile

Find the tile at a specific location.

GetTileRef ( NavTile tile ) : NavPolyId

Get the tile reference

GetTilesAt ( Vector2i location ) : IEnumerable
GetTilesAt ( int x, int y ) : IEnumerable

Find and add a tile if it is found

IsValidPolyRef ( NavPolyId reference ) : bool

Check if polygon reference is valid.

TiledNavMesh ( Microsoft.Xna.Framework.Vector3 origin, float tileWidth, float tileHeight, int maxTiles, int maxPolys )
TiledNavMesh ( SharpNav.NavMeshBuilder data )

Initializes a new instance of the TiledNavMesh class.

TryGetTileAndPolyByRef ( NavPolyId reference, NavTile &tile, NavPoly &poly ) : bool

Retrieve the tile and poly based off of a polygon reference

TryGetTileAndPolyByRefUnsafe ( NavPolyId reference, NavTile &tile, NavPoly &poly ) : void

Only use this function if it is known that the provided polygon reference is valid.

this ( NavPolyId id ) : NavTile
this ( int reference ) : NavTile
this ( Vector2i location ) : ReadOnlyCollection

Gets the mesh tile at a specified index.

this ( int x, int y ) : ReadOnlyCollection

Method Details

AddTile() public méthode

Build a tile and link all the polygons togther, both internally and externally. Make sure to link off-mesh connections as well.
public AddTile ( SharpNav.NavMeshBuilder data ) : NavPolyId
data SharpNav.NavMeshBuilder Navigation Mesh data
Résultat NavPolyId

AddTileAt() public méthode

public AddTileAt ( NavTile tile, NavPolyId id ) : void
tile NavTile
id NavPolyId
Résultat void

CalcTileLoc() public méthode

Calculates the tile location.
public CalcTileLoc ( Microsoft.Xna.Framework.Vector3 &pos, int &tx, int &ty ) : void
pos Microsoft.Xna.Framework.Vector3 The position
tx int The tile's x-coordinate
ty int The tile's y-coordinate
Résultat void

GetNeighborTilesAt() public méthode

public GetNeighborTilesAt ( Vector2i location, BoundarySide side ) : IEnumerable
location Vector2i
side BoundarySide
Résultat IEnumerable

GetNeighborTilesAt() public méthode

Gets the neighboring tile at that position
public GetNeighborTilesAt ( int x, int y, BoundarySide side ) : IEnumerable
x int The x-coordinate
y int The y-coordinate
side BoundarySide The side value
Résultat IEnumerable

GetNextTileRef() public méthode

public GetNextTileRef ( ) : NavPolyId
Résultat NavPolyId

GetOffMeshConnectionPolyEndPoints() public méthode

Retrieve the endpoints of the offmesh connection at the specified polygon
public GetOffMeshConnectionPolyEndPoints ( NavPolyId prevRef, NavPolyId polyRef, Microsoft.Xna.Framework.Vector3 &startPos, Microsoft.Xna.Framework.Vector3 &endPos ) : bool
prevRef NavPolyId The previous polygon reference
polyRef NavPolyId The current polygon reference
startPos Microsoft.Xna.Framework.Vector3 The starting position
endPos Microsoft.Xna.Framework.Vector3 The ending position
Résultat bool

GetTileAt() public méthode

Find the tile at a specific location.
public GetTileAt ( Vector2i location, int layer ) : NavTile
location Vector2i The (X, Y) coordinate of the tile.
layer int The layer of the tile.
Résultat NavTile

GetTileAt() public méthode

Find the tile at a specific location.
public GetTileAt ( int x, int y, int layer ) : NavTile
x int The X coordinate of the tile.
y int The Y coordinate of the tile.
layer int The layer of the tile.
Résultat NavTile

GetTileRef() public méthode

Get the tile reference
public GetTileRef ( NavTile tile ) : NavPolyId
tile NavTile Tile to look for
Résultat NavPolyId

GetTilesAt() public méthode

public GetTilesAt ( Vector2i location ) : IEnumerable
location Vector2i
Résultat IEnumerable

GetTilesAt() public méthode

Find and add a tile if it is found
public GetTilesAt ( int x, int y ) : IEnumerable
x int The x-coordinate
y int The y-coordinate
Résultat IEnumerable

IsValidPolyRef() public méthode

Check if polygon reference is valid.
public IsValidPolyRef ( NavPolyId reference ) : bool
reference NavPolyId Polygon reference
Résultat bool

TiledNavMesh() public méthode

public TiledNavMesh ( Microsoft.Xna.Framework.Vector3 origin, float tileWidth, float tileHeight, int maxTiles, int maxPolys )
origin Microsoft.Xna.Framework.Vector3
tileWidth float
tileHeight float
maxTiles int
maxPolys int

TiledNavMesh() public méthode

Initializes a new instance of the TiledNavMesh class.
public TiledNavMesh ( SharpNav.NavMeshBuilder data )
data SharpNav.NavMeshBuilder The Navigation Mesh data

TryGetTileAndPolyByRef() public méthode

Retrieve the tile and poly based off of a polygon reference
public TryGetTileAndPolyByRef ( NavPolyId reference, NavTile &tile, NavPoly &poly ) : bool
reference NavPolyId Polygon reference
tile NavTile Resulting tile
poly SharpNav.Pathfinding.NavPoly Resulting poly
Résultat bool

TryGetTileAndPolyByRefUnsafe() public méthode

Only use this function if it is known that the provided polygon reference is valid.
public TryGetTileAndPolyByRefUnsafe ( NavPolyId reference, NavTile &tile, NavPoly &poly ) : void
reference NavPolyId Polygon reference
tile NavTile Resulting tile
poly SharpNav.Pathfinding.NavPoly Resulting poly
Résultat void

this() public méthode

public this ( NavPolyId id ) : NavTile
id NavPolyId
Résultat NavTile

this() public méthode

public this ( int reference ) : NavTile
reference int
Résultat NavTile

this() public méthode

Gets the mesh tile at a specified index.
public this ( Vector2i location ) : ReadOnlyCollection
location Vector2i
Résultat ReadOnlyCollection

this() public méthode

public this ( int x, int y ) : ReadOnlyCollection
x int
y int
Résultat ReadOnlyCollection