Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/Camera
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- USceneComponent
- UCameraComponent
- UCineCameraComponent
- UDisplayClusterICVFXCameraComponent
- UVirtualCameraCineCameraComponent
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
| Type | Name | Description | |
|---|---|---|---|
| float | AdditiveFOVOffset | An optional extra FOV offset to adjust the final view without modifying the component | |
| FTransform | AdditiveOffset | An optional extra transform to adjust the final view without moving the component, in the camera's local space | |
| float | AspectRatio | Aspect Ratio (Width/Height) | |
| TEnumAsByte< EAspectRatioAxisConstraint > | AspectRatioAxisConstraint | Override for the default aspect ratio axis constraint defined on the local player | |
| uint8: 1 | bCameraMeshHiddenInGame | If the camera mesh is visible in game. Only relevant when running editor builds. | |
| 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. | |
| bool | bDrawFrustumAllowed | The Frustum visibility flag for draw frustum component initialization. | |
| uint8: 1 | bLockToHmd | True if the camera's orientation and position should be locked to the HMD | |
| uint8: 1 | bOverrideAspectRatioAxisConstraint | Whether to override the default aspect ratio axis constraint defined on the local player | |
| uint8: 1 | bUseAdditiveOffset | True to enable the additive view offset, for adjusting the view without moving the component. | |
| uint8: 1 | bUseFieldOfViewForLOD | If true, account for the field of view angle when computing which level of detail to use for meshes. | |
| uint8: 1 | bUsePawnControlRotation | If this camera component is placed on a pawn, should it use the view/control rotation of the pawn where possible? | |
| TObjectPtr< class UStaticMesh > | CameraMesh | ||
| TObjectPtr< class UDrawFrustumComponent > | DrawFrustum | The frustum component used to show visually where the camera field of view is. | |
| TArray< FPostProcessSettings > | ExtraPostProcessBlends | Optional extra PostProcessing blends stored for this camera. | |
| TArray< float > | ExtraPostProcessBlendWeights | ||
| float | FieldOfView | The horizontal field of view (in degrees) in perspective mode (ignored in Orthographic mode) | |
| float | OrthoFarClipPlane | The far plane distance of the orthographic view (in world units) | |
| float | OrthoNearClipPlane | The near plane distance of the orthographic view (in world units) | |
| float | OrthoWidth | The desired width (in world units) of the orthographic view (ignored in Perspective mode) | |
| float | PostProcessBlendWeight | Indicates if PostProcessSettings should be used when using this Camera to view through. | |
| FPostProcessSettings | PostProcessSettings | Post process settings to use for this camera. | |
| TEnumAsByte< ECameraProjectionMode::Type > | ProjectionMode | The type of camera. | |
| TObjectPtr< class UStaticMeshComponent > | ProxyMeshComponent | The camera mesh to show visually where the camera is placed. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UCameraComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddAdditiveOffset
(
FTransform const& Transform, |
Applies the given additive offset, preserving any existing offset | |
| void | AddExtraPostProcessBlend
(
FPostProcessSettings const& PPSettings, |
Stores a given PP and weight to be later applied when the final PP is computed. | |
| void | AddOrUpdateBlendable
(
TScriptInterface< IBlendableInterface > InBlendableObject, |
Adds an Blendable (implements IBlendableInterface) to the array of Blendables (if it doesn't exist) and update the weight | |
| void | AddReferencedObjects
(
UObject* InThis, |
||
| void | Removes any additive offset. | ||
| void | Removes any extra PP blends. | ||
| void | GetAdditiveOffset
(
FTransform& OutAdditiveOffset, |
Get the additive offset | |
| void | GetCameraView
(
float DeltaTime, |
Returns camera's Point of View. | |
| void | GetExtraPostProcessBlends
(
TArray< FPostProcessSettings >& OutSettings, |
Returns any extra PP blends that were stored. | |
| FText | Returns the filmback text used for burnins on preview viewports. | ||
| void | |||
| bool | |||
| void | Can be called from external code to notify that this camera was cut to, so it can update things like interpolation if necessary. | ||
| void | Internal function for updating the camera mesh visibility in PIE | ||
| void | OverrideFrustumColor
(
FColor OverrideColor |
||
| void | Refreshes the visual components to match the component state. | ||
| void | RemoveBlendable
(
TScriptInterface< IBlendableInterface > InBlendableObject |
Removes a blendable. | |
| void | |||
| void | |||
| void | SetAspectRatio
(
float InAspectRatio |
||
| void | SetAspectRatioAxisConstraint
(
EAspectRatioAxisConstraint InAspectRatioAxisConstraint |
||
| void | SetCameraMesh
(
UStaticMesh* Mesh |
||
| void | SetConstraintAspectRatio
(
bool bInConstrainAspectRatio |
||
| void | SetFieldOfView
(
float InFieldOfView |
||
| void | SetOrthoFarClipPlane
(
float InOrthoFarClipPlane |
||
| void | SetOrthoNearClipPlane
(
float InOrthoNearClipPlane |
||
| void | SetOrthoWidth
(
float InOrthoWidth |
||
| void | SetPostProcessBlendWeight
(
float InPostProcessBlendWeight |
||
| void | SetProjectionMode
(
ECameraProjectionMode::Type InProjectionMode |
||
| void | SetUseFieldOfViewForLOD
(
bool bInUseFieldOfViewForLOD |
||
| void | Update draw frustum values | ||
| void | Ensure the proxy mesh is in the correct place |
Overridden from USceneComponent
| Type | Name | Description | |
|---|---|---|---|
| void | OnUpdateTransform
(
EUpdateTransformFlags UpdateTransformFlags, |
Native callback when this component is moved |
Overridden from UActorComponent
| Type | Name | Description | |
|---|---|---|---|
| void | 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. | ||
| bool | GetEditorPreviewInfo
(
float DeltaTime, |
Supplies the editor with a view specific to this component (think a view from a camera components POV, a render, etc.). | |
| void | OnComponentDestroyed
(
bool bDestroyingHierarchy |
Called when a component is destroyed | |
| 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 | PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Called when a property on this object has been modified externally | |
| void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. | |
| void | Handles reading, writing, and reference collecting using FArchive. |
Deprecated Variables
| Type | Name | Description | |
|---|---|---|---|
| uint32: 1 | bUseControllerViewRotation_DEPRECATED | DEPRECATED: use bUsePawnControlRotation instead |