UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FScopedMovementUpdate Class Reference

#include <ScopedMovementUpdate.h>

+ Inheritance diagram for FScopedMovementUpdate:

Public Types

enum class  EHasMovedTransformOption { eTestTransform , eIgnoreTransform }
 
enum class  EOverlapState { eUseParent , eUnknown , eIncludesOverlaps , eForceUpdate }
 
typedef TArray< FHitResult, TInlineAllocator< 2 > > TScopedBlockingHitArray
 
typedef TArray< FOverlapInfo, TInlineAllocator< 3 > > TScopedOverlapInfoArray
 

Public Member Functions

ENGINE_API FScopedMovementUpdate (USceneComponent *Component, EScopedUpdate::Type ScopeBehavior=EScopedUpdate::DeferredUpdates, bool bRequireOverlapsEventFlagToQueueOverlaps=true)
 
ENGINE_API ~FScopedMovementUpdate ()
 
const FScopedMovementUpdateGetOuterDeferredScope () const
 
bool IsDeferringUpdates () const
 
bool IsGroupUpdate () const
 
ENGINE_API void RevertMove ()
 
bool HasMoved (EHasMovedTransformOption CheckTransform) const
 
ENGINE_API bool IsTransformDirty () const
 
bool HasPendingOverlaps () const
 
bool RequiresOverlapsEventFlag () const
 
const TScopedOverlapInfoArrayGetPendingOverlaps () const
 
const TScopedBlockingHitArrayGetPendingBlockingHits () const
 
ENGINE_API void AppendOverlapsAfterMove (const TOverlapArrayView &NewPendingOverlaps, bool bSweep, bool bIncludesOverlapsAtEnd)
 
void KeepCurrentOverlapsAfterRotation (bool bSweep)
 
void AppendBlockingHitAfterMove (const FHitResult &Hit)
 
void InvalidateCurrentOverlaps ()
 
void ForceOverlapUpdate ()
 
void SetHasTeleported (ETeleportType InTeleportType)
 
ETeleportType GetTeleportType () const
 
bool GetHasMoved () const
 
int32 GetFinalOverlapCandidatesIndex () const
 
EOverlapState GetOverlapState () const
 
const FTransformGetInitialTransform () const
 
USceneComponentGetOwner () const
 

Protected Member Functions

ENGINE_API TOptional< TOverlapArrayViewGetOverlapsAtEnd (class UPrimitiveComponent &PrimComponent, TInlineOverlapInfoArray &OutEndOverlaps, bool bTransformChanged) const
 
ENGINE_API bool SetWorldLocationAndRotation (FVector NewLocation, const FQuat &NewQuat, bool bNoPhysics, ETeleportType Teleport)
 

Protected Attributes

USceneComponentOwner
 
FScopedMovementUpdateOuterDeferredScope
 
EOverlapState CurrentOverlapState
 
ETeleportType TeleportType
 
FTransform InitialTransform
 
FVector InitialRelativeLocation
 
FRotator InitialRelativeRotation
 
FVector InitialRelativeScale
 
int32 FinalOverlapCandidatesIndex
 
TScopedOverlapInfoArray PendingOverlaps
 
TScopedBlockingHitArray BlockingHits
 
uint8 bDeferUpdates:1
 
uint8 bHasMoved:1
 
uint8 bRequireOverlapsEventFlag:1
 
uint8 bIsGroupDeferedUpdate: 1
 

Friends

class USceneComponent
 

Detailed Description

FScopedMovementUpdate creates a new movement scope, within which propagation of moves may be deferred until the end of the outermost scope that does not defer updates. Moves within this scope will avoid updates such as UpdateBounds(), OnUpdateTransform(), UpdatePhysicsVolume(), UpdateChildTransforms() etc until the move is committed (which happens when the last deferred scope goes out of context).

Note that non-deferred scopes are not allowed within outer scopes that defer updates, and any attempt to use one will change the inner scope to use deferred updates.

Member Typedef Documentation

◆ TScopedBlockingHitArray

◆ TScopedOverlapInfoArray

Member Enumeration Documentation

◆ EHasMovedTransformOption

Enumerator
eTestTransform 
eIgnoreTransform 

◆ EOverlapState

Enumerator
eUseParent 
eUnknown 
eIncludesOverlaps 
eForceUpdate 

Constructor & Destructor Documentation

◆ FScopedMovementUpdate()

FScopedMovementUpdate::FScopedMovementUpdate ( USceneComponent Component,
EScopedUpdate::Type  ScopeBehavior = EScopedUpdate::DeferredUpdates,
bool  bRequireOverlapsEventFlagToQueueOverlaps = true 
)

◆ ~FScopedMovementUpdate()

FScopedMovementUpdate::~FScopedMovementUpdate ( )

Member Function Documentation

◆ AppendBlockingHitAfterMove()

void FScopedMovementUpdate::AppendBlockingHitAfterMove ( const FHitResult Hit)
inline

Add blocking hit that will get processed once the move is committed. This is intended for use only by SceneComponent and its derived classes.

◆ AppendOverlapsAfterMove()

void FScopedMovementUpdate::AppendOverlapsAfterMove ( const TOverlapArrayView NewPendingOverlaps,
bool  bSweep,
bool  bIncludesOverlapsAtEnd 
)

Add overlaps to the queued overlaps array. This is intended for use only by SceneComponent and its derived classes whenever movement is performed.

◆ ForceOverlapUpdate()

void FScopedMovementUpdate::ForceOverlapUpdate ( )
inline

Force full overlap update once this scope finishes.

◆ GetFinalOverlapCandidatesIndex()

int32 FScopedMovementUpdate::GetFinalOverlapCandidatesIndex ( ) const
inline

If not INDEX_NONE, overlaps at this index and beyond in PendingOverlaps are at the final destination

◆ GetHasMoved()

bool FScopedMovementUpdate::GetHasMoved ( ) const
inline

True if this scoped movement resulted in the component being moved

◆ GetInitialTransform()

const FTransform & FScopedMovementUpdate::GetInitialTransform ( ) const
inline

The initial transform when this scoped movement began.

◆ GetOuterDeferredScope()

const FScopedMovementUpdate * FScopedMovementUpdate::GetOuterDeferredScope ( ) const
inline

Get the scope containing this scope. A scope only has an outer scope if they both defer updates.

◆ GetOverlapsAtEnd()

TOptional< TOverlapArrayView > FScopedMovementUpdate::GetOverlapsAtEnd ( class UPrimitiveComponent &  PrimComponent,
TInlineOverlapInfoArray OutEndOverlaps,
bool  bTransformChanged 
) const
protected

Fills in the list of overlaps at the end location (in EndOverlaps). Returns pointer to the list, or null if it can't be computed.

◆ GetOverlapState()

FScopedMovementUpdate::EOverlapState FScopedMovementUpdate::GetOverlapState ( ) const
inline

The current overlap state of this scoped move.

◆ GetOwner()

USceneComponent * FScopedMovementUpdate::GetOwner ( ) const
inline

The owning scene component this scoped movement is modifying.

◆ GetPendingBlockingHits()

const FScopedMovementUpdate::TScopedBlockingHitArray & FScopedMovementUpdate::GetPendingBlockingHits ( ) const
inline

Returns the list of pending blocking hits, which will be used for notifications once the move is committed.

◆ GetPendingOverlaps()

const FScopedMovementUpdate::TScopedOverlapInfoArray & FScopedMovementUpdate::GetPendingOverlaps ( ) const
inline

Returns the pending overlaps within this scope.

◆ GetTeleportType()

ETeleportType FScopedMovementUpdate::GetTeleportType ( ) const
inline

The type of teleport which this scoped move should use to determine overlaps.

◆ HasMoved()

bool FScopedMovementUpdate::HasMoved ( EHasMovedTransformOption  CheckTransform) const
inline

Returns whether movement has occurred at all during this scope, optionally checking if the transform is different (since changing scale does not go through a move). RevertMove() sets this back to false.

