Module |
|
Header |
/Engine/Source/Runtime/AnimGraphRuntime/Public/KismetAnimationLibrary.h |
Include |
#include "KismetAnimationLibrary.h" |
Source |
/Engine/Source/Runtime/AnimGraphRuntime/Private/KismetAnimationLibrary.cpp |
static float K2_CalculateVelocityFromPositionHistory
(
float DeltaSeconds,
FVector Position,
FPositionHistory & History,
int32 NumberOfSamples,
float VelocityMin,
float VelocityMax
)
This function calculates the velocity of a position changing over time. You need to hook up a valid PositionHistory variable to this for storage.
Parameter |
Description |
---|---|
DeltaSeconds |
The time passed in seconds |
Position |
The position to track over time. |
History |
The history to use for storage. |
NumberOfSamples |
The number of samples to use for the history. The higher the number of samples - the smoother the velocity changes. |
VelocityMin |
The minimum velocity to use for normalization (if both min and max are set to 0, normalization is turned off) |
VelocityMax |
The maximum velocity to use for normalization (if both min and max are set to 0, normalization is turned off) |