Click or drag to resize
DigitalRuneInterpolationHelperCriticallyDampedSmoothing Method (Single, Single, Single, Single, Single)
Updates position and velocity according to a critically damped spring (single-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 float position,
	ref float velocity,
	float targetPosition,
	float deltaTime,
	float smoothTime
)

Parameters

position
Type: SystemSingle
The position.
velocity
Type: SystemSingle
The velocity.
targetPosition
Type: SystemSingle
The target position.
deltaTime
Type: SystemSingle
The size of the timestep.
smoothTime
Type: SystemSingle
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