Navigation
API > API/Runtime > API/Runtime/SlateCore
One-dimensional spring simulation
| Name | TSpring1D |
| Type | class |
| Header File | /Engine/Source/Runtime/SlateCore/Public/Animation/SlateSprings.h |
| Include Path | #include "Animation/SlateSprings.h" |
Syntax
template<typename FloatType>
class TSpring1D
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TSpring1D () |
Constructor | Animation/SlateSprings.h | |
TSpring1D
(
FloatType InPosition |
Construct at specified position | Animation/SlateSprings.h |
Classes
| Name | Remarks |
|---|---|
| FSpringConfig | Spring configuration |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Config | FSpringConfig | Configuration | Animation/SlateSprings.h | |
| Position | FloatType | Current position | Animation/SlateSprings.h | |
| PreviousTarget | FloatType | Previous target position | Animation/SlateSprings.h | |
| Target | FloatType | Target position | Animation/SlateSprings.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FloatType GetPosition() |
Gets the current position of the spring | Animation/SlateSprings.h | |
FloatType GetTarget() |
Gets the target position | Animation/SlateSprings.h | |
bool IsAtRest() |
Animation/SlateSprings.h | ||
void SetConfig
(
const FSpringConfig& InConfig |
Sets the config for this spring | Animation/SlateSprings.h | |
void SetPosition
(
FloatType InPosition |
Sets the current position (and target position) for the spring | Animation/SlateSprings.h | |
void SetTarget
(
FloatType InTarget |
Sets the target position for the spring | Animation/SlateSprings.h | |
void Tick
(
float InQuantum |
Updates the simulation. Should be called every tick! | Animation/SlateSprings.h |