Struct Leap::Unity::Animation::HermiteSpline3

struct Leap.Unity.Animation.HermiteSpline3

Represents a spline that travels from one point in space to another over a specified time frame. The two endpoints are specified, as well as the instantaneous velocity at these two endpoints.

You may ask for the position or the velocity at any time during the splines duration.

Public Functions

HermiteSpline3 (Vector3 pos0, Vector3 pos1)

Constructs a spline by specifying the positions of the two endpoints. The velocity at each endpoint is zero, and the time range of the spline is 0 to 1.

HermiteSpline3 (Vector3 pos0, Vector3 pos1, Vector3 vel0, Vector3 vel1)

Constructs a spline by specifying the positions and velocities of the two endpoints. The time range of the spline is 0 to 1.

HermiteSpline3 (Vector3 pos0, Vector3 pos1, Vector3 vel0, Vector3 vel1, float length)

Constructs a spline by specifying the positions and velocities of the two endpoints. The time range of the spline is 0 to length.

HermiteSpline3 (float t0, float t1, Vector3 pos0, Vector3 pos1, Vector3 vel0, Vector3 vel1)

Constructs a spline by specifying the positions, velocities, and times of the endpoints.

Vector3 PositionAt (float t)

Gets the position at time t along this spline.

The time is clamped to t0, but can extrapolate beyond t1.

Vector3 VelocityAt (float t)

Gets the first derivative of position at time t. The time is clamped within the t0 - t1 range (thus velocity is unaffected by extrapolation).

void PositionAndVelAt (float t, out Vector3 position, out Vector3 velocity)

Gets both the position and the first derivative of position at time ti. The time is clamped within the t0 - t1 range. If you wish to extrapolate, use PositionAt(t).