Struct PlatformerGraphLocation
Represents a location on the platformer graph. A location can be retrieved by calling the Raycast or Closest functions on the PlatformerGraph. A location can be used as a start/stop/goal in a path request. This same struct is also used as the path segment type after processing. This is done because the flags may contain information your agent needs while navigating through your world, and for performance reasons because a big chunk of the path can just be memcpyd'.
Namespace: AnyPath.Graphs.PlatformerGraph
Assembly: AnyPath.dll
Syntax
public struct PlatformerGraphLocation : IEquatable<PlatformerGraphLocation>, INodeFlags
Fields
edgeId
The (optional) id of the edge this location is at
Declaration
public readonly int edgeId
Field Value
| Type | Description |
|---|---|
| int |
edgeIndex
The index of the edge this location is at
Declaration
public readonly int edgeIndex
Field Value
| Type | Description |
|---|---|
| int |
line
The line segment that describes the edge the location was sampled on. For directed edges, the direction of the edge is from A to B. For undirected edges, the edge also goes from B to A.
Declaration
public Line2D line
Field Value
| Type | Description |
|---|---|
| Line2D |
Remarks
This value needs to be stored within the location to reconstruct the direction of travel for the first segment after the path has been found.
Properties
EnterPosition
The starting position for this edge. This value is only meaningful as part of a pathfinding result.
Declaration
public float2 EnterPosition { get; }
Property Value
| Type | Description |
|---|---|
| float2 |
ExitPosition
The end position for this edge. This will be the same as the starting position of the next edge in the path. This value is only meaningful as part of a pathfinding result.
Declaration
public float2 ExitPosition { get; }
Property Value
| Type | Description |
|---|---|
| float2 |
Flags
The flags of the edge this location is at
Declaration
public readonly int Flags { get; }
Property Value
| Type | Description |
|---|---|
| int |
Position
The exact position on the edge.
Declaration
public float2 Position { get; }
Property Value
| Type | Description |
|---|---|
| float2 |
PositionT
A value between 0 and 1 that describes how far along the line the position is.
Declaration
public float PositionT { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |