Navigation
Unreal Engine C++ API Reference > Runtime > Engine > Camera
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- AActor
- APlayerCameraManager
- APreviewPlayerCameraManager
References
Module | Engine |
Header | /Engine/Source/Runtime/Engine/Classes/Camera/PlayerCameraManager.h |
Include | #include "Camera/PlayerCameraManager.h" |
Syntax
class APlayerCameraManager : public AActor
Remarks
A PlayerCameraManager is responsible for managing the camera for a particular player. It defines the final view properties used by other systems (e.g. the renderer), meaning you can think of it as your virtual eyeball in the world. It can compute the final camera properties directly, or it can arbitrate/blend between other objects or actors that influence the camera (e.g. blending from one CameraActor to another).
The PlayerCameraManagers primary external responsibility is to reliably respond to various Get*() functions, such as GetCameraViewPoint. Most everything else is implementation detail and overrideable by user projects.
By default, a PlayerCameraManager maintains a "view target", which is the primary actor the camera is associated with. It can also apply various "post" effects to the final view state, such as camera animations, shakes, post-process effects or special effects such as dirt on the lens.
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
TObjectPtr< class ACameraActor > | AnimCameraActor | Internal. Receives the output of individual camera animations. |
![]() |
uint32: 1 | bAlwaysApplyModifiers | By default camera modifiers are not applied to stock debug cameras (e.g. CameraStyle == "FreeCam"). |
![]() |
uint32: 1 | bAutoAnimateFade | |
![]() |
uint32: 1 | bClientSimulatingViewTarget | True if clients are handling setting their own viewtarget and the server should not replicate it. |
![]() |
uint32: 1 | bDebugClientSideCamera | For debugging. |
![]() |
uint32: 1 | bDefaultConstrainAspectRatio | True if black bars should be added if the destination view has a different aspect ratio (only used when a view target doesn't specify whether or not to constrain the aspect ratio; most of the time the value from a camera component is used instead) |
![]() |
uint32: 1 | bEnableColorScaleInterp | True to smoothly interpolate color scale values when they change. |
![]() |
uint32: 1 | bEnableColorScaling | True to turn on scaling of color channels in final image using ColorScale property. |
![]() |
uint32: 1 | bEnableFading | True if we should apply FadeColor/FadeAmount to the screen. |
![]() |
uint32: 1 | bFadeAudio | True to apply fading of audio alongside the video. |
![]() |
uint32: 1 | bGameCameraCutThisFrame | True if we did a camera cut this frame. |
![]() |
uint32: 1 | bHoldFadeWhenFinished | True if camera fade hold at it's final value when finished. |
![]() |
uint32: 1 | bIsOrthographic | Flags. |
![]() |
FViewTargetTransitionParams | BlendParams | Current view target transition blend parameters. |
![]() |
float | BlendTimeToGo | Time remaining in viewtarget blend. |
![]() |
uint32: 1 | bShouldSendClientSideCameraUpdate | If true, send a camera update to the server on next update. |
![]() |
uint32: 1 | bUseClientSideCameraUpdates | True if server will use camera positions replicated from the client instead of calculating them locally. |
![]() |
TObjectPtr< class UCameraModifier_CameraShake > | CachedCameraShakeMod | Camera Modifiers. |
![]() |
TArray< TScriptInterface< class ICameraLensEffectInterface > > | CameraLensEffects | "Lens" effects (e.g. blood, dirt on camera) |
![]() |
FName | CameraStyle | Usable to define different camera behaviors. A few simple styles are implemented by default. |
![]() |
FVector | ColorScale | Allows control over scaling individual color channels in the final image (when bEnableColorScaling == true). |
![]() |
float | ColorScaleInterpDuration | Total time for color scale interpolation to complete (when bEnableColorScaling and bEnableColorScaleInterp == true) |
![]() |
float | ColorScaleInterpStartTime | Time at which interpolation started (when bEnableColorScaling and bEnableColorScaleInterp == true) |
![]() |
float | DefaultAspectRatio | Default aspect ratio. Most of the time the value from a camera component will be used instead. |
![]() |
float | DefaultFOV | FOV to use by default. |
![]() |
TArray< TSubclassOf< UCameraModifier > > | DefaultModifiers | List of modifiers to create by default for this camera |
![]() |
float | DefaultOrthoWidth | The default desired width (in world units) of the orthographic view (ignored in Perspective mode) |
![]() |
FVector | DesiredColorScale | Desired color scale which ColorScale will interpolate to (when bEnableColorScaling and bEnableColorScaleInterp == true) |
![]() |
FVector2D | FadeAlpha | Current camera fade alpha range, where X = starting alpha and Y = final alpha (when bEnableFading == true) |
![]() |
float | FadeAmount | Amount of fading to apply (when bEnableFading == true). |
![]() |
FLinearColor | FadeColor | Color to fade to (when bEnableFading == true). |
![]() |
float | FadeTime | Total duration of the camera fade (when bEnableFading == true) |
![]() |
float | FadeTimeRemaining | Time remaining in camera fade (when bEnableFading == true) |
![]() |
float | FreeCamDistance | Distance to place free camera from view target (used in certain CameraStyles) |
![]() |
FVector | FreeCamOffset | Offset to Z free camera position (used in certain CameraStyles) |
![]() |
float | LockedFOV | Value to lock FOV to, in degrees. Ignored if <= 0, utilized if > 0. |
![]() |
float | LockedOrthoWidth | Value OrthoWidth is locked at, if > 0. Ignored if <= 0. |
![]() |
TArray< TObjectPtr< UCameraModifier > > | ModifierList | List of active camera modifier instances that have a chance to update the final camera POV |
![]() |
FOnAudioFadeChangeSignature | OnAudioFadeChangeEvent | If bound, broadcast on fade start (with fade time) instead of manually altering audio device's primary volume directly |
![]() |
FVector | OriginalColorScale | Color scale value at start of interpolation (when bEnableColorScaling and bEnableColorScaleInterp == true) |
![]() |
TObjectPtr< class APlayerController > | PCOwner | PlayerController that owns this Camera actor |
![]() |
FTViewTarget | PendingViewTarget | Pending view target for blending |
![]() |
TArray< struct FPostProcessSettings > | PostProcessBlendCache | Internal list of active post process effects. Parallel array to PostProcessBlendCacheWeights. |
![]() |
TArray< EViewTargetBlendOrder > | PostProcessBlendCacheOrders | Internal list of how to blend post process effects. |
![]() |
TArray< float > | PostProcessBlendCacheWeights | Internal list of weights for active post process effects. Parallel array to PostProcessBlendCache. |
![]() |
FTimerHandle | SwapPendingViewTargetWhenUsingClientSideCameraUpdatesTimerHandle | |
![]() |
float | ViewPitchMax | Maximum view pitch, in degrees. |
![]() |
float | ViewPitchMin | Minimum view pitch, in degrees. |
![]() |
float | ViewRollMax | Maximum view roll, in degrees. |
![]() |
float | ViewRollMin | Minimum view roll, in degrees. |
![]() |
FTViewTarget | ViewTarget | Current ViewTarget |
![]() |
FVector | ViewTargetOffset | Offset to view target (used in certain CameraStyles) |
![]() |
float | ViewYawMax | Maximum view yaw, in degrees. |
![]() |
float | ViewYawMin | Minimum view yaw, in degrees. |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
APlayerCameraManager
(
const FObjectInitializer& ObjectInitializer |
Destructors
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
Destructor for handling property deprecation, please remove after all deprecated properties are gone |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
void | AddCachedPPBlend
(
FPostProcessSettings& PPSettings, |
Adds a postprocess effect at the given weight. |
![]() ![]() |
AEmitterCameraLensEffectBase * | AddCameraLensEffect
(
TSubclassOf< AEmitterCameraLensEffectBase > LensEffectEmitterClass |
|
![]() ![]() |
bool | AddCameraModifierToList
(
UCameraModifier* NewModifier |
Internal. Places the given modifier in the ModifierList at the appropriate priority. |
![]() ![]() |
TScriptInterface< class ICameraLensEffectInterface > | AddGenericCameraLensEffect
(
TSubclassOf< AActor > LensEffectEmitterClass |
Creates a camera lens effect of the given class on this camera. |
![]() ![]() |
UCameraModifier * | AddNewCameraModifier
(
TSubclassOf< UCameraModifier > ModifierClass |
Creates and initializes a new camera modifier of the specified class. |
![]() ![]() ![]() |
bool | Whether or not we allow photography mode | |
![]() ![]() |
void | Internal. Applies appropriate audio fading to the audio system. | |
![]() ![]() |
void | ApplyCameraModifiers
(
float DeltaTime, |
Applies the current set of camera modifiers to the given camera POV. |
![]() ![]() |
void | AssignViewTarget
(
AActor* NewTarget, |
|
![]() |
FPOV | BlendViewTargets
(
const FTViewTarget& A, |
Internal helper to blend two viewtargets. |
![]() |
bool | BlueprintUpdateCamera
(
AActor* CameraTarget, |
Blueprint hook to allow blueprints to override existing camera behavior or implement custom cameras. |
![]() ![]() |
float | CalcRadialShakeScale
(
APlayerCameraManager* Cam, |
Internal. Calculates shake scale for a particular camera. |
![]() ![]() |
void | CleanUpAnimCamera
(
const bool bDestroy |
|
![]() |
void | Removes all postprocess effects. | |
![]() ![]() |
void | Removes all camera lens effects. | |
![]() ![]() |
void | DisplayDebug
(
UCanvas* Canvas, |
|
![]() ![]() |
void | DoUpdateCamera
(
float DeltaTime |
Internal function conditionally called from UpdateCamera to do the actual work of updating the camera. |
![]() |
void | FillCameraCache
(
const FMinimalViewInfo& NewInfo |
Caches given final POV info for efficient access from other game code. |
![]() ![]() |
UCameraModifier * | FindCameraModifierByClass
(
TSubclassOf< UCameraModifier > ModifierClass |
Returns camera modifier for this camera of the given class, if it exists. |
![]() ![]() |
TScriptInterface< class ICameraLensEffectInterface > | FindGenericCameraLensEffect
(
TSubclassOf< AActor > LensEffectEmitterClass |
Camera Lens EffectsReturns first instance of a lens effect of the given class. |
![]() ![]() |
void | GetCachedPostProcessBlends
(
TArray< struct FPostProcessSettings > const*& OutPPSettings, |
Returns active post process info. |
![]() ![]() |
void | GetCachedPostProcessBlends
(
TArray< struct FPostProcessSettings > const*& OutPPSettings, |
Returns active post process info. |
![]() ![]() |
float | Get value of CameraCachePrivate.Time | |
![]() ![]() ![]() |
const FMinimalViewInfo & | Gets value of CameraCachePrivate.POV | |
![]() ![]() ![]() |
FVector | Returns camera's current location. | |
![]() ![]() ![]() |
FRotator | Returns camera's current rotation. | |
![]() ![]() ![]() |
void | GetCameraViewPoint
(
FVector& OutCamLoc, |
Primary function to retrieve Camera's actual view point. |
![]() ![]() ![]() |
float | GetFOVAngle () |
Returns the camera's current full FOV angle, in degrees. |
![]() ![]() |
float | Get value of LastFrameCameraCachePrivate.Time | |
![]() ![]() ![]() |
const FMinimalViewInfo & | Gets value of LastFrameCameraCachePrivate.POV | |
![]() ![]() |
float | GetLockedFOV () |
|
![]() ![]() ![]() |
float | Returns the current orthographic width for the camera. | |
![]() ![]() ![]() |
APlayerController * | Returns the PlayerController that owns this camera. | |
![]() ![]() |
USceneComponent * | Returns TransformComponent subobject | |
![]() ![]() |
AActor * | Returns the current ViewTarget. | |
![]() ![]() |
APawn * | Returns the ViewTarget if it is an APawn, or nullptr otherwise | |
![]() ![]() |
void | InitializeFor
(
APlayerController* PC |
Initialize this PlayerCameraManager for the given associated PlayerController. |
![]() ![]() ![]() |
bool | Returns true if this camera is using an orthographic perspective. | |
![]() ![]() |
void | LimitViewPitch
(
FRotator& ViewRotation, |
Limit the player's view pitch. |
![]() ![]() |
void | LimitViewRoll
(
FRotator& ViewRotation, |
Limit the player's view roll. |
![]() ![]() |
void | LimitViewYaw
(
FRotator& ViewRotation, |
Limit the player's view yaw. |
![]() ![]() |
APlayerCameraManager::FOnBlendComplete TBaseMulticastDelegate_NoParams | ||
![]() |
void | Event triggered upon the end of a multi-part photograph capture, when manual free-roaming photographic camera control is about to be returned to the user. | |
![]() |
void | Event triggered upon the start of a multi-part photograph capture (i.e. a stereoscopic or 360-degree shot). | |
![]() |
void | Event triggered upon leaving Photography mode (after unpausing, if r.Photography.AutoPause is 1). | |
![]() |
void | Event triggered upon entering Photography mode (before pausing, if r.Photography.AutoPause is 1). | |
![]() |
void | PhotographyCameraModify
(
const FVector NewCameraLocation, |
Implementable blueprint hook to allow a PlayerCameraManager subclass to constrain or otherwise modify the camera during free-camera photography. |
![]() ![]() |
void | PlayWorldCameraShake
(
UWorld* InWorld, |
Static. |
![]() ![]() |
void | ProcessViewRotation
(
float DeltaTime, |
Called to give PlayerCameraManager a chance to adjust view rotation updates before they are applied. |
![]() ![]() |
void | RemoveCameraLensEffect
(
AEmitterCameraLensEffectBase* Emitter |
|
![]() ![]() |
bool | RemoveCameraModifier
(
UCameraModifier* ModifierToRemove |
Removes the given camera modifier from this camera (if it's on the camera in the first place) and discards it. |
![]() ![]() |
void | RemoveGenericCameraLensEffect
(
TScriptInterface< class ICameraLensEffectInterface > Emitter |
Removes the given lens effect from the camera. |
![]() ![]() |
void | SetCameraCachePOV
(
const FMinimalViewInfo& InPOV |
Sets value of CameraCachePrivate.POV |
![]() |
void | SetCameraCacheTime
(
float InTime |
Get value of CameraCachePrivate.Time |
![]() ![]() |
void | SetDesiredColorScale
(
FVector NewColorScale, |
Sets the new desired color scale, enables color scaling, and enables color scale interpolation. |
![]() ![]() |
void | SetFOV
(
float NewFOV |
Locks the FOV to the given value. Unlock with UnlockFOV. |
![]() ![]() |
void | Sets the bGameCameraCutThisFrame flag to true (indicating we did a camera cut this frame; useful for game code to call, e.g., when performing a teleport that should be seamless) | |
![]() ![]() |
void | SetLastFrameCameraCachePOV
(
const FMinimalViewInfo& InPOV |
Sets value of LastFrameCameraCachePrivate.POV |
![]() |
void | SetLastFrameCameraCacheTime
(
float InTime |
Get value of LastFrameCameraCachePrivate.Time |
![]() ![]() |
void | SetManualCameraFade
(
float InFadeAmount, |
Turns on camera fading at the given opacity. |
![]() ![]() |
void | SetOrthoWidth
(
float OrthoWidth |
Sets and locks the current orthographic width for the camera. |
![]() ![]() |
void | SetViewTarget
(
AActor* NewViewTarget, |
Sets a new ViewTarget. |
![]() ![]() |
void | StartCameraFade
(
float FromAlpha, |
Camera fades. Does a camera fade to/from a solid color. Animates automatically. Camera fades |
![]() ![]() |
UCameraShakeBase * | StartCameraShake
(
TSubclassOf< UCameraShakeBase > ShakeClass, |
Camera Shakes. Plays a camera shake on this camera. Camera Shakes |
![]() ![]() |
UCameraShakeBase * | StartCameraShakeFromSource
(
TSubclassOf< UCameraShakeBase > ShakeClass, |
Plays a camera shake on this camera. |
![]() ![]() |
void | StopAllCameraShakes
(
bool bImmediately |
Stops all active camera shakes on this camera. |
![]() ![]() |
void | StopAllCameraShakesFromSource
(
UCameraShakeSourceComponent* SourceComponent, |
Stops playing all shakes originating from the given source. |
![]() ![]() |
void | StopAllInstancesOfCameraShake
(
TSubclassOf< UCameraShakeBase > Shake, |
Stops playing all shakes of the given class. |
![]() ![]() |
void | StopAllInstancesOfCameraShakeFromSource
(
TSubclassOf< UCameraShakeBase > Shake, |
Stops playing all shakes of the given class originating from the given source. |
![]() ![]() |
void | ||
![]() ![]() |
void | Stops camera fading. | |
![]() ![]() |
void | StopCameraShake
(
UCameraShakeBase* ShakeInstance, |
Immediately stops the given shake instance and invalidates it. |
![]() |
void | ClientSide camera updates prevents DoUpdateCamera from swapping PendingViewTarget in when the blend is complete, just use a timer to swap. | |
![]() ![]() |
void | UnlockFOV () |
Unlocks the FOV. |
![]() ![]() |
void | Unlocks OrthoWidth value | |
![]() ![]() |
void | UpdateCamera
(
float DeltaTime |
Performs per-tick camera update. |
![]() ![]() |
void | UpdateCameraLensEffects
(
const FTViewTarget& OutVT |
Update any attached camera lens effects |
![]() ![]() |
void | Performs a photography camera tick even when the camera wouldn't normally be ticking. | |
![]() ![]() |
bool | UpdatePhotographyCamera
(
FMinimalViewInfo& NewPOV |
Overridable. |
![]() ![]() |
void | UpdatePhotographyPostProcessing
(
FPostProcessSettings& InOutPostProcessing |
Allows the photography system to override postprocessing |
![]() ![]() |
void | UpdateViewTarget
(
FTViewTarget& OutVT, |
Calculates an updated POV for the given viewtarget. |
![]() ![]() |
void | UpdateViewTargetInternal
(
FTViewTarget& OutVT, |
Does the actual work to UpdateViewTarget. |
Overridden from AActor
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | ApplyWorldOffset
(
const FVector& InOffset, |
Called by owning level to shift an actor location and all relevant data structures by specified delta |
![]() ![]() |
void | Destroyed () |
Called when this actor is explicitly being destroyed during gameplay or in the editor, not called during level streaming or gameplay ending |
![]() ![]() |
void | EndPlay
(
const EEndPlayReason::Type EndPlayReason |
Overridable function called whenever this actor is being removed from a level |
![]() ![]() |
void | Allow actors to initialize themselves on the C++ side after all of their components have been initialized, only called during gameplay | |
![]() ![]() ![]() |
bool | If true, actor is ticked even if TickType==LEVELTICK_ViewportsOnly |
Classes
Type | Name | Description | |
---|---|---|---|
![]() |
FOnBlendComplete | Fires when ViewTarget is set to PendingViewTarget |
Deprecated Functions
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
AEmitterCameraLensEffectBase * | FindCameraLensEffect
(
TSubclassOf< AEmitterCameraLensEffectBase > LensEffectEmitterClass |
APlayerCameraManager::FindGenericCameraLensEffect is favored now, and this function forwards to that one. |
![]() ![]() ![]() |
FMinimalViewInfo | APlayerCameraManager::GetCameraCacheView is favored now, and this function forwards to that one. | |
![]() ![]() ![]() |
FMinimalViewInfo | APlayerCameraManager::GetLastFrameCameraCacheView is favored now, and this function forwards to that one. |
See Also
https://docs.unrealengine.com/latest/INT/Gameplay/Framework/Camera/