Navigation
API > API/Runtime > API/Runtime/AnimGraphRuntime > API/Runtime/AnimGraphRuntime/UKismetAnimationLibrary
Description
This function calculates the velocity of an offset position on a bone / socket over time. The bone's / socket's motion can be expressed within a reference frame (another bone / socket). You need to hook up a valid PositionHistory variable to this for storage.
| Name | K2_CalculateVelocityFromSockets |
| Type | function |
| Header File | /Engine/Source/Runtime/AnimGraphRuntime/Public/KismetAnimationLibrary.h |
| Include Path | #include "KismetAnimationLibrary.h" |
| Source | /Engine/Source/Runtime/AnimGraphRuntime/Private/KismetAnimationLibrary.cpp |
UFUNCTION (BlueprintCallable, Category="Animation|Utilities",
Meta=(NotBlueprintThreadSafe, DisplayName="Calculate Velocity From Sockets", ScriptName="CalculateVelocityFromSockets", NumberOfSamples="16", VelocityMin="0.f", VelocityMax="128.f"))
static float K2_CalculateVelocityFromSockets
(
float DeltaSeconds,
USkeletalMeshComponent * Component,
const FName SocketOrBoneName,
const FName ReferenceSocketOrBone,
ERelativeTransformSpace SocketSpace,
FVector OffsetInBoneSpace,
UPARAM FPositionHistory & History,
int32 NumberOfSamples,
float VelocityMin,
float VelocityMax,
EEasingFuncType EasingType,
const FRuntimeFloatCurve & CustomCurve
)
Parameters
| Name | Remarks |
|---|---|
| DeltaSeconds | The time passed in seconds |
| Component | The skeletal component to look for the bones / sockets |
| SocketOrBoneName | The name of the bone / socket to track. |
| ReferenceSocketOrBone | The name of the bone / socket to use as a frame of reference (or None if no frame of reference == world space). |
| SocketSpace | The space to use for the two sockets / bones |
| OffsetInBoneSpace | The relative position in the space of the bone / socket 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) |
| EasingType | The easing function to use |
| CustomCurve | The curve to use if the easing type is "Custom" |