Click or drag to resize
DigitalRuneInterpolationHelperCriticallyDampedSmoothing Method (Double, Double, Double, Double, Double)
Updates position and velocity according to a critically damped spring (double-precision).

Namespace: DigitalRune.Mathematics.Interpolation
Assembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax
public static void CriticallyDampedSmoothing(
	ref double position,
	ref double velocity,
	double targetPosition,
	double deltaTime,
	double smoothTime
)

Parameters

position
Type: SystemDouble
The position.
velocity
Type: SystemDouble
The velocity.
targetPosition
Type: SystemDouble
The target position.
deltaTime
Type: SystemDouble
The size of the timestep.
smoothTime
Type: SystemDouble
smoothTime is parameter that determines how fast the targetPosition is reached. smoothTime is equal to the time that is required to reach the target when at maximum speed.
Remarks

At the beginning of the method position and velocity are the current position and velocity of an object. The object should move to the targetPosition. At the end of the method position and velocity are updated to the new position after deltaTime has elapsed.

The position and velocity are changed according to the movement of a critically damped spring. This generates a smooth movement that can be used to interpolate values.

See Also