A* Pathfinding Project  4.1.19
The A* Pathfinding Project for Unity 3D
PathInterpolator Class Reference

Interpolates along a sequence of points. More...

Detailed Description

Interpolates along a sequence of points.

Public Member Functions

void MoveToCircleIntersection2D (Vector3 circleCenter3D, float radius, IMovementPlane transform)
 
void MoveToClosestPoint (Vector3 point)
 Move as close as possible to the specified point. More...
 
void MoveToLocallyClosestPoint (Vector3 point, bool allowForwards=true, bool allowBackwards=true)
 
void MoveToSegment (int index, float fractionAlongSegment)
 Move to the specified segment and move a fraction of the way to the next segment. More...
 
void SetPath (List< Vector3 > path)
 Set the path to interpolate along. More...
 

Protected Member Functions

virtual void NextSegment ()
 
virtual void PrevSegment ()
 

Properties

float distance [get, set]
 Traversed distance from the start of the path. More...
 
virtual Vector3 position [get]
 Current position. More...
 
float remainingDistance [get, set]
 Remaining distance until the end of the path. More...
 
int segmentIndex [get, private set]
 Current segment. More...
 
Vector3 tangent [get]
 Tangent of the curve at the current position. More...
 
bool valid [get]
 True if this instance has a path set. More...
 

Private Attributes

float currentDistance
 
float currentSegmentLength = float.PositiveInfinity
 
float distanceToSegmentStart
 
List< Vector3 > path
 
float totalDistance = float.PositiveInfinity
 

Member Function Documentation

◆ MoveToCircleIntersection2D()

void MoveToCircleIntersection2D ( Vector3  circleCenter3D,
float  radius,
IMovementPlane  transform 
)

◆ MoveToClosestPoint()

void MoveToClosestPoint ( Vector3  point)

Move as close as possible to the specified point.

◆ MoveToLocallyClosestPoint()

void MoveToLocallyClosestPoint ( Vector3  point,
bool  allowForwards = true,
bool  allowBackwards = true 
)

◆ MoveToSegment()

void MoveToSegment ( int  index,
float  fractionAlongSegment 
)

Move to the specified segment and move a fraction of the way to the next segment.

◆ NextSegment()

virtual void NextSegment ( )
protectedvirtual

◆ PrevSegment()

virtual void PrevSegment ( )
protectedvirtual

◆ SetPath()

void SetPath ( List< Vector3 >  path)

Set the path to interpolate along.

This will reset all interpolation variables.

Member Data Documentation

◆ currentDistance

float currentDistance
private

◆ currentSegmentLength

float currentSegmentLength = float.PositiveInfinity
private

◆ distanceToSegmentStart

float distanceToSegmentStart
private

◆ path

List<Vector3> path
private

◆ totalDistance

float totalDistance = float.PositiveInfinity
private

Property Documentation

◆ distance

float distance
getset

Traversed distance from the start of the path.

◆ position

virtual Vector3 position
get

Current position.

◆ remainingDistance

float remainingDistance
getset

Remaining distance until the end of the path.

◆ segmentIndex

int segmentIndex
getprivate set

Current segment.

The start and end points of the segment are path[value] and path[value+1].

◆ tangent

Vector3 tangent
get

Tangent of the curve at the current position.

◆ valid

bool valid
get

True if this instance has a path set.

See also
SetPath

The documentation for this class was generated from the following file: