Class Route
An immutable set of line segments determining a path. All routes must have at least two waypoints for start/finish.
Inheritance
System.Object
Route
Assembly: Eco.Shared.dll
Syntax
public sealed class Route : ValueType
Constructors
Route(TraversalData, Vector3, PathSegment[], Boolean)
Declaration
public Route(TraversalData traversal, Vector3 facing, PathSegment[] pathSegments, bool isSmoothened)
Parameters
Type |
Name |
Description |
TraversalData |
traversal |
|
System.Numerics.Vector3 |
facing |
|
PathSegment[] |
pathSegments |
|
System.Boolean |
isSmoothened |
|
Route(ReadOnlySpan<Byte>)
Declaration
public Route(ReadOnlySpan<byte> bytes)
Parameters
Type |
Name |
Description |
System.ReadOnlySpan<System.Byte> |
bytes |
|
Fields
IsSmoothened
Declaration
public readonly bool IsSmoothened
Field Value
Type |
Description |
System.Boolean |
|
StartingFacingDir
Declaration
public readonly Vector3 StartingFacingDir
Field Value
Type |
Description |
System.Numerics.Vector3 |
|
TraversalData
Declaration
public readonly TraversalData TraversalData
Field Value
Waypoints
Declaration
public readonly PathSegment[] Waypoints
Field Value
Properties
EndDirection
Declaration
public Vector3 EndDirection { get; }
Property Value
Type |
Description |
System.Numerics.Vector3 |
|
EndPosition
Declaration
public Vector3 EndPosition { get; }
Property Value
Type |
Description |
System.Numerics.Vector3 |
|
IsValid
Declaration
public bool IsValid { get; }
Property Value
Type |
Description |
System.Boolean |
|
StartDirection
Declaration
public Vector3 StartDirection { get; }
Property Value
Type |
Description |
System.Numerics.Vector3 |
|
StartPosition
Declaration
public Vector3 StartPosition { get; }
Property Value
Type |
Description |
System.Numerics.Vector3 |
|
TotalDistance
Declaration
public float TotalDistance { get; }
Property Value
Type |
Description |
System.Single |
|
Methods
CheckPointsWrappedProperly(Vector3[])
Declaration
public static void CheckPointsWrappedProperly(Vector3[] pts)
Parameters
Type |
Name |
Description |
System.Numerics.Vector3[] |
pts |
|
FindPathSegmentIndexAtTime(Single, Int32)
Finds PathSegment index covering time
starting at path segment with index start
.
Declaration
public int FindPathSegmentIndexAtTime(float time, int start = 0)
Parameters
Type |
Name |
Description |
System.Single |
time |
|
System.Int32 |
start |
|
Returns
Type |
Description |
System.Int32 |
|
ToBytes()
Declaration
Returns
Type |
Description |
System.Byte[] |
|
TravelTime()
Declaration
public float TravelTime()
Returns
Type |
Description |
System.Single |
|
WaypointsAtTime(Single, Int32)
Adding a start value, allows us to start searching for the next waypoint midway through the path.
Declaration
public (PathSegment, PathSegment, int) WaypointsAtTime(float time, int start = 0)
Parameters
Type |
Name |
Description |
System.Single |
time |
|
System.Int32 |
start |
|
Returns
WithDelay(Single)
Creates a new route that is an exact copy of this route, but with delay added to start.
Declaration
public Route WithDelay(float delay)
Parameters
Type |
Name |
Description |
System.Single |
delay |
Start of the route is delayed by this number of seconds by adding them to initial rotation time.
|
Returns
Extension Methods