Interface ICorridorSegment
Represents a path segment that can be processed (in place) by the Simple Stupid Funnel Algorithm. See http://digestingduck.blogspot.com/2010/03/simple-stupid-funnel-algorithm.html for information about the algorithm.
If your segments are rotated in 3D space, it might be neccessary to first unwrap the segments and project them into 2D space. See CorridorSegmentProjection on how to do this.
Namespace: AnyPath.Graphs
Assembly: Assembly-CSharp.dll
Syntax
public interface ICorridorSegment
Remarks
While only the built in NavMesh uses this, it is possible to use this algorithm if your segment type implements this interface.
If your corridor is strictly 2D, you can make your segment struct also implement ICorridorSegmentProjection. Depending on the plane, you can ignore one component of the positions. For example, if your structure is in the XY plane, just return the X and Y components and make a custom setter for the TargetPosition that only stores the XY components.Properties
| Improve this Doc View SourceLeft
Left side of the portal. Always Triangle.A in the NavMesh case. If you need an absolute target position for the last segment of your path. Narrow down Left and Right to point to the same position. This can be done just before creating the final result using the IPathProcessor interface
Declaration
float3 Left { get; }
Property Value
Type | Description |
---|---|
Unity.Mathematics.float3 |
Right
Right side of the portal. Always Triangle.B in the NavMesh case. If you need an absolute target position for the last segment of your path. Narrow down Left and Right to point to the same position. This can be done just before creating the final result using the IPathProcessor interface
Declaration
float3 Right { get; }
Property Value
Type | Description |
---|---|
Unity.Mathematics.float3 |
TargetPosition
Set by the processor to reflect the target position for this segment
Declaration
float3 TargetPosition { get; set; }
Property Value
Type | Description |
---|---|
Unity.Mathematics.float3 |