Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UBlueprintSpringMathLibrary
Description
A velocity spring will damp towards a target that follows a fixed linear target velocity, allowing control of the interpolation speed while still giving a smoothed behavior. A SmoothingTime of 0 will give a linear interpolation between X and TargetX
| Name | VelocitySpringDampVector2D |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Classes/Kismet/BlueprintSpringMathLibrary.h |
| Include Path | #include "Kismet/BlueprintSpringMathLibrary.h" |
| Source | /Engine/Source/Runtime/Engine/Private/BlueprintSpringMathLibrary.cpp |
UFUNCTION (BlueprintCallable, Meta=(Category="Math|Spring|Experimental"))
static void VelocitySpringDampVector2D
(
FVector2D & InOutX,
FVector2D & InOutV,
FVector2D & InOutVi,
const FVector2D & TargetX,
float MaxSpeed,
float DeltaTime,
float SmoothingTime
)
Parameters
| Name | Remarks |
|---|---|
| InOutX | The value to be damped |
| InOutV | The velocity of the value to be damped |
| InOutVi | The intermediate target velocity of the value to be damped |
| TargetX | The target value of X to damp towards |
| MaxSpeed | The desired speed to achieve while damping towards X |
| SmoothingTime | The smoothing time to use while damping towards X. Higher values will give more smoothed behaviour. A value of 0 will give a linear interpolation of X to Target |
| DeltaTime | The timestep in seconds |