Struct UnrolledNavMeshGraphPortal
Intermediate struct used by the SSFA algorithm. It keeps track of the original 3D sides of the portals and the 2D projected ones. This information can then be used to reconstruct the intersection points of the straightened path in 3D.
Implements
Namespace: AnyPath.Graphs.NavMesh
Assembly: AnyPath.dll
Syntax
public struct UnrolledNavMeshGraphPortal : IUnrolledNavMeshGraphPortal
Remarks
This method is not confined to word exclusively with the NavMesh. If your segments implement IUnrolledNavMeshGraphPortal you can unroll them into a plane and use it with GetSteerTargetPosition<T>(T, float3, ref int) or AppendCornersUnrolled<T>(NativeSlice<T>, NativeList<CornerAndNormal>, float)
Properties
Left2D
Left side of the portal in the XZ plane
Declaration
public float2 Left2D { get; }
Property Value
| Type | Description |
|---|---|
| float2 |
Left3D
Left side of the portal
Declaration
public float3 Left3D { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float3 |
Normal
Original normal of the triangle
Declaration
public float3 Normal { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float3 |
Origin2D
Flattened origin of rotation
Declaration
public float2 Origin2D { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float2 |
Origin3D
Origin of rotation
Declaration
public float3 Origin3D { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float3 |
Right2D
Right side of the portal in the XZ plane
Declaration
public float2 Right2D { get; }
Property Value
| Type | Description |
|---|---|
| float2 |
Right3D
Right side of the portal
Declaration
public float3 Right3D { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float3 |
Rotation
The rotation that was used while unrolling this portal
Declaration
public quaternion Rotation { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| quaternion |
Methods
TransformPoint(float3)
Transforms a point in 3D space to a point in this unrolled segment
Declaration
public float2 TransformPoint(float3 point)
Parameters
| Type | Name | Description |
|---|---|---|
| float3 | point |
Returns
| Type | Description |
|---|---|
| float2 |
Unroll<T>(NativeSlice<T>, NativeSlice<UnrolledNavMeshGraphPortal>)
Unrolls a path of portals into the XZ plane, allowing the SSFA algorithm to work on curved paths.
Declaration
public static void Unroll<T>(NativeSlice<T> path, NativeSlice<UnrolledNavMeshGraphPortal> destSegments) where T : unmanaged, IUnrolledNavMeshGraphPortal
Parameters
| Type | Name | Description |
|---|---|---|
| NativeSlice<T> | path | The path to process. |
| NativeSlice<UnrolledNavMeshGraphPortal> | destSegments | Output array of the portals. Needs to be of the same length as the path. |
Type Parameters
| Name | Description |
|---|---|
| T |
Remarks
This method is not confined to word exclusively with the NavMesh. If your segments implement IUnrolledNavMeshGraphPortal you can unroll them into a plane and use it with GetSteerTargetPosition<T>(T, float3, ref int) or AppendCornersUnrolled<T>(NativeSlice<T>, NativeList<CornerAndNormal>, float)
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException |