A* Pathfinding Project
4.3.7
The A* Pathfinding Project for Unity 3D
|
Helper for drawing Gizmos in a performant way. More...
Helper for drawing Gizmos in a performant way.
This is a replacement for the Unity Gizmos class as that is not very performant when drawing very large amounts of geometry (for example a large grid graph). These gizmos can be persistent, so if the data does not change, the gizmos do not need to be updated.
How to use
Classes | |
struct | BuilderData |
struct | BuilderDataContainer |
struct | Hasher |
Combines hashes into a single hash value. More... | |
struct | MeshWithHash |
struct | NodeHasher |
Combines hashes into a single hash value. More... | |
struct | RedrawScope |
Public Member Functions | |
void | Dispose () |
Destroys all cached meshes. More... | |
bool | Draw (Hasher hasher) |
Schedules the meshes for the specified hash to be drawn. More... | |
void | Draw (RedrawScope scope) |
Schedules all meshes that were drawn the last frame with this redraw scope to be drawn again. More... | |
CommandBuilder | GetBuilder (Hasher hasher, RedrawScope redrawScope=default, bool isGizmos=true) |
GraphGizmoHelper | GetGizmoHelper (AstarPath active, Hasher hasher, RetainedGizmos.RedrawScope redrawScope) |
GraphGizmoHelper | GetSingleFrameGizmoHelper (AstarPath active, RetainedGizmos.RedrawScope redrawScope) |
bool | HasCachedMesh (Hasher hasher) |
True if there already is a mesh with the specified hash. More... | |
void | Render (bool allowGizmos) |
Call after all Draw commands for the frame have been done to draw everything. More... | |
void | TickFrame () |
Public Attributes | |
Material | lineMaterial |
Material to use for the navmesh outline in the editor. More... | |
Material | surfaceMaterial |
Material to use for the navmesh in the editor. More... | |
Package Functions | |
void | AddMesh (MeshWithHash mesh) |
Mesh | GetMesh () |
Package Attributes | |
BuilderDataContainer | data |
Properties | |
int | version [get, private set] |
Private Member Functions | |
void | DiscardData (Hasher hasher) |
void | PoolMesh (Mesh mesh) |
void | RemoveMeshesOlderThan (List< MeshWithHash > meshList, int versionThreshold) |
void | RemovePerCameraMeshes (List< MeshWithHash > meshList) |
void | RemoveUnusedMeshes (List< MeshWithHash > meshList) |
Private Attributes | |
Stack< Mesh > | cachedMeshes = new Stack<Mesh>() |
Dictionary< Camera, Int2 > | cameraVersions = new Dictionary<Camera, Int2>() |
HashSet< ulong > | existingHashes = new HashSet<ulong>() |
Plane [] | frustrumPlanes = new Plane[6] |
int | lastTickVersion = 1 |
int | lastTickVersion2 |
List< MeshWithHash > | meshes = new List<MeshWithHash>() |
HashSet< ulong > | usedHashes = new HashSet<ulong>() |
|
package |
|
private |
void Dispose | ( | ) |
Destroys all cached meshes.
Used to make sure that no memory leaks happen in the Unity Editor.
Schedules the meshes for the specified hash to be drawn.
void Draw | ( | RedrawScope | scope | ) |
Schedules all meshes that were drawn the last frame with this redraw scope to be drawn again.
CommandBuilder GetBuilder | ( | Hasher | hasher, |
RedrawScope | redrawScope = default , |
||
bool | isGizmos = true |
||
) |
GraphGizmoHelper GetGizmoHelper | ( | AstarPath | active, |
Hasher | hasher, | ||
RetainedGizmos.RedrawScope | redrawScope | ||
) |
|
package |
GraphGizmoHelper GetSingleFrameGizmoHelper | ( | AstarPath | active, |
RetainedGizmos.RedrawScope | redrawScope | ||
) |
bool HasCachedMesh | ( | Hasher | hasher | ) |
True if there already is a mesh with the specified hash.
|
private |
|
private |
|
private |
|
private |
void Render | ( | bool | allowGizmos | ) |
Call after all Draw commands for the frame have been done to draw everything.
void TickFrame | ( | ) |
|
private |
|
package |
|
private |
|
private |
|
private |
|
private |
Material lineMaterial |
Material to use for the navmesh outline in the editor.
|
private |
Material surfaceMaterial |
Material to use for the navmesh in the editor.
|
private |
|
getprivate set |