UCameraComponent

Represents a camera viewpoint and settings, such as projection type, field of view, and post-process overrides.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Camera/CameraComponent.h

Include

#include "Camera/CameraComponent.h"

Syntax

class UCameraComponent : public USceneComponent

Remarks

Represents a camera viewpoint and settings, such as projection type, field of view, and post-process overrides. The default behavior for an actor used as the camera view target is to look for an attached camera component and use its location, rotation, and settings.

Variables

Name Description

Protected variable

float

 

AdditiveFOVOffset

An optional extra FOV offset to adjust the final view without modifying the component

Protected variable

FTransform

 

AdditiveOffset

An optional extra transform to adjust the final view without moving the component, in the camera's local space

Public variable

float

 

AspectRatio

Aspect Ratio (Width/Height)

Public variable

uint8: 1

 

bCameraMeshHiddenInGame

If the camera mesh is visible in game. Only relevant when running editor builds.

Public variable

uint8: 1

 

bConstrainAspectRatio

If bConstrainAspectRatio is true, black bars will be added if the destination view has a different aspect ratio than this camera requested.

Public variable

uint8: 1

 

bLockToHmd

True if the camera's orientation and position should be locked to the HMD

Protected variable

uint8: 1

 

bUseAdditiveOffset

True to enable the additive view offset, for adjusting the view without moving the component.

Public variable

uint8: 1

 

bUseFieldOfViewForLOD

If true, account for the field of view angle when computing which level of detail to use for meshes.

Public variable

uint8: 1

 

bUsePawnControlRotation

If this camera component is placed on a pawn, should it use the view/control rotation of the pawn where possible?

Protected variable

UStaticMesh *

 

CameraMesh

Protected variable

UDrawFrustumComponent *

 

DrawFrustum

The frustum component used to show visually where the camera field of view is.

Protected variable

TArray< FPostProcessSettings >

 

ExtraPostProcessBlends

Optional extra PostProcessing blends stored for this camera.

Protected variable

TArray< float >

 

ExtraPostProcessBlendWeights

Public variable

float

 

FieldOfView

The horizontal field of view (in degrees) in perspective mode (ignored in Orthographic mode)

Public variable

float

 

OrthoFarClipPlane

The far plane distance of the orthographic view (in world units)

Public variable

float

 

OrthoNearClipPlane

The near plane distance of the orthographic view (in world units)

Public variable

float

 

OrthoWidth

The desired width (in world units) of the orthographic view (ignored in Perspective mode)

Public variable

float

 

PostProcessBlendWeight

Indicates if PostProcessSettings should be used when using this Camera to view through.

Public variable

FPostProcessSettings

 

PostProcessSettings

Post process settings to use for this camera.

Public variable

TEnumAsByte< ECameraProjectionMode::Type >

 

ProjectionMode

The type of camera.

Protected variable

UStaticMeshComponent *

 

ProxyMeshComponent

The camera mesh to show visually where the camera is placed.

Constructors

Name Description

Public function

UCameraComponent

(
    const FObjectInitializer& ObjectInitializer
)

Functions

Name Description

Public function

void

 

AddAdditiveOffset

(
    FTransform const& Transform,
    float FOV
)

Applies the given additive offset, preserving any existing offset

Public function

void

 

AddExtraPostProcessBlend

(
    FPostProcessSettings const& PPSettings,
    float PPBlendWeight
)

Stores a given PP and weight to be later applied when the final PP is computed.

Public function

void

 

AddOrUpdateBlendable

(
    TScriptInterface< IBlendableInterface > InBlendableObject,
    float InWeight
)

Adds an Blendable (implements IBlendableInterface) to the array of Blendables (if it doesn't exist) and update the weight

Public function Static

void

 

AddReferencedObjects

(
    UObject* InThis,
    FReferenceCollector& Collector
)

Public function

void

 

ClearAdditiveOffset()

Removes any additive offset.

Public function

void

 

ClearExtraPostProcessBlends()

Removes any extra PP blends.

Public function Const

void

 

GetAdditiveOffset

(
    FTransform& OutAdditiveOffset,
    float& OutAdditiveFOVOffset
)

Get the additive offset

Public function Virtual

void

 

GetCameraView

(
    float DeltaTime,
    FMinimalViewInfo& DesiredView
)

Returns camera's Point of View.

Public function Const

void

 

GetExtraPostProcessBlends

(
    TArray< FPostProcessSettings >& OutSettings,
    TArray< float >& OutWeights
)

Returns any extra PP blends that were stored.

Public function Virtual Const

FText

 

GetFilmbackText()

Returns the filmback text used for burnins on preview viewports.

Public function Virtual

void

 

NotifyCameraCut()

Can be called from external code to notify that this camera was cut to, so it can update things like interpolation if necessary.

Protected function

void

 

OnCameraMeshHiddenChanged()

Internal function for updating the camera mesh visibility in PIE

Public function

void

 

OverrideFrustumColor

(
    FColor OverrideColor
)

Public function Virtual

void

 

RefreshVisualRepresentation()

Refreshes the visual components to match the component state.

Public function

void

 

RemoveBlendable

(
    TScriptInterface< IBlendableInterface > InBlendableObject
)

Removes a blendable.

Protected function Virtual

void

 

ResetProxyMeshTransform()

Public function

void

 

RestoreFrustumColor()

Public function

void

 

SetAspectRatio

(
    float InAspectRatio
)

Public function Virtual

void

 

SetCameraMesh

(
    UStaticMesh* Mesh
)

Public function

void

 

SetConstraintAspectRatio

(
    bool bInConstrainAspectRatio
)

Public function Virtual

void

 

SetFieldOfView

(
    float InFieldOfView
)

Public function

void

 

SetOrthoFarClipPlane

(
    float InOrthoFarClipPlane
)

Public function

void

 

SetOrthoNearClipPlane

(
    float InOrthoNearClipPlane
)

Public function

void

 

SetOrthoWidth

(
    float InOrthoWidth
)

Public function

void

 

SetPostProcessBlendWeight

(
    float InPostProcessBlendWeight
)

Public function

void

 

SetProjectionMode

(
    ECameraProjectionMode::Type InProjectionMode
)

Public function

void

 

SetUseFieldOfViewForLOD

(
    bool bInUseFieldOfViewForLOD
)

Protected function

void

 

UpdateProxyMeshTransform()

Ensure the proxy mesh is in the correct place

Overridden from USceneComponent

Name Description

Public function Virtual

void

 

OnUpdateTransform

(
    EUpdateTransformFlags UpdateTransformFlags,
    ETeleportType Teleport
)

Native callback when this component is moved

Overridden from UActorComponent

Name Description

Public function Virtual

void

 

CheckForErrors()

Function that gets called from within Map_Check to allow this actor component to check itself for any potential errors and register them with map check dialog.

Public function Virtual

bool

 

GetEditorPreviewInfo

(
    float DeltaTime,
    FMinimalViewInfo& ViewOut
)

Supplies the editor with a view specific to this component (think a view from a camera components POV, a render, etc.).

Public function Virtual

void

 

OnComponentDestroyed

(
    bool bDestroyingHierarchy
)

Called when a component is destroyed

Public function Virtual

void

 

OnRegister()

Called when a component is registered, after Scene is set, but before CreateRenderState_Concurrent or OnCreatePhysicsState are called.

Overridden from UObject

Name Description

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyChangedEvent
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Deprecated Variables

Name Description

Public variable

uint32: 1

 

bUseControllerViewRotation_DEPRECATED

DEPRECATED: use bUsePawnControlRotation instead

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback