Language:
Discover
By Skill Level
By Category

USpringArmComponent

Choose your OS:

Inheritance Hierarchy

Syntax

class USpringArmComponent : public USceneComponent

Remarks

This component tries to maintain its children at a fixed distance from the parent, but will retract the children if there is a collision, and spring back when there is no collision.

Example: Use as a 'camera boom' to keep the follow camera for a player from colliding into the world.

Variables

Name Description

Public variable

uint32 : 1

 

bDoCollisionTest

If true, do a collision test using ProbeChannel and ProbeSize to prevent camera clipping into level.

Public variable

uint32 : 1

 

bDrawDebugLagMarkers

If true and camera location lag is enabled, draws markers at the camera target (in green) and the lagged position (in yellow).

Public variable

uint32 : 1

 

bEnableCameraLag

If true, camera lags behind target position to smooth its movement.

Public variable

uint32 : 1

 

bEnableCameraRotationLag

If true, camera lags behind target rotation to smooth its movement.

Public variable

uint32 : 1

 

bInheritPitch

Should we inherit pitch from parent component. Does nothing if using Absolute Rotation.

Public variable

uint32 : 1

 

bInheritRoll

Should we inherit roll from parent component. Does nothing if using Absolute Rotation.

Public variable

uint32 : 1

 

bInheritYaw

Should we inherit yaw from parent component. Does nothing if using Absolute Rotation.

Public variable

uint32 : 1

 

bUseCameraLagSubstepping

If bUseCameraLagSubstepping is true, sub-step camera damping so that it handles fluctuating frame rates well (though this comes at a cost).

Public variable

uint32 : 1

 

bUsePawnControlRotation

If this component is placed on a pawn, should it use the view/control rotation of the pawn where possible? When disabled, the component will revert to using the stored RelativeRotation of the component.

Public variable

float

 

CameraLagMaxDistance

Max distance the camera target may lag behind the current location.

Public variable

float

 

CameraLagMaxTimeStep

Max time step used when sub-stepping camera lag.

Public variable

float

 

CameraLagSpeed

If bEnableCameraLag is true, controls how quickly camera reaches target position.

Public variable

float

 

CameraRotationLagSpeed

If bEnableCameraRotationLag is true, controls how quickly camera reaches target position.

Public variable

FVector

 

PreviousArmOrigin

Public variable

FVector

 

PreviousDesiredLoc

Temporary variables when using camera lag, to record previous camera position

Public variable

FRotator

 

PreviousDesiredRot

Temporary variable for lagging camera rotation, for previous rotation

Public variable

TEnumAsByte < EC ...

 

ProbeChannel

Collision channel of the query probe (defaults to ECC_Camera)

Public variable

float

 

ProbeSize

How big should the query probe sphere be (in unreal units)

Protected variable

FVector

 

RelativeSocketLocation

Cached component-space socket location

Protected variable

FQuat

 

RelativeSocketRotation

Cached component-space socket rotation

Public variable

FVector

 

SocketOffset

Offset at end of spring arm; use this instead of the relative offset of the attached component to ensure the line trace works as desired

Public variable

float

 

TargetArmLength

Natural length of the spring arm when there are no collisions

Public variable

FVector

 

TargetOffset

Offset at start of spring, applied in world space.

Constructors

Name Description

Public function

USpringArmComponent

(
    const FObjectInitializer & ObjectIn...
)

Functions

Name Description

Protected function Virtual

FVector

 

BlendLocations

(
    const FVector & DesiredArmLocation,
    const FVector & TraceHitLocation,
    bool bHitSomething,
    float DeltaTime
)

This function allows subclasses to blend the trace hit location with the desired arm location; by default it returns bHitSomething ? TraceHitLocation : DesiredArmLocation

Public function

FRotator

 

GetTargetRotation()

Get the target rotation we inherit, used as the base target for the boom rotation.

Protected function Virtual

void

 

UpdateDesiredArmLocation

(
    bool bDoTrace,
    bool bDoLocationLag,
    bool bDoRotationLag,
    float DeltaTime
)

Updates the desired arm location, calling BlendLocations to do the actual blending if a trace is done

Overridden from USceneComponent

Name Description

Public function Virtual

FTransform

 

GetSocketTransform

(
    FName InSocketName,
    ERelativeTransformSpace TransformSp...
)

Get world-space socket transform.

Public function Virtual

bool

 

HasAnySockets()

End of UActorComponent interface.

Public function Virtual

void

 

QuerySupportedSockets

Get a list of sockets this component contains

Overridden from UActorComponent

Name Description

Public function Virtual

void

 

ApplyWorldOffset

(
    const FVector & InOffset,
    bool bWorldShift
)

Called by owner actor on position shifting Component should update all relevant data structures to reflect new actor location

Public function Virtual

void

 

OnRegister()

UActorComponent interface.

Public function Virtual

void

 

TickComponent

(
    float DeltaTime,
    enum ELevelTick TickType,
    FActorComponentTickFunction * T...
)

Function called every frame on this ActorComponent.

Overridden from UObject

Name Description

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object, and immediately after any undo/redo.

Constants

Name

Description

SocketName

End of USceneComponent interface.

References

Module

Engine

Header

Runtime/Engine/Classes/GameFramework/SpringArmComponent.h