Class Path
Inheritance
System.Object
Path
Assembly: Eco.Shared.dll
Syntax
public sealed class Path : Object, IBsonSerialize, IBsonSerializable, IBsonDeserializable
Constructors
Path()
Declaration
Path(IEnumerable<Vector3>)
Declaration
public Path(IEnumerable<Vector3> waypoints)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<System.Numerics.Vector3> |
waypoints |
|
Fields
Waypoints
Declaration
public Vector3[] Waypoints
Field Value
| Type |
Description |
| System.Numerics.Vector3[] |
|
Methods
DistanceToNextJump(Int32, Vector3)
Declaration
public float DistanceToNextJump(int segmentIndex, Vector3 currentPos)
Parameters
| Type |
Name |
Description |
| System.Int32 |
segmentIndex |
|
| System.Numerics.Vector3 |
currentPos |
|
Returns
| Type |
Description |
| System.Single |
|
DistanceToNextJump(Int32, Vector3, out Int32)
Declaration
public float DistanceToNextJump(int segmentIndex, Vector3 currentPos, out int segment)
Parameters
| Type |
Name |
Description |
| System.Int32 |
segmentIndex |
|
| System.Numerics.Vector3 |
currentPos |
|
| System.Int32 |
segment |
|
Returns
| Type |
Description |
| System.Single |
|
FromBson(BSONArray)
Declaration
public void FromBson(BSONArray bson)
Parameters
Function to get the nearest point on the path and advance by a given distance.
NOTE: Will only match ~same Y position, higher segments will not match for current position.
Extra will be calculated until an up/down transition, where it will stop and return the POST-JUMP position (the end of the transition segment).
Returns the point and the segment index (segment X starts at Waypoints[X])
Declaration
public (int, Vector3, int, Vector3) GetNearestPointWithExtra(int currentSegment, Vector3 position, float extra)
Parameters
| Type |
Name |
Description |
| System.Int32 |
currentSegment |
|
| System.Numerics.Vector3 |
position |
|
| System.Single |
extra |
|
Returns
| Type |
Description |
| System.ValueTuple<System.Int32, System.Numerics.Vector3, System.Int32, System.Numerics.Vector3> |
|
OnFinalStretch()
Returns true if we're on the last set of segments that will lead to the end, with no jumps.
Declaration
public bool OnFinalStretch()
Returns
| Type |
Description |
| System.Boolean |
|
SegmentDelta(Int32)
Returns a vector representing the change in position for this segment
Declaration
public Vector3 SegmentDelta(int segmentIndex)
Parameters
| Type |
Name |
Description |
| System.Int32 |
segmentIndex |
|
Returns
| Type |
Description |
| System.Numerics.Vector3 |
|
ToBson()
Declaration
public BSONArray ToBson()
Returns
VerticalTransitionSegment(Int32)
Returns true if the given segment goes up/down
Declaration
public bool VerticalTransitionSegment(int segment)
Parameters
| Type |
Name |
Description |
| System.Int32 |
segment |
|
Returns
| Type |
Description |
| System.Boolean |
|
VerticalTransitionSegment(Int32, Int32)
Declaration
public bool VerticalTransitionSegment(int segment, int checkForward)
Parameters
| Type |
Name |
Description |
| System.Int32 |
segment |
|
| System.Int32 |
checkForward |
|
Returns
| Type |
Description |
| System.Boolean |
|
Implements
Extension Methods