38 vel0 =
default(
float);
39 vel1 =
default(
float);
97 float i = Mathf.Clamp01((t -
t0) / (
t1 -
t0));
101 float h00 = (2 * i3 - 3 * i2 + 1) *
pos0;
102 float h10 = (i3 - 2 * i2 + i) * (
t1 -
t0) *
vel0;
103 float h01 = (-2 * i3 + 3 * i2) *
pos1;
104 float h11 = (i3 - i2) * (
t1 -
t0) *
vel1;
106 return h00 + h10 + h01 + h11;
115 float C1 = 1.0f / C00;
120 i = Mathf.Clamp01((t -
t0) * C1);
126 i3_ = i2_ * i + i_ * i2;
129 float h00_ = (i3_ * 2 - i2_ * 3) *
pos0;
130 float h10_ = (i3_ - 2 * i2_ + i_) * C00 *
vel0;
131 float h01_ = (i2_ * 3 - 2 * i3_) *
pos1;
132 float h11_ = (i3_ - i2_) * C00 *
vel1;
134 return h00_ + h01_ + h10_ + h11_;
143 float C1 = 1.0f / C00;
148 i = Mathf.Clamp01((t -
t0) * C1);
155 i3_ = i2_ * i + i_ * i2;
158 float h00 = (2 * i3 - 3 * i2 + 1) *
pos0;
159 float h00_ = (i3_ * 2 - i2_ * 3) *
pos0;
161 float h10 = (i3 - 2 * i2 + i) * C00 *
vel0;
162 float h10_ = (i3_ - 2 * i2_ + i_) * C00 *
vel0;
164 float h01 = (3 * i2 - 2 * i3) *
pos1;
165 float h01_ = (i2_ * 3 - 2 * i3_) *
pos1;
167 float h11 = (i3 - i2) * C00 *
vel1;
168 float h11_ = (i3_ - i2_) * C00 *
vel1;
170 position = h00 + h01 + h10 + h11;
171 velocity = h00_ + h01_ + h10_ + h11_;
Represents a spline that travels from one point in space to another over a specified time frame....
HermiteSpline(float pos0, float pos1)
Constructs a spline by specifying the positions of the two endpoints. The velocity at each endpoint i...
HermiteSpline(float t0, float t1, float pos0, float pos1, float vel0, float vel1)
Constructs a spline by specifying the positions, velocities, and times of the endpoints.
HermiteSpline(float pos0, float pos1, float vel0, float vel1)
Constructs a spline by specifying the positions and velocities of the two endpoints....
float VelocityAt(float t)
Gets the first derivative of position at time t. The time is clamped within the t0 - t1 range.
HermiteSpline(float pos0, float pos1, float vel0, float vel1, float length)
Constructs a spline by specifying the positions and velocities of the two endpoints....
float PositionAt(float t)
Gets the position at time t along this spline. The time is clamped within the t0 - t1 range.
void PositionAndVelAt(float t, out float position, out float velocity)
Gets both the position and the first derivative of position at time ti. The time is clamped within th...