|
| TileType (Int3[] sourceVerts, int[] sourceTris, Int3 tileSize, Int3 centerOffset, int width=1, int depth=1) |
|
| TileType (Mesh source, Int3 tileSize, Int3 centerOffset, int width=1, int depth=1) |
| Create a new TileType.
|
|
void | Load (out Int3[] verts, out int[] tris, int rotation, int yoffset) |
| Load a tile, result given by the vert and tris array.
|
|
|
static readonly int[] | Rotations |
| Matrices for rotation.
|
|
TileType |
( |
Int3[] |
sourceVerts, |
|
|
int[] |
sourceTris, |
|
|
Int3 |
tileSize, |
|
|
Int3 |
centerOffset, |
|
|
int |
width = 1 , |
|
|
int |
depth = 1 |
|
) |
| |
TileType |
( |
Mesh |
source, |
|
|
Int3 |
tileSize, |
|
|
Int3 |
centerOffset, |
|
|
int |
width = 1 , |
|
|
int |
depth = 1 |
|
) |
| |
Create a new TileType.
First all vertices of the source mesh are offseted by the centerOffset. The source mesh is assumed to be centered (after offsetting). Corners of the tile should be at tileSize*0.5 along all axes. When width or depth is not 1, the tileSize param should not change, but corners of the tile are assumed to lie further out.
- Parameters
-
source | The navmesh as a unity Mesh |
width | The number of base tiles this tile type occupies on the x-axis |
depth | The number of base tiles this tile type occupies on the z-axis |
tileSize | Size of a single tile, the y-coordinate will be ignored. |
void Load |
( |
out Int3[] |
verts, |
|
|
out int[] |
tris, |
|
|
int |
rotation, |
|
|
int |
yoffset |
|
) |
| |
Load a tile, result given by the vert and tris array.
- Warning
- For performance and memory reasons, the returned arrays are internal arrays, so they must not be modified in any way or subsequent calls to Load may give corrupt output. The contents of the verts array is only valid until the next call to Load since different rotations and y offsets can be applied. If you need persistent arrays, please copy the returned ones.
readonly int [] Rotations |
|
staticprivate |
Initial value:= {
1, 0,
0, 1,
0, 1,
-1, 0,
-1, 0,
0, -1,
0, -1,
1, 0
}
Matrices for rotation.
Each group of 4 elements is a 2x2 matrix. The XZ position is multiplied by this. So
(5,2) * ((0, 1), (-1, 0)) = (2,-5)
The documentation for this class was generated from the following file:
- /Users/arong/Unity/a-pathfinding-project/Assets/AstarPathfindingProject/Generators/Utilities/TileHandler.cs