Struct Cursor

Public

Represents a single point on the polyline represented by the PathInterpolator.

The cursor is a lightweight structure which can be used to move backwards and forwards along a PathInterpolator.

If the PathInterpolator changes (e.g. has its path swapped out), then this cursor is invalidated and cannot be used anymore.

Public Methods

EstimateSmoothCurvature (tangent, smoothingDistance, expectedRadius)
EstimateSmoothTangent (normalizedTangent, smoothingDistance, expectedRadius, beforePathStartContribution, forward=true, backward=true)
GetRemainingPath (buffer)

Appends the remaining path between position and endPoint to buffer.

GetTangents (t1, t2)

The tangent(s) of the curve at the current position.

MoveToCircleIntersection2D<T> (circleCenter3D, radius, transform)
MoveToClosestIntersectionWithLineSegment (origin, direction, range)

Moves to the closest intersection of the line segment (origin + direction*range.x, origin + direction*range.y).

Move as close as possible to the specified point.

MoveToLocallyClosestPoint (point, allowForwards=true, allowBackwards=true)

Moves the cursor to the next geometric corner in the path.

MoveToSegment (index, fractionAlongSegment)

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

MoveWithTurningSpeed (time, speed, turningSpeed, tangent)

Moves the agent along the path, stopping to rotate on the spot when the path changes direction.

Public Static Methods

IntegrateSmoothTangent (p1, p2, tangent, distance, expectedRadius, smoothingDistance)
IntegrateSmoothingKernel (a, b, smoothingDistance)

Integrates exp(-|x|/smoothingDistance)/(2*smoothingDistance) from a to b.

IntegrateSmoothingKernel2 (a, b, smoothingDistance)

Integrates (x - a)*exp(-x/smoothingDistance)/(2*smoothingDistance) from a to b.

StartOfPath (interpolator)

A cursor at the start of the polyline represented by the interpolator.

Public Variables

curvatureDirection

A vector parallel to the local curvature.

Public
distance

Traversed distance from the start of the path.

Public
endPoint

Last point in the path.

Public
fractionAlongCurrentSegment

Fraction of the way along the current segment.

Public
position

Current position.

Public
remainingDistance

Remaining distance until the end of the path.

Public
segmentCount
Public
segmentIndex

Current segment.

Public
tangent

Tangent of the curve at the current position.

Public
valid

True if this instance has a path set.

Public

Private/Protected Members

currentDistance
Private
currentSegmentLength
Private
distanceToSegmentStart
Private
interpolator
Private
version
Private