Struct NavMeshGraphLocation
A location on the NavMeshGraph represents a triangle and a position within that triangle.
Furthermore, when part of a path, the Left and Right properties point to the shared edge with the next triangle in the path.
Assembly: AnyPath.dll
Syntax
public struct NavMeshGraphLocation : IEquatable<NavMeshGraphLocation>, IUnrolledNavMeshGraphPortal, INodeFlags
Properties
ExitPosition
This value is used internally by A* to provide better distance estimates between triangles. This is the closest point
on the portal of this triangle inside a path to the previous position. This eliminates the problem where small triangles
are adjecent to large ones and a weird detour gets taken in case we'd measure distances from the centers of the triangles.
For locations used as start/goal, this position is also equal to Left and Right, but for locations inside a path, it is somewhere in between.
Declaration
public float3 ExitPosition { readonly get; set; }
Property Value
Flags
Declaration
public readonly int Flags { get; }
Property Value
Left3D
Points to the left side of the edge connecting this triangle to the next triangle in the path.
For start and ending positions, this value is equal to Right3D, to allow for navigating to an exact position within
the triangle.
Declaration
public float3 Left3D { readonly get; set; }
Property Value
Normal
Normal of the triangle for this location
Declaration
public float3 Normal { readonly get; set; }
Property Value
Right3D
Points to the left side of the edge connecting this triangle to the next triangle in the path.
For start and ending positions, this value is equal to Left3D, to allow for navigating to an exact position within
the triangle.
Declaration
public float3 Right3D { readonly get; set; }
Property Value
TriangleIndex
The index of the triangle for this location
Declaration
public int TriangleIndex { readonly get; set; }
Property Value
Methods
AsStartOrGoal()
Used by the SSFA for the start and goal segments. This returns a copy of this segment, only
with the triangle's A (Left) and and B (Right) set exactly to the target position.
Declaration
public NavMeshGraphLocation AsStartOrGoal()
Returns
| Type |
Description |
| NavMeshGraphLocation |
A copy of this segment that has both Left and Right set to target Position.
Note that this alters the triangle's A + B causing it to be a degenerate triangle. As such, the normal of the triangle can't be determined
|
Equals(NavMeshGraphLocation)
Declaration
public bool Equals(NavMeshGraphLocation other)
Parameters
Returns
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
Shrink(float)
Shrinks the portal, where zero is no shrink and one is a total shrink towards the center.
Declaration
public NavMeshGraphLocation Shrink(float ratio)
Parameters
| Type |
Name |
Description |
| float |
ratio |
|
Returns
ToString()
Declaration
public override string ToString()
Returns
Overrides
Implements
Extension Methods