UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FCameraShakeState Struct Reference

#include <CameraShakeBase.h>

Public Member Functions

ENGINE_API FCameraShakeState ()
 
ENGINE_API void Start (const FCameraShakeInfo &InShakeInfo)
 
ENGINE_API void Start (const FCameraShakeInfo &InShakeInfo, TOptional< float > InDurationOverride)
 
ENGINE_API void Start (const UCameraShakePattern *InShakePattern)
 
ENGINE_API void Start (const UCameraShakePattern *InShakePattern, const FCameraShakePatternStartParams &InParams)
 
ENGINE_API float Update (float DeltaTime)
 
ENGINE_API float Scrub (float AbsoluteTime)
 
ENGINE_API void Stop (bool bImmediately)
 
bool IsPlaying () const
 
bool IsBlendingIn () const
 
bool IsBlendingOut () const
 
float GetElapsedTime () const
 
float GetCurrentBlendInTime () const
 
float GetCurrentBlendOutTime () const
 
const FCameraShakeInfoGetShakeInfo () const
 
bool HasDuration () const
 
float GetDuration () const
 
bool IsInfinite () const
 

Detailed Description

Transitive state of a shake or shake pattern.

Constructor & Destructor Documentation

◆ FCameraShakeState()

FCameraShakeState::FCameraShakeState ( )

Create a new camera shake state

Member Function Documentation

◆ GetCurrentBlendInTime()

float FCameraShakeState::GetCurrentBlendInTime ( ) const
inline

Returns the current time into the blend in (only valid if IsBlendingIn() returns true)

◆ GetCurrentBlendOutTime()

float FCameraShakeState::GetCurrentBlendOutTime ( ) const
inline

Returns the current time into the blend in (only valid if IsBlendingOut() returns true)

◆ GetDuration()

float FCameraShakeState::GetDuration ( ) const
inline

Helper method to get GetShakeInfo().Duration.Get()

◆ GetElapsedTime()

float FCameraShakeState::GetElapsedTime ( ) const
inline

Returns the elapsed time of the shake's current run

◆ GetShakeInfo()

const FCameraShakeInfo & FCameraShakeState::GetShakeInfo ( ) const
inline

Returns the current shake info

◆ HasDuration()

bool FCameraShakeState::HasDuration ( ) const
inline

Helper method to get GetShakeInfo().Duration.IsFixed()

◆ IsBlendingIn()

bool FCameraShakeState::IsBlendingIn ( ) const
inline

Returns whether the shake is blending in

◆ IsBlendingOut()

bool FCameraShakeState::IsBlendingOut ( ) const
inline

Returns whether the shake is blending out

◆ IsInfinite()

bool FCameraShakeState::IsInfinite ( ) const
inline

Helper method to get GetShakeInfo().Duration.IsInifnite()

◆ IsPlaying()

bool FCameraShakeState::IsPlaying ( ) const
inline

Returns whether the shake is playing

◆ Scrub()

float FCameraShakeState::Scrub ( float  AbsoluteTime)

Scrub the state to the given absolute time.

If the state isn't managed (i.e. it doesn't have any fixed duration information), this doesn't do anything and returns 1.

If the state is managed, this updates the internal state of this class and auto-computes when the shake has ended, along with a blending weight if there is any blending in/out.

Parameters
AbsoluteTimeThe time to scrub to
Returns
The evaluated blending weight (if any) for the scrub time

◆ Start() [1/4]

void FCameraShakeState::Start ( const FCameraShakeInfo InShakeInfo)

Initialize the state with a shake's info and start playing.

◆ Start() [2/4]

void FCameraShakeState::Start ( const FCameraShakeInfo InShakeInfo,
TOptional< float InDurationOverride 
)

Initialize the state with a shake's info and start playing.

◆ Start() [3/4]

void FCameraShakeState::Start ( const UCameraShakePattern InShakePattern)

Initialize the state with a shake's info and start playing.

◆ Start() [4/4]

void FCameraShakeState::Start ( const UCameraShakePattern InShakePattern,
const FCameraShakePatternStartParams InParams 
)

Initialize the state with a shake's info and start playing.

◆ Stop()

void FCameraShakeState::Stop ( bool  bImmediately)

Marks the shake has having been stopped.

This renders the shake inactive (if we need to stop immediately), or starts the shake's blend-out, if any (if we don't stop immediately). If no duration or blending information is available (i.e. if the shake duration is "Custom"), stopping non-immediately does nothing: the sub-class is expected to handle it.

◆ Update()

float FCameraShakeState::Update ( float  DeltaTime)

Updates the state with a delta time.

If the state isn't managed (i.e. it doesn't have any fixed duration information), this doesn't do anything and returns 1.

If the state is managed, this updates the internal state of this class and auto-computes when the shake has ended, along with a blending weight if there is any blending in/out.

Parameters
DeltaTimeThe elapsed time since last update
Returns
The evaluated blending weight (if any) for the new time

The documentation for this struct was generated from the following files: