Module |
|
Header |
/Engine/Source/Runtime/AnimGraphRuntime/Public/KismetAnimationLibrary.h |
Include |
#include "KismetAnimationLibrary.h" |
Source |
/Engine/Source/Runtime/AnimGraphRuntime/Private/KismetAnimationLibrary.cpp |
static float K2_CalculateVelocityFromSockets
(
float DeltaSeconds,
USkeletalMeshComponent * Component,
const FName SocketOrBoneName,
const FName ReferenceSocketOrBone,
ERelativeTransformSpace SocketSpace,
FVector OffsetInBoneSpace,
FPositionHistory & History,
int32 NumberOfSamples,
float VelocityMin,
float VelocityMax,
EEasingFuncType EasingType,
const FRuntimeFloatCurve & CustomCurve
)
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.
Parameter |
Description |
---|---|
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" |