Navmesh cutting for fast recast graph updating.
More...
Navmesh cutting for fast recast graph updating.
- A* Pro Feature:
- This is an A* Pathfinding Project Pro feature only. This function/class/variable might not exist in the Free version of the A* Pathfinding Project or the functionality might be limited
The Pro version can be bought here
Usually you want a TileHandlerHelper somewhere in your scene which handles applying navmesh cutting when these components are enabled or disabled.
- See Also
- http://www.arongranberg.com/2013/08/navmesh-cutting/
|
static readonly Color | GizmoColor = new Color(37.0f/255,184.0f/255,239.0f/255) |
|
|
Transform | tr |
| cached transform component
|
|
- Enumerator:
Rectangle |
|
Circle |
|
CustomMesh |
|
void CalculateMeshContour |
( |
| ) |
|
|
private |
Forces this navmesh cut to update the navmesh.
- Note
- Dynamic updating requires a Tile Handler Helper somewhere in the scene. This update is not instant, it is done the next time the TileHandlerHelper checks this instance for if it needs updating.
- See Also
- TileHandlerHelper.ForceUpdate()
Returns a list with all NavmeshCut components in the scene.
- Warning
- Do not modify this array
Get all active instances which intersect the bounds.
void GetContour |
( |
List< List< Pathfinding.ClipperLib.IntPoint >> |
buffer | ) |
|
static bool Intersects |
( |
Bounds |
b1, |
|
|
Bounds |
b2 |
|
) |
| |
|
staticprivate |
Vector3 IntPointToV3 |
( |
Pathfinding.ClipperLib.IntPoint |
p | ) |
|
void OnDrawGizmosSelected |
( |
| ) |
|
Returns true if this object has moved so much that it requires an update.
When an update to the navmesh has been done, call NotifyUpdated to be able to get relavant output from this method again.
virtual void UsedForCut |
( |
| ) |
|
|
virtual |
Pathfinding.ClipperLib.IntPoint V3ToIntPoint |
( |
Vector3 |
p | ) |
|
Number of vertices on the circle.
bool cutsAddedGeom = true |
Cuts geometry added by a NavmeshAdd component.
You rarely need to change this
Cached variable, do avoid allocations.
readonly Color GizmoColor = new Color(37.0f/255,184.0f/255,239.0f/255) |
|
static |
Only makes a split in the navmesh, but does not remove the geometry to make a hole.
This is slower than a normal cut
Custom mesh to use.
The contour(s) of the mesh will be extracted. If you get the "max perturbations" error when cutting with this, check the normals on the mesh. They should all point in the same direction. Try flipping them if that does not help.
Scale of the custom mesh, if used.
readonly Dictionary<int,int> pointers = new Dictionary<int, int>() |
|
staticprivate |
Cached variable, do avoid allocations.
Vector2 rectangleSize = new Vector2(1,1) |
cached transform component
float updateDistance = 0.4f |
Distance between positions to require an update of the navmesh.
A smaller distance gives better accuracy, but requires more updates when moving the object over time, so it is often slower.
- Note
- Dynamic updating requires a TileHandlerHelper somewhere in the scene.
float updateRotationDistance = 10 |
How many degrees rotation that is required for an update to the navmesh.
Should be between 0 and 180.
- Note
- Dynamic updating requires a Tile Handler Helper somewhere in the scene.
Includes rotation in calculations.
This is slower since a lot more matrix multiplications are needed but gives more flexibility.
Called every time a NavmeshCut component is destroyed.
The documentation for this class was generated from the following file:
- /Users/arong/Unity/a-pathfinding-project/Assets/AstarPathfindingProject/Navmesh/NavmeshCut.cs