![]() |
Dungeon Architect
17.0.0
|
A TiledNavMesh is a continuous region, which is used for pathfinding. More...
Classes | |
| struct | TiledNavMeshParams |
| The settings for the TiledNavMesh More... | |
Public Member Functions | |
| TiledNavMesh (NavMeshBuilder data) | |
| Initializes a new instance of the TiledNavMesh class. More... | |
| bool | InitTileNavMesh (TiledNavMeshParams parameters) |
| Initialize the Tiled Navigation Mesh variables and arrays. More... | |
| void | AddTile (NavMeshBuilder data, int lastRef, ref int result) |
| Build a tile and link all the polygons togther, both internally and externally. Make sure to link off-mesh connections as well. More... | |
| void | ConnectIntLinks (ref MeshTile tile) |
| Allocate links for each of the tile's polygons' vertices More... | |
| void | BaseOffMeshLinks (ref MeshTile tile) |
| Begin creating off-mesh links between the tile polygons. More... | |
| void | ConnectExtLinks (ref MeshTile tile, ref MeshTile target, BoundarySide side) |
| Connect polygons from two different tiles. More... | |
| void | ConnectExtOffMeshLinks (ref MeshTile tile, ref MeshTile target, BoundarySide side) |
| Connect Off-Mesh links between polygons from two different tiles. More... | |
| bool | GetOffMeshConnectionPolyEndPoints (int prevRef, int polyRef, ref Vector3 startPos, ref Vector3 endPos) |
| Retrieve the endpoints of the offmesh connection at the specified polygon More... | |
| void | FindConnectingPolys (Vector3 va, Vector3 vb, MeshTile tile, BoundarySide side, List< int > con, List< float > conarea) |
| Search for neighbor polygons in the tile. More... | |
| void | CalcSlabEndPoints (Vector3 va, Vector3 vb, Vector2 bmin, Vector2 bmax, BoundarySide side) |
| Find the slab endpoints based off of the 'side' value. More... | |
| float | GetSlabCoord (Vector3 va, BoundarySide side) |
| Return the proper slab coordinate value depending on the 'side' value. More... | |
| bool | OverlapSlabs (Vector2 amin, Vector2 amax, Vector2 bmin, Vector2 bmax, float px, float py) |
| Check if two slabs overlap. More... | |
| int | FindNearestPolyInTile (MeshTile tile, Vector3 center, Vector3 extents, ref Vector3 nearestPt) |
| Find the closest polygon possible in the tile under certain constraints. More... | |
| int | QueryPolygonsInTile (MeshTile tile, BBox3 qbounds, List< int > polys) |
| Find all the polygons within a certain bounding box. More... | |
| int | AllocLink (MeshTile tile) |
| Allocate a new link if possible. More... | |
| int | GetTileRef (MeshTile tile) |
| Get the tile reference More... | |
| MeshTile | GetTileAt (int x, int y, int layer) |
| Find the tile at a specific location More... | |
| int | GetTilesAt (int x, int y, MeshTile[] tiles) |
| Find and add a tile if it is found More... | |
| int | GetNeighbourTilesAt (int x, int y, BoundarySide side, MeshTile[] tiles) |
| Gets the neighboring tile at that position More... | |
| int | ComputeTileHash (int x, int y, int mask) |
| Computes the tile hash code, which can be used in a hash table for quick lookup. More... | |
| int | GetReference (int polyBase, int poly) |
| Get the actual polygon reference More... | |
| bool | IsLinkAllocated (int index) |
| Determines whether a link exists for that index More... | |
| bool | IsExternalLink (int neighbor) |
| Determines whether the two polygons are externally linked or not More... | |
| int | GetPolyRefBase (MeshTile tile) |
| Get the base reference for the polygons in a tile. More... | |
| bool | TryGetTileAndPolyByRef (int reference, out MeshTile tile, out Poly poly) |
| Retrieve the tile and poly based off of a polygon reference More... | |
| void | TryGetTileAndPolyByRefUnsafe (int reference, out MeshTile tile, out Poly poly) |
| Only use this function if it is known that the provided polygon reference is valid. More... | |
| bool | IsValidPolyRef (int reference) |
| Check if polygon reference is valid. More... | |
| void | DecodePolyId (int reference, ref int salt, ref int indexTile, ref int indexPoly) |
| Decode a standard polygon reference More... | |
| int | DecodePolyIdSalt (int reference) |
| Extract a tile's salt value from the specified polygon reference More... | |
| int | DecodePolyIdTile (int reference) |
| Extract a tile's index from the specified polygon reference More... | |
| int | DecodePolyIdPoly (int reference) |
| Extract a polygon's index (within its tile) from the specified polygon reference More... | |
| int | EncodePolyId (int salt, int indexTile, int indexPoly) |
| Derive a standard polygon reference, which compresses salt, tile index, and poly index together More... | |
| void | CalcTileLoc (ref Vector3 pos, out int tx, out int ty) |
| Calculates the tile location. More... | |
Properties | |
| int | TileCount [get] |
| Gets the maximum number of tiles that can be stored More... | |
| MeshTile | this[int index] [get] |
| Gets the mesh tile at a specified index. More... | |
| object | Tag [get, set] |
| Gets or sets user data for this navmesh. More... | |
A TiledNavMesh is a continuous region, which is used for pathfinding.
Definition at line 27 of file TiledNavMesh.cs.
| SharpNav.TiledNavMesh.TiledNavMesh | ( | NavMeshBuilder | data | ) |
Initializes a new instance of the TiledNavMesh class.
| data | The Navigation Mesh data |
Definition at line 60 of file TiledNavMesh.cs.
| void SharpNav.TiledNavMesh.AddTile | ( | NavMeshBuilder | data, |
| int | lastRef, | ||
| ref int | result | ||
| ) |
Build a tile and link all the polygons togther, both internally and externally. Make sure to link off-mesh connections as well.
| data | Navigation Mesh data |
| lastRef | Last polygon reference |
| result | Last tile reference |
Definition at line 159 of file TiledNavMesh.cs.
| int SharpNav.TiledNavMesh.AllocLink | ( | MeshTile | tile | ) |
Allocate a new link if possible.
| tile | Current tile |
Definition at line 931 of file TiledNavMesh.cs.
| void SharpNav.TiledNavMesh.BaseOffMeshLinks | ( | ref MeshTile | tile | ) |
Begin creating off-mesh links between the tile polygons.
| tile | Current Tile |
Definition at line 336 of file TiledNavMesh.cs.
| void SharpNav.TiledNavMesh.CalcSlabEndPoints | ( | Vector3 | va, |
| Vector3 | vb, | ||
| Vector2 | bmin, | ||
| Vector2 | bmax, | ||
| BoundarySide | side | ||
| ) |
Find the slab endpoints based off of the 'side' value.
| va | Vertex A |
| vb | Vertex B |
| bmin | Minimum bounds |
| bmax | Maximum bounds |
| side | The side |
Definition at line 688 of file TiledNavMesh.cs.
| void SharpNav.TiledNavMesh.CalcTileLoc | ( | ref Vector3 | pos, |
| out int | tx, | ||
| out int | ty | ||
| ) |
Calculates the tile location.
| pos | The position |
| tx | The tile's x-coordinate |
| ty | The tile's y-coordinate |
Definition at line 1287 of file TiledNavMesh.cs.
| int SharpNav.TiledNavMesh.ComputeTileHash | ( | int | x, |
| int | y, | ||
| int | mask | ||
| ) |
Computes the tile hash code, which can be used in a hash table for quick lookup.
| x | The x-coordinate |
| y | The y-coordinate |
| mask | The mask |
Definition at line 1082 of file TiledNavMesh.cs.
| void SharpNav.TiledNavMesh.ConnectExtLinks | ( | ref MeshTile | tile, |
| ref MeshTile | target, | ||
| BoundarySide | side | ||
| ) |
Connect polygons from two different tiles.
| tile | Current Tile |
| target | Target Tile |
| side | Polygon edge |
Definition at line 405 of file TiledNavMesh.cs.
| void SharpNav.TiledNavMesh.ConnectExtOffMeshLinks | ( | ref MeshTile | tile, |
| ref MeshTile | target, | ||
| BoundarySide | side | ||
| ) |
Connect Off-Mesh links between polygons from two different tiles.
| tile | Current Tile |
| target | Target Tile |
| side | Polygon edge |
Definition at line 490 of file TiledNavMesh.cs.
| void SharpNav.TiledNavMesh.ConnectIntLinks | ( | ref MeshTile | tile | ) |
Allocate links for each of the tile's polygons' vertices
| tile | A tile contains a set of polygons, which are linked to each other |
Definition at line 288 of file TiledNavMesh.cs.
| void SharpNav.TiledNavMesh.DecodePolyId | ( | int | reference, |
| ref int | salt, | ||
| ref int | indexTile, | ||
| ref int | indexPoly | ||
| ) |
Decode a standard polygon reference
| reference | Polygon reference |
| salt | Resulting salt value |
| indexTile | Resulting tile index |
| indexPoly | Resulting poly index |
Definition at line 1226 of file TiledNavMesh.cs.
| int SharpNav.TiledNavMesh.DecodePolyIdPoly | ( | int | reference | ) |
Extract a polygon's index (within its tile) from the specified polygon reference
| reference | Polygon reference |
Definition at line 1263 of file TiledNavMesh.cs.
| int SharpNav.TiledNavMesh.DecodePolyIdSalt | ( | int | reference | ) |
Extract a tile's salt value from the specified polygon reference
| reference | Polygon reference |
Definition at line 1241 of file TiledNavMesh.cs.
| int SharpNav.TiledNavMesh.DecodePolyIdTile | ( | int | reference | ) |
Extract a tile's index from the specified polygon reference
| reference | Polygon reference |
Definition at line 1252 of file TiledNavMesh.cs.
| int SharpNav.TiledNavMesh.EncodePolyId | ( | int | salt, |
| int | indexTile, | ||
| int | indexPoly | ||
| ) |
Derive a standard polygon reference, which compresses salt, tile index, and poly index together
| salt | Salt value |
| indexTile | Tile index |
| indexPoly | Poly index |
Definition at line 1276 of file TiledNavMesh.cs.
| void SharpNav.TiledNavMesh.FindConnectingPolys | ( | Vector3 | va, |
| Vector3 | vb, | ||
| MeshTile | tile, | ||
| BoundarySide | side, | ||
| List< int > | con, | ||
| List< float > | conarea | ||
| ) |
Search for neighbor polygons in the tile.
| va | Vertex A |
| vb | Vertex B |
| tile | Current tile |
| side | Polygon edge |
| con | Resulting Connection polygon |
| conarea | Resulting Connection area |
Definition at line 623 of file TiledNavMesh.cs.
| int SharpNav.TiledNavMesh.FindNearestPolyInTile | ( | MeshTile | tile, |
| Vector3 | center, | ||
| Vector3 | extents, | ||
| ref Vector3 | nearestPt | ||
| ) |
Find the closest polygon possible in the tile under certain constraints.
| tile | Current tile |
| center | Center starting point |
| extents | Range of search |
| nearestPt | Resulting nearest point |
Definition at line 797 of file TiledNavMesh.cs.
| int SharpNav.TiledNavMesh.GetNeighbourTilesAt | ( | int | x, |
| int | y, | ||
| BoundarySide | side, | ||
| MeshTile[] | tiles | ||
| ) |
Gets the neighboring tile at that position
| x | The x-coordinate |
| y | The y-coordinate |
| side | The side value |
| tiles | An array of MeshTiles |
Definition at line 1030 of file TiledNavMesh.cs.
| bool SharpNav.TiledNavMesh.GetOffMeshConnectionPolyEndPoints | ( | int | prevRef, |
| int | polyRef, | ||
| ref Vector3 | startPos, | ||
| ref Vector3 | endPos | ||
| ) |
Retrieve the endpoints of the offmesh connection at the specified polygon
| prevRef | The previous polygon reference |
| polyRef | The current polygon reference |
| startPos | The starting position |
| endPos | The ending position |
Definition at line 570 of file TiledNavMesh.cs.
| int SharpNav.TiledNavMesh.GetPolyRefBase | ( | MeshTile | tile | ) |
Get the base reference for the polygons in a tile.
| tile | Current Tile |
Definition at line 1127 of file TiledNavMesh.cs.
| int SharpNav.TiledNavMesh.GetReference | ( | int | polyBase, |
| int | poly | ||
| ) |
Get the actual polygon reference
| polyBase | The base value |
| poly | The offset |
Definition at line 1097 of file TiledNavMesh.cs.
| float SharpNav.TiledNavMesh.GetSlabCoord | ( | Vector3 | va, |
| BoundarySide | side | ||
| ) |
Return the proper slab coordinate value depending on the 'side' value.
| va | Vertex A |
| side | The side |
Definition at line 736 of file TiledNavMesh.cs.
| MeshTile SharpNav.TiledNavMesh.GetTileAt | ( | int | x, |
| int | y, | ||
| int | layer | ||
| ) |
Find the tile at a specific location
| x | The x-coordinate |
| y | The y-coordinate |
| layer | The layer number |
Definition at line 971 of file TiledNavMesh.cs.
| int SharpNav.TiledNavMesh.GetTileRef | ( | MeshTile | tile | ) |
Get the tile reference
| tile | Tile to look for |
Definition at line 946 of file TiledNavMesh.cs.
| int SharpNav.TiledNavMesh.GetTilesAt | ( | int | x, |
| int | y, | ||
| MeshTile[] | tiles | ||
| ) |
Find and add a tile if it is found
| x | The x-coordinate |
| y | The y-coordinate |
| tiles | Tile array |
Definition at line 997 of file TiledNavMesh.cs.
| bool SharpNav.TiledNavMesh.InitTileNavMesh | ( | TiledNavMeshParams | parameters | ) |
Initialize the Tiled Navigation Mesh variables and arrays.
| parameters | Tiled Navigation Mesh attributes |
Definition at line 110 of file TiledNavMesh.cs.
| bool SharpNav.TiledNavMesh.IsExternalLink | ( | int | neighbor | ) |
Determines whether the two polygons are externally linked or not
| neighbor | The neighboring polygon |
Definition at line 1117 of file TiledNavMesh.cs.
| bool SharpNav.TiledNavMesh.IsLinkAllocated | ( | int | index | ) |
Determines whether a link exists for that index
| index | The index |
Definition at line 1107 of file TiledNavMesh.cs.
| bool SharpNav.TiledNavMesh.IsValidPolyRef | ( | int | reference | ) |
Check if polygon reference is valid.
| reference | Polygon reference |
Definition at line 1199 of file TiledNavMesh.cs.
| bool SharpNav.TiledNavMesh.OverlapSlabs | ( | Vector2 | amin, |
| Vector2 | amax, | ||
| Vector2 | bmin, | ||
| Vector2 | bmax, | ||
| float | px, | ||
| float | py | ||
| ) |
Check if two slabs overlap.
| amin | Minimum bounds A |
| amax | Maximum bounds A |
| bmin | Minimum bounds B |
| bmax | Maximum bounds B |
| px | Point's x |
| py | Point's y |
Definition at line 756 of file TiledNavMesh.cs.
Find all the polygons within a certain bounding box.
| tile | Current tile |
| qbounds | The bounds |
| polys | List of polygons |
Definition at line 836 of file TiledNavMesh.cs.
| bool SharpNav.TiledNavMesh.TryGetTileAndPolyByRef | ( | int | reference, |
| out MeshTile | tile, | ||
| out Poly | poly | ||
| ) |
Retrieve the tile and poly based off of a polygon reference
| reference | Polygon reference |
| tile | Resulting tile |
| poly | Resulting poly |
Definition at line 1152 of file TiledNavMesh.cs.
| void SharpNav.TiledNavMesh.TryGetTileAndPolyByRefUnsafe | ( | int | reference, |
| out MeshTile | tile, | ||
| out Poly | poly | ||
| ) |
Only use this function if it is known that the provided polygon reference is valid.
| reference | Polygon reference |
| tile | Resulting tile |
| poly | Resulting poly |
Definition at line 1186 of file TiledNavMesh.cs.
|
getset |
Gets or sets user data for this navmesh.
Definition at line 103 of file TiledNavMesh.cs.
|
get |
Gets the mesh tile at a specified index.
| index | The index referencing a tile. |
Definition at line 92 of file TiledNavMesh.cs.
|
get |
Gets the maximum number of tiles that can be stored
Definition at line 79 of file TiledNavMesh.cs.