Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/Camera
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- USceneComponent
- UCameraComponent
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Classes/Camera/CameraComponent.h |
| Include | #include "Camera/CameraComponent.h" |
Syntax
UCLASS (HideCategories=(Mobility, Rendering, LOD), Blueprintable, ClassGroup=Camera,
Meta=(BlueprintSpawnableComponent), MinimalAPI)
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 | |
| float | AutoPlaneShift | Manually adjusts the planes of this camera, maintaining the distance between them. | |
| bool | bAutoCalculateOrthoPlanes | Automatically determine a min/max Near/Far clip plane position depending on OrthoWidth value | |
| 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 | bCropOverscan | Indicates that the overscanned pixels should be cropped at the end of the rendering pipeline, allowing the overscanned pixels to be used in post process effects that need extra pixels beyond the view frustum (e.g. lens distortion) without having to render those pixels to the screen. | |
| bool | bDrawFrustumAllowed | The Frustum visibility flag for draw frustum component initialization. | |
| uint8: 1 | bEnableFirstPersonFieldOfView | True if the first person field of view should be used for primitives tagged as "IsFirstPerson". | |
| uint8: 1 | bEnableFirstPersonScale | True if the first person scale should be used for primitives tagged as "IsFirstPerson". | |
| 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 | |
| bool | bScaleResolutionWithOverscan | Indicates that the resolution should be scaled by the overscan amount so that the original view frustum remains the same resolution. | |
| bool | bUpdateOrthoPlanes | Adjusts the near/far planes and the view origin of the current camera automatically to avoid clipping and light artefacting | |
| uint8: 1 | bUseAdditiveOffset | True to enable the additive view offset, for adjusting the view without moving the component. | |
| bool | bUseCameraHeightAsViewTarget | If UpdateOrthoPlanes is enabled, this setting will use the cameras current height to compensate the distance to the general view (as a pseudo distance to view target when one isn't present) | |
| 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 | FirstPersonFieldOfView | The horizontal field of view (in degrees) used for primitives tagged as "IsFirstPerson". | |
| float | FirstPersonScale | The scale to apply to primitives tagged as "IsFirstPerson". | |
| 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 | Overscan | Amount to increase the view frustum by, from 0.0 for no increase to 1.0 for 100% increase | |
| 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 | HandleXRCamera
(
float DeltaTime |
||
| 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 | SetAutoCalculateOrthoPlanes
(
bool bAutoCalculate |
||
| void | SetAutoPlaneShift
(
float InAutoPlaneShift |
||
| void | SetCameraMesh
(
UStaticMesh* Mesh |
||
| void | SetConstraintAspectRatio
(
bool bInConstrainAspectRatio |
||
| void | SetCropOverscan
(
bool bInCropOverscan |
Sets whether to crop the overscanned pixels at the end of the rendering pipeline, allowing the overscanned pixels to be used in post process effects that need extra pixels beyond the view frustum (e.g. lens distortion) without having to render those pixels to the screen. | |
| void | SetEnableFirstPersonFieldOfView
(
bool bInEnableFirstPersonFieldOfView |
||
| void | SetEnableFirstPersonScale
(
bool bInEnableFirstPersonScale |
||
| void | SetFieldOfView
(
float InFieldOfView |
||
| void | SetFirstPersonFieldOfView
(
float InFirstPersonFieldOfView |
||
| void | SetFirstPersonScale
(
float InFirstPersonScale |
||
| void | SetOrthoFarClipPlane
(
float InOrthoFarClipPlane |
||
| void | SetOrthoNearClipPlane
(
float InOrthoNearClipPlane |
||
| void | SetOrthoWidth
(
float InOrthoWidth |
||
| void | SetOverscan
(
float InOverscan |
||
| void | SetPostProcessBlendWeight
(
float InPostProcessBlendWeight |
||
| void | SetProjectionMode
(
ECameraProjectionMode::Type InProjectionMode |
||
| void | SetScaleResolutionWithOverscan
(
bool bInScaleResolutionWithOverscan |
Sets whether to scale the resolution by the amount of overscan so that the original view frustum remains the same resolution. | |
| void | SetUpdateOrthoPlanes
(
bool bInUpdateOrthoPlanes |
||
| void | SetUseCameraHeightAsViewTarget
(
bool bInUseCameraHeightAsViewTarget |
||
| 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 |