A* Pathfinding Project  4.0.8
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
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.
 
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.
 
void SetPath (List< Vector3 > path)
 Set the path to interpolate along.
 

Protected Member Functions

virtual void NextSegment ()
 
virtual void PrevSegment ()
 

Properties

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

Private Attributes

float currentDistance
 
float currentSegmentLength
 
float distanceToSegmentStart
 
List< Vector3 > path
 
float totalDistance
 

Member Function Documentation

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

Move as close as possible to the specified point.

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.

virtual void NextSegment ( )
protectedvirtual
virtual void PrevSegment ( )
protectedvirtual
void SetPath ( List< Vector3 >  path)

Set the path to interpolate along.

This will reset all interpolation variables.

Member Data Documentation

float currentDistance
private
float currentSegmentLength
private
float distanceToSegmentStart
private
List<Vector3> path
private
float totalDistance
private

Property Documentation

float distance
getset

Traversed distance from the start of the path.

virtual Vector3 position
get

Current position.

float remainingDistance
getset

Remaining distance until the end of the path.

int segmentIndex
getset

Current segment.

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

Vector3 tangent
get

Tangent of the curve at the current position.

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: