TSpring1D

One-dimensional spring simulation

Windows
MacOS
Linux

References

Module

SlateCore

Header

/Engine/Source/Runtime/SlateCore/Public/Animation/SlateSprings.h

Include

#include "Animation/SlateSprings.h"

Syntax

template<typename FloatType>
class TSpring1D

Remarks

One-dimensional spring simulation

Constructors

Name Description

Public function

TSpring1D()

Constructor

Public function

TSpring1D

(
    FloatType InPosition
)

Construct at specified position

Functions

Name Description

Public function Const

FloatType

 

GetPosition()

Gets the current position of the spring

Public function Const

FloatType

 

GetTarget()

Gets the target position

Public function

bool

 

IsAtRest()

Public function

void

 

SetConfig

(
    const FSpringConfig& InConfig
)

Sets the config for this spring

Public function

void

 

SetPosition

(
    FloatType InPosition
)

Sets the current position (and target position) for the spring

Public function

void

 

SetTarget

(
    FloatType InTarget
)

Sets the target position for the spring

Public function

void

 

Tick

(
    float InQuantum
)

Updates the simulation. Should be called every tick!

Classes

Name

Description

Public class

FSpringConfig

Spring configuration

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss