| InterpolationHelperCriticallyDampedSmoothing Method (Single, Single, Single, Single, Single) |
Updates position and velocity according to a critically damped spring (single-precision).
Namespace: DigitalRune.Mathematics.InterpolationAssembly: 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
)
Public Shared Sub CriticallyDampedSmoothing (
ByRef position As Single,
ByRef velocity As Single,
targetPosition As Single,
deltaTime As Single,
smoothTime As Single
)
public:
static void CriticallyDampedSmoothing(
float% position,
float% velocity,
float targetPosition,
float deltaTime,
float smoothTime
)
static member CriticallyDampedSmoothing :
position : float32 byref *
velocity : float32 byref *
targetPosition : float32 *
deltaTime : float32 *
smoothTime : float32 -> unit
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