Navigation
API > API/Runtime > API/Runtime/Engine
Collection of useful spring methods which can be used for damping, simulating characters etc. Reference https://theorangeduck.com/page/spring-roll-call
| Name | SpringMath |
| Type | struct |
| Header File | /Engine/Source/Runtime/Engine/Public/Animation/SpringMath.h |
| Include Path | #include "Animation/SpringMath.h" |
Syntax
struct SpringMath
Functions
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void CriticalSpringDamper
(
T& InOutX, |
Simplified version of FMath::CriticallyDampedSmoothing where v_goal is assumed to be 0. | Animation/SpringMath.h | |
static void CriticalSpringDamperAngle
(
float& InOutAngleRadians, |
Specialized angle version of CriticalSpringDamper that handles angle wrapping. | Animation/SpringMath.h | |
static void CriticalSpringDamperQuat
(
FQuat& InOutRotation, |
Specialized quaternion version of CriticalSpringDamper, uses FVector for angular velocity | Animation/SpringMath.h | |
static void CriticalSpringDamperQuatPredict
(
TArrayView< FQuat > OutPredictedRotations, |
Prediction of CriticalSpringDamperQuat | Animation/SpringMath.h | |
static void ExponentialSmoothingApproxAngle
(
float& InOutAngleRadians, |
Specialized angle damper, similar to FMath::ExponentialSmoothingApprox but deals correctly with angle wrap-around. | Animation/SpringMath.h | |
static void ExponentialSmoothingApproxQuat
(
FQuat& InOutRotation, |
Specialized quaternion damper, similar to FMath::ExponentialSmoothingApprox but for quaternions. | Animation/SpringMath.h | |
static float HalfLifeToSmoothingTime
(
float HalfLife |
Convert a halflife to a smoothing time | Animation/SpringMath.h | |
static float SmoothingTimeToDamping
(
float SmoothingTime |
Animation/SpringMath.h | ||
static float SmoothingTimeToHalfLife
(
float SmoothingTime |
Convert a smoothing time to a half life | Animation/SpringMath.h | |
static float SmoothingTimeToStrength
(
float SmoothingTime |
Convert from smoothing time to spring strength. | Animation/SpringMath.h | |
static void SpringCharacterPredict
(
TArrayView< TVector > OutPredictedPositions, |
Gives predicted positions, velocities and accelerations for SpringCharacterUpdate. | Animation/SpringMath.h | |
static void SpringCharacterUpdate
(
TVector& InOutPosition, |
Update the position of a character given a target velocity using a simple damped spring | Animation/SpringMath.h | |
static float StrengthToSmoothingTime
(
float Strength |
Convert from spring strength to smoothing time. | Animation/SpringMath.h | |
static void VelocitySpringCharacterPredict
(
TArrayView< TVector > OutPredictedPositions, |
Gives predicted positions, velocities and accelerations for SpringCharacterUpdate. | Animation/SpringMath.h | |
static void VelocitySpringCharacterUpdate
(
TVector& InOutPosition, |
Update a position representing a character given a target velocity using a velocity spring. | Animation/SpringMath.h | |
static void VelocitySpringDamper
(
TVector& InOutX, |
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 behaviour. | Animation/SpringMath.h | |
static void VelocitySpringDamperF
(
TFloat& InOutX, |
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. | Animation/SpringMath.h |