◆ HasPendingOverlaps()

bool FScopedMovementUpdate::HasPendingOverlaps ( ) const
inline

Returns true if there are pending overlaps queued in this scope.

◆ InvalidateCurrentOverlaps()

void FScopedMovementUpdate::InvalidateCurrentOverlaps ( )
inline

Clear overlap state at current location, we don't know what it is.

◆ IsDeferringUpdates()

bool FScopedMovementUpdate::IsDeferringUpdates ( ) const
inline

Return true if deferring updates, false if updates are applied immediately.

◆ IsGroupUpdate()

bool FScopedMovementUpdate::IsGroupUpdate ( ) const
inline

Return true if this movement update should be deferred and applied later in the frame as part of a larger group of components.

◆ IsTransformDirty()

bool FScopedMovementUpdate::IsTransformDirty ( ) const

Returns true if the Component's transform differs from that at the start of the scoped update.

◆ KeepCurrentOverlapsAfterRotation()

void FScopedMovementUpdate::KeepCurrentOverlapsAfterRotation ( bool  bSweep)
inline

Keep current pending overlaps after a move but make note that there was movement (just a symmetric rotation).

◆ RequiresOverlapsEventFlag()

bool FScopedMovementUpdate::RequiresOverlapsEventFlag ( ) const
inline

Returns true if we require GetGenerateOverlapEvents() on both the moving object and the overlapped object to add them to the pending overlaps list. These flags will still be required when dispatching calls to UpdateOverlaps(), but this allows some custom processing of queued overlaps that would be otherwise missed along the way.

◆ RevertMove()

void FScopedMovementUpdate::RevertMove ( )

Revert movement to the initial location of the Component at the start of the scoped update. Also clears pending overlaps and sets bHasMoved to false.

◆ SetHasTeleported()

void FScopedMovementUpdate::SetHasTeleported ( ETeleportType  InTeleportType)
inline

Registers that this move is a teleport

◆ SetWorldLocationAndRotation()

bool FScopedMovementUpdate::SetWorldLocationAndRotation ( FVector  NewLocation,
const FQuat NewQuat,
bool  bNoPhysics,
ETeleportType  Teleport 
)
protected

Friends And Related Symbol Documentation

◆ USceneComponent

friend class USceneComponent
friend

Member Data Documentation

◆ bDeferUpdates

uint8 FScopedMovementUpdate::bDeferUpdates
protected

◆ bHasMoved

uint8 FScopedMovementUpdate::bHasMoved
protected

◆ bIsGroupDeferedUpdate

uint8 FScopedMovementUpdate::bIsGroupDeferedUpdate
protected

True when DeferredGroupUpdates is the type applied. See notes above.

◆ BlockingHits

TScopedBlockingHitArray FScopedMovementUpdate::BlockingHits
protected

◆ bRequireOverlapsEventFlag

uint8 FScopedMovementUpdate::bRequireOverlapsEventFlag
protected

◆ CurrentOverlapState

EOverlapState FScopedMovementUpdate::CurrentOverlapState
protected

◆ FinalOverlapCandidatesIndex

int32 FScopedMovementUpdate::FinalOverlapCandidatesIndex
protected

◆ InitialRelativeLocation

FVector FScopedMovementUpdate::InitialRelativeLocation
protected

◆ InitialRelativeRotation

FRotator FScopedMovementUpdate::InitialRelativeRotation
protected

◆ InitialRelativeScale

FVector FScopedMovementUpdate::InitialRelativeScale
protected

◆ InitialTransform

FTransform FScopedMovementUpdate::InitialTransform
protected

◆ OuterDeferredScope

FScopedMovementUpdate* FScopedMovementUpdate::OuterDeferredScope
protected

◆ Owner

USceneComponent* FScopedMovementUpdate::Owner
protected

◆ PendingOverlaps

TScopedOverlapInfoArray FScopedMovementUpdate::PendingOverlaps
protected

◆ TeleportType

ETeleportType FScopedMovementUpdate::TeleportType
protected

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