Interface IUnrolledNavMeshGraphPortal
Data needed for SSFA to work in curved worlds
If the path is already in a flat plane, you can feed it directly to AppendCorners<TProj>(NativeSlice<TProj>, NativeList<float3>). If the path is curved however, you must first pass it to Unroll<T>(NativeSlice<T>, NativeSlice<UnrolledNavMeshGraphPortal>), which will 'unroll' it into a flat plane. The output of which can then be fed into GetSteerTargetPosition<T>(T, float3, ref int) or AppendCornersUnrolled<T>(NativeSlice<T>, NativeList<CornerAndNormal>, float) for path smoothing in 3D.
Namespace: AnyPath.Graphs.NavMesh
Assembly: AnyPath.dll
Syntax
public interface IUnrolledNavMeshGraphPortal
Remarks
This is not strictly confined to the NavMesh. If your path segment implements this interface, you can perform the path straightening on it.
You may notice the NavMeshGraphLocation also implements this, allowing it to be fed directly into any of the SSFA methods. The reason is, if you know your mesh is already flat, you can skip unrolling it and use it directly.
Properties
Left2D
The left side of the portal in 2D. This should be in the XZ plane.
Declaration
float2 Left2D { get; }
Property Value
| Type | Description |
|---|---|
| float2 |
Left3D
The left side of the portal
Declaration
float3 Left3D { get; }
Property Value
| Type | Description |
|---|---|
| float3 |
Normal
Normal of the plane the portal is in (e.g. 0, 1, 0 for a flat XZ plane)
Declaration
float3 Normal { get; }
Property Value
| Type | Description |
|---|---|
| float3 |
Right2D
The right side of the portal in 2D. This should be in the XZ plane.
Declaration
float2 Right2D { get; }
Property Value
| Type | Description |
|---|---|
| float2 |
Right3D
The right side of the portal
Declaration
float3 Right3D { get; }
Property Value
| Type | Description |
|---|---|
| float3 |