|
| TileHandler (RecastGraph graph) |
|
void | ClearTile (int x, int z) |
|
void | CreateTileTypesFromGraph () |
|
void | CutShapeWithTile (int x, int z, Int3[] shape, ref Int3[] verts, ref int[] tris, out int vCount, out int tCount) |
|
void | EndBatchLoad () |
|
int | GetActiveRotation (Int2 p) |
|
TileType | GetTileType (int index) |
|
int | GetTileTypeCount () |
|
void | LoadTile (TileType tile, int x, int z, int rotation, int yoffset) |
| Load a tile id at tile coordinate x, z.
|
|
TileType | RegisterTileType (Mesh source, Int3 centerOffset, int width=1, int depth=1) |
| Register that a tile can be loaded from source.
|
|
void | ReloadInBounds (Bounds b) |
| Reloads all tiles intersecting with the specified bounds.
|
|
void | ReloadTile (int x, int z) |
| Reload tile at tile coordinate.
|
|
bool | StartBatchLoad () |
| Start batch loading.
|
|
|
static T[] | ShrinkArray< T > (T[] arr, int newLength) |
| Returns a new array with at most length newLength.
|
|
|
void | CutPoly (Int3[] verts, int[] tris, ref Int3[] outVertsArr, ref int[] outTrisArr, out int outVCount, out int outTCount, Int3[] extraShape, Int3 cuttingOffset, Bounds realBounds, CutMode mode=CutMode.CutAll|CutMode.CutDual, int perturbate=0) |
|
void | DelaunayRefinement (Int3[] verts, int[] tris, ref int vCount, ref int tCount, bool delaunay, bool colinear, Int3 worldOffset) |
| Refine a mesh using delaunay refinement.
|
|
Int3 | IntPoint2Int3 (IntPoint p) |
|
Vector3 | Point2D2V3 (Poly2Tri.TriangulationPoint p) |
|
void ClearTile |
( |
int |
x, |
|
|
int |
z |
|
) |
| |
void CreateTileTypesFromGraph |
( |
| ) |
|
void CutPoly |
( |
Int3[] |
verts, |
|
|
int[] |
tris, |
|
|
ref Int3[] |
outVertsArr, |
|
|
ref int[] |
outTrisArr, |
|
|
out int |
outVCount, |
|
|
out int |
outTCount, |
|
|
Int3[] |
extraShape, |
|
|
Int3 |
cuttingOffset, |
|
|
Bounds |
realBounds, |
|
|
CutMode |
mode = CutMode.CutAll | CutMode.CutDual , |
|
|
int |
perturbate = 0 |
|
) |
| |
|
private |
void CutShapeWithTile |
( |
int |
x, |
|
|
int |
z, |
|
|
Int3[] |
shape, |
|
|
ref Int3[] |
verts, |
|
|
ref int[] |
tris, |
|
|
out int |
vCount, |
|
|
out int |
tCount |
|
) |
| |
void DelaunayRefinement |
( |
Int3[] |
verts, |
|
|
int[] |
tris, |
|
|
ref int |
vCount, |
|
|
ref int |
tCount, |
|
|
bool |
delaunay, |
|
|
bool |
colinear, |
|
|
Int3 |
worldOffset |
|
) |
| |
|
private |
Refine a mesh using delaunay refinement.
Loops through all pairs of neighbouring triangles and check if it would be better to flip the diagonal joining them using the delaunay criteria.
Does not require triangles to be clockwise, triangles will be checked for if they are clockwise and made clockwise if not. The resulting mesh will have all triangles clockwise.
int GetActiveRotation |
( |
Int2 |
p | ) |
|
Int3 IntPoint2Int3 |
( |
IntPoint |
p | ) |
|
|
private |
void LoadTile |
( |
TileType |
tile, |
|
|
int |
x, |
|
|
int |
z, |
|
|
int |
rotation, |
|
|
int |
yoffset |
|
) |
| |
Load a tile id at tile coordinate x, z.
- Parameters
-
id | Tile id as got from RegisterTile |
x | Tile x coordinate (first tile is at (0,0), second at (1,0) etc.. ). |
z | Tile z coordinate. |
rotation | Rotate tile by 90 degrees * value. |
yoffset | Offset Y coordinates by this amount. In Int3 space, so if you have a world space offset, multiply by Int3.Precision and round to the nearest integer before calling this function. |
Vector3 Point2D2V3 |
( |
Poly2Tri.TriangulationPoint |
p | ) |
|
|
private |
TileType RegisterTileType |
( |
Mesh |
source, |
|
|
Int3 |
centerOffset, |
|
|
int |
width = 1 , |
|
|
int |
depth = 1 |
|
) |
| |
Register that a tile can be loaded from source.
- Parameters
-
centerOffset | Assumes that the mesh has its pivot point at the center of the tile. If it has not, you can supply a non-zero centerOffset to offset all vertices. |
width | width of the tile. In base tiles, not world units. |
depth | depth of the tile. In base tiles, not world units. |
source | Source mesh, must be readable. |
- Returns
- Identifier for loading that tile type
void ReloadInBounds |
( |
Bounds |
b | ) |
|
Reloads all tiles intersecting with the specified bounds.
void ReloadTile |
( |
int |
x, |
|
|
int |
z |
|
) |
| |
Reload tile at tile coordinate.
The last tile loaded at that position will be reloaded (e.g to account for moved navmesh cut components)
static T [] ShrinkArray< T > |
( |
T[] |
arr, |
|
|
int |
newLength |
|
) |
| |
|
staticprotected |
Returns a new array with at most length newLength.
The array will a copy of all elements of arr.
Start batch loading.
- Returns
- True if batching wasn't started yet, and thus EndBatchLoad should be called, False if batching was already started by some other part of the code and you should not call EndBatchLoad
int [] activeTileRotations |
|
private |
Dictionary<Int2, int> cached_Int2_int_dict = new Dictionary<Int2, int>() |
|
private |
Dictionary<Int3, int> cached_Int3_int_dict = new Dictionary<Int3, int>() |
|
private |
int [] cached_int_array = new int[32] |
|
private |
The documentation for this class was generated from the following file:
- /Users/arong/Unity/a-pathfinding-project/Assets/AstarPathfindingProject/Generators/Utilities/TileHandler.cs