Navigation
Unreal Engine C++ API Reference > Runtime > Engine > GameFramework
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- USceneComponent
- USpringArmComponent
References
Module | Engine |
Header | /Engine/Source/Runtime/Engine/Classes/GameFramework/SpringArmComponent.h |
Include | #include "GameFramework/SpringArmComponent.h" |
Syntax
UCLASS (ClassGroup=Camera, Meta=(BlueprintSpawnableComponent), HideCategories=(Mobility),
MinimalAPI)
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' or 'selfie stick' to keep the follow camera for a player from colliding into the world.
Variables
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() ![]() |
uint32: 1 | bClampToMaxPhysicsDeltaTime | If true AND the view target is simulating using physics then use the same max timestep cap as the physics system. |
![]() ![]() ![]() ![]() |
uint32: 1 | bDoCollisionTest | If true, do a collision test using ProbeChannel and ProbeSize to prevent camera clipping into level. |
![]() ![]() ![]() ![]() |
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). |
![]() ![]() ![]() ![]() |
uint32: 1 | bEnableCameraLag | If true, camera lags behind target position to smooth its movement. |
![]() ![]() ![]() ![]() |
uint32: 1 | bEnableCameraRotationLag | If true, camera lags behind target rotation to smooth its movement. |
![]() ![]() ![]() ![]() |
uint32: 1 | bInheritPitch | Should we inherit pitch from parent component. Does nothing if using Absolute Rotation. |
![]() ![]() ![]() ![]() |
uint32: 1 | bInheritRoll | Should we inherit roll from parent component. Does nothing if using Absolute Rotation. |
![]() ![]() ![]() ![]() |
uint32: 1 | bInheritYaw | Should we inherit yaw from parent component. Does nothing if using Absolute Rotation. |
![]() |
bool | bIsCameraFixed | Temporary variables when applying Collision Test displacement to notify if its being applied and by how much |
![]() ![]() ![]() ![]() |
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). |
![]() ![]() ![]() ![]() |
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. |
![]() ![]() ![]() ![]() |
float | CameraLagMaxDistance | Max distance the camera target may lag behind the current location. |
![]() ![]() ![]() ![]() |
float | CameraLagMaxTimeStep | Max time step used when sub-stepping camera lag. |
![]() ![]() ![]() ![]() |
float | CameraLagSpeed | If bEnableCameraLag is true, controls how quickly camera reaches target position. |
![]() ![]() ![]() ![]() |
float | CameraRotationLagSpeed | If bEnableCameraRotationLag is true, controls how quickly camera reaches target position. |
![]() |
FVector | PreviousArmOrigin | |
![]() |
FVector | PreviousDesiredLoc | Temporary variables when using camera lag, to record previous camera position |
![]() |
FRotator | PreviousDesiredRot | Temporary variable for lagging camera rotation, for previous rotation |
![]() ![]() ![]() ![]() |
TEnumAsByte< ECollisionChannel > | ProbeChannel | Collision channel of the query probe (defaults to ECC_Camera) |
![]() ![]() ![]() ![]() |
float | ProbeSize | How big should the query probe sphere be (in unreal units) |
![]() |
FVector | RelativeSocketLocation | Cached component-space socket location |
![]() |
FQuat | RelativeSocketRotation | Cached component-space socket rotation |
![]() ![]() ![]() ![]() |
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 |
![]() ![]() ![]() ![]() |
float | TargetArmLength | Natural length of the spring arm when there are no collisions |
![]() ![]() ![]() ![]() |
FVector | TargetOffset | Offset at start of spring, applied in world space. |
![]() |
FVector | UnfixedCameraPosition |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
USpringArmComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
FVector | BlendLocations
(
const FVector& DesiredArmLocation, |
This function allows subclasses to blend the trace hit location with the desired arm location; by default it returns bHitSomething ? TraceHitLocation : DesiredArmLocation |
![]() ![]() ![]() |
FRotator | Returns the desired rotation for the spring arm, before the rotation constraints such as bInheritPitch etc are enforced. | |
![]() ![]() ![]() ![]() |
FRotator | Get the target rotation we inherit, used as the base target for the boom rotation. | |
![]() ![]() ![]() ![]() |
FVector | Get the position where the camera should be without applying the Collision Test displacement | |
![]() ![]() ![]() ![]() |
bool | Is the Collision Test displacement being applied? | |
![]() ![]() |
void | UpdateDesiredArmLocation
(
bool bDoTrace, |
Updates the desired arm location, calling BlendLocations to do the actual blending if a trace is done |
Overridden from USceneComponent
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
FTransform | GetSocketTransform
(
FName InSocketName, |
Get world-space socket transform. |
![]() ![]() ![]() |
bool | Returns true if this component has any sockets | |
![]() ![]() ![]() |
void | QuerySupportedSockets
(
TArray< FComponentSocketDescription >& OutSockets |
Get a list of sockets this component contains |
Overridden from UActorComponent
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | ApplyWorldOffset
(
const FVector& InOffset, |
Called by owner actor on position shifting Component should update all relevant data structures to reflect new actor location |
![]() ![]() |
void | OnRegister () |
Called when a component is registered, after Scene is set, but before CreateRenderState_Concurrent or OnCreatePhysicsState are called. |
![]() ![]() |
void | TickComponent
(
float DeltaTime, |
Function called every frame on this ActorComponent. |
Overridden from UObject
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. |
Constants
Name | Description |
---|---|
SocketName | The name of the socket at the end of the spring arm (looking back towards the spring arm origin) |