Class PlayerCameraManager
A PlayerCameraManager is responsible for managing the camera for a particular player.
Inherited Members
Namespace: UE4.Engine
Assembly: UE4DotNet.dll
Syntax
public class PlayerCameraManager : ActorRemarks
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.
@see https://docs.unrealengine.com/latest/INT/Gameplay/Framework/Camera/
Properties
| Improve this Doc View SourceActiveAnims
Array of camera anim instances that are currently playing and in-use
Declaration
public ObjectArrayField<CameraAnimInst> ActiveAnims { get; }Property Value
| Type | Description | 
|---|---|
| ObjectArrayField<CameraAnimInst> | 
AnimCameraActor
Internal. Receives the output of individual camera animations.
Declaration
public CameraActor AnimCameraActor { get; set; }Property Value
| Type | Description | 
|---|---|
| CameraActor | 
AnimInstPool
Internal pool of camera anim instance objects available for playing camera animations. Defines the max number of camera anims that can play simultaneously.
Declaration
public CameraAnimInst AnimInstPool { get; set; }Property Value
| Type | Description | 
|---|---|
| CameraAnimInst | 
bClientSimulatingViewTarget
Declaration
public bool bClientSimulatingViewTarget { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
bDefaultConstrainAspectRatio
Declaration
public bool bDefaultConstrainAspectRatio { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
bGameCameraCutThisFrame
Declaration
public bool bGameCameraCutThisFrame { get; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
bIsOrthographic
Declaration
public bool bIsOrthographic { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
bUseClientSideCameraUpdates
Declaration
public bool bUseClientSideCameraUpdates { get; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
CachedCameraShakeMod
Cached ref to modifier for code-driven screen shakes
Declaration
public CameraModifier_CameraShake CachedCameraShakeMod { get; set; }Property Value
| Type | Description | 
|---|---|
| CameraModifier_CameraShake | 
CameraCache
Camera Cache
Declaration
public CameraCacheEntry CameraCache { get; set; }Property Value
| Type | Description | 
|---|---|
| CameraCacheEntry | 
CameraCachePrivate
Cached camera properties.
Declaration
public CameraCacheEntry CameraCachePrivate { get; set; }Property Value
| Type | Description | 
|---|---|
| CameraCacheEntry | 
CameraLensEffects
CameraBlood emitter attached to this camera
Declaration
public ObjectArrayField<EmitterCameraLensEffectBase> CameraLensEffects { get; }Property Value
| Type | Description | 
|---|---|
| ObjectArrayField<EmitterCameraLensEffectBase> | 
DefaultAspectRatio
Default aspect ratio (used when a view target override the aspect ratio and bConstrainAspectRatio is set; most of the time the value from a camera component will be used instead)
Declaration
public float DefaultAspectRatio { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Single | 
DefaultFOV
FOV to use by default.
Declaration
public float DefaultFOV { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Single | 
DefaultModifiers
List of modifiers to create by default for this camera
Declaration
public ObjectArrayField<Class> DefaultModifiers { get; }Property Value
| Type | Description | 
|---|---|
| ObjectArrayField<Class> | 
DefaultObject
Get UE4 Default Object for this Class
Declaration
public static PlayerCameraManager DefaultObject { get; }Property Value
| Type | Description | 
|---|---|
| PlayerCameraManager | 
DefaultOrthoWidth
The default desired width (in world units) of the orthographic view (ignored in Perspective mode)
Declaration
public float DefaultOrthoWidth { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Single | 
FreeAnims
Array of camera anim instances that are not playing and available to be used.
Declaration
public ObjectArrayField<CameraAnimInst> FreeAnims { get; }Property Value
| Type | Description | 
|---|---|
| ObjectArrayField<CameraAnimInst> | 
FreeCamDistance
Distance to place free camera from view target (used in certain CameraStyles)
Declaration
public float FreeCamDistance { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Single | 
FreeCamOffset
Offset to Z free camera position (used in certain CameraStyles)
Declaration
public Vector FreeCamOffset { get; set; }Property Value
| Type | Description | 
|---|---|
| Vector | 
LastFrameCameraCache
Last Frame Camera Cache
Declaration
public CameraCacheEntry LastFrameCameraCache { get; set; }Property Value
| Type | Description | 
|---|---|
| CameraCacheEntry | 
LastFrameCameraCachePrivate
Cached camera properties, one frame old.
Declaration
public CameraCacheEntry LastFrameCameraCachePrivate { get; set; }Property Value
| Type | Description | 
|---|---|
| CameraCacheEntry | 
ModifierList
List of active camera modifier instances that have a chance to update the final camera POV
Declaration
public ObjectArrayField<CameraModifier> ModifierList { get; }Property Value
| Type | Description | 
|---|---|
| ObjectArrayField<CameraModifier> | 
PCOwner
PlayerController that owns this Camera actor
Declaration
public PlayerController PCOwner { get; set; }Property Value
| Type | Description | 
|---|---|
| PlayerController | 
PendingViewTarget
Pending view target for blending
Declaration
public TViewTarget PendingViewTarget { get; set; }Property Value
| Type | Description | 
|---|---|
| TViewTarget | 
StaticClass
Get UE4 Class
Declaration
public static Class StaticClass { get; }Property Value
| Type | Description | 
|---|---|
| Class | 
TransformComponent
Dummy component we can use to attach things to the camera.
Declaration
public SceneComponent TransformComponent { get; }Property Value
| Type | Description | 
|---|---|
| SceneComponent | 
ViewPitchMax
Maximum view pitch, in degrees.
Declaration
public float ViewPitchMax { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Single | 
ViewPitchMin
Minimum view pitch, in degrees.
Declaration
public float ViewPitchMin { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Single | 
ViewRollMax
Maximum view roll, in degrees.
Declaration
public float ViewRollMax { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Single | 
ViewRollMin
Minimum view roll, in degrees.
Declaration
public float ViewRollMin { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Single | 
ViewTarget
Current ViewTarget
Declaration
public TViewTarget ViewTarget { get; set; }Property Value
| Type | Description | 
|---|---|
| TViewTarget | 
ViewTargetOffset
Offset to view target (used in certain CameraStyles)
Declaration
public Vector ViewTargetOffset { get; set; }Property Value
| Type | Description | 
|---|---|
| Vector | 
ViewYawMax
Maximum view yaw, in degrees.
Declaration
public float ViewYawMax { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Single | 
ViewYawMin
Minimum view yaw, in degrees.
Declaration
public float ViewYawMin { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Single | 
Methods
| Improve this Doc View SourceAddCameraLensEffect(SubclassOf<EmitterCameraLensEffectBase>)
Creates a camera lens effect of the given class on this camera.
Declaration
public EmitterCameraLensEffectBase AddCameraLensEffect(SubclassOf<EmitterCameraLensEffectBase> LensEffectEmitterClass)Parameters
| Type | Name | Description | 
|---|---|---|
| SubclassOf<EmitterCameraLensEffectBase> | LensEffectEmitterClass | 
Returns
| Type | Description | 
|---|---|
| EmitterCameraLensEffectBase | 
Remarks
@param LensEffectEmitterClass - Class of lens effect emitter to create. @return Returns the new emitter actor.
AddNewCameraModifier(SubclassOf<CameraModifier>)
Creates and initializes a new camera modifier of the specified class.
Declaration
public CameraModifier AddNewCameraModifier(SubclassOf<CameraModifier> ModifierClass)Parameters
| Type | Name | Description | 
|---|---|---|
| SubclassOf<CameraModifier> | ModifierClass | 
Returns
| Type | Description | 
|---|---|
| CameraModifier | 
Remarks
@param ModifierClass - The class of camera modifier to create. @return Returns the newly created camera modifier.
ClearCameraLensEffects()
Removes all camera lens effects.
Declaration
public void ClearCameraLensEffects()FindCameraModifierByClass(SubclassOf<CameraModifier>)
Returns camera modifier for this camera of the given class, if it exists.
Declaration
public CameraModifier FindCameraModifierByClass(SubclassOf<CameraModifier> ModifierClass)Parameters
| Type | Name | Description | 
|---|---|---|
| SubclassOf<CameraModifier> | ModifierClass | 
Returns
| Type | Description | 
|---|---|
| CameraModifier | 
Remarks
Exact class match only. If there are multiple modifiers of the same class, the first one is returned.
GetCameraLocation()
@return Returns camera's current location.
Declaration
public Vector GetCameraLocation()Returns
| Type | Description | 
|---|---|
| Vector | 
GetCameraRotation()
@return Returns camera's current rotation.
Declaration
public Rotator GetCameraRotation()Returns
| Type | Description | 
|---|---|
| Rotator | 
GetFOVAngle()
@return Returns the camera's current full FOV angle, in degrees.
Declaration
public float GetFOVAngle()Returns
| Type | Description | 
|---|---|
| System.Single | 
GetOwningPlayerController()
Returns the PlayerController that owns this camera.
Declaration
public PlayerController GetOwningPlayerController()Returns
| Type | Description | 
|---|---|
| PlayerController | 
New(UObject, Name)
Spawn an object of this class
Declaration
public static PlayerCameraManager New(UObject obj = null, Name name = default(Name))Parameters
| Type | Name | Description | 
|---|---|---|
| UObject | obj | |
| Name | name | 
Returns
| Type | Description | 
|---|---|
| PlayerCameraManager | 
PlayCameraAnim(CameraAnim, Single, Single, Single, Single, Boolean, Boolean, Single, Byte, Rotator)
Play the indicated CameraAnim on this camera.
Declaration
public CameraAnimInst PlayCameraAnim(CameraAnim Anim, float Rate, float Scale, float BlendInTime, float BlendOutTime, bool bLoop, bool bRandomStartTime, float Duration, byte PlaySpace, Rotator UserPlaySpaceRot)Parameters
| Type | Name | Description | 
|---|---|---|
| CameraAnim | Anim | |
| System.Single | Rate | |
| System.Single | Scale | |
| System.Single | BlendInTime | |
| System.Single | BlendOutTime | |
| System.Boolean | bLoop | |
| System.Boolean | bRandomStartTime | |
| System.Single | Duration | |
| System.Byte | PlaySpace | |
| Rotator | UserPlaySpaceRot | 
Returns
| Type | Description | 
|---|---|
| CameraAnimInst | 
Remarks
@param Anim The animation that should play on this instance. @param Rate How fast to play the animation. 1.0 is normal. @param Scale How "intense" to play the animation. 1.0 is normal. @param BlendInTime Time to linearly ramp in. @param BlendOutTime Time to linearly ramp out. @param bLoop True to loop the animation if it hits the end. @param bRandomStartTime Whether or not to choose a random time to start playing. Useful with bLoop=true and a duration to randomize things like shakes. @param Duration Optional total playtime for this animation, including blends. 0 means to use animations natural duration, or infinite if looping. @param PlaySpace Which space to play the animation in. @param UserPlaySpaceRot Custom play space, used when PlaySpace is UserDefined. @return The CameraAnim instance, which can be stored to manipulate/stop the anim after the fact.
PlayCameraShake(SubclassOf<CameraShake>, Single, Byte, Rotator)
Plays a camera shake on this camera.
Declaration
public CameraShake PlayCameraShake(SubclassOf<CameraShake> ShakeClass, float Scale, byte PlaySpace, Rotator UserPlaySpaceRot)Parameters
| Type | Name | Description | 
|---|---|---|
| SubclassOf<CameraShake> | ShakeClass | |
| System.Single | Scale | |
| System.Byte | PlaySpace | |
| Rotator | UserPlaySpaceRot | 
Returns
| Type | Description | 
|---|---|
| CameraShake | 
Remarks
@param Shake - The class of camera shake to play. @param Scale - Scalar defining how "intense" to play the shake. 1.0 is normal (as authored). @param PlaySpace - Which coordinate system to play the shake in (affects oscillations and camera anims) @param UserPlaySpaceRot - Coordinate system to play shake when PlaySpace == CAPS_UserDefined.
RemoveCameraLensEffect(EmitterCameraLensEffectBase)
Removes the given lens effect from the camera.
Declaration
public void RemoveCameraLensEffect(EmitterCameraLensEffectBase Emitter)Parameters
| Type | Name | Description | 
|---|---|---|
| EmitterCameraLensEffectBase | Emitter | 
Remarks
@param Emitter - the emitter actor to remove from the camera
RemoveCameraModifier(CameraModifier)
Removes the given camera modifier from this camera (if it's on the camera in the first place) and discards it.
Declaration
public bool RemoveCameraModifier(CameraModifier ModifierToRemove)Parameters
| Type | Name | Description | 
|---|---|---|
| CameraModifier | ModifierToRemove | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
Remarks
@return True if successfully removed, false otherwise.
SetManualCameraFade(Single, LinearColor, Boolean)
Turns on camera fading at the given opacity.
Declaration
public void SetManualCameraFade(float InFadeAmount, LinearColor Color, bool bInFadeAudio)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Single | InFadeAmount | |
| LinearColor | Color | |
| System.Boolean | bInFadeAudio | 
Remarks
Does not auto-animate, allowing user to animate themselves. Call StopCameraFade to turn fading back off.
StartCameraFade(Single, Single, Single, LinearColor, Boolean, Boolean)
Does a camera fade to/from a solid color.
Declaration
public void StartCameraFade(float FromAlpha, float ToAlpha, float Duration, LinearColor Color, bool bShouldFadeAudio, bool bHoldWhenFinished)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Single | FromAlpha | |
| System.Single | ToAlpha | |
| System.Single | Duration | |
| LinearColor | Color | |
| System.Boolean | bShouldFadeAudio | |
| System.Boolean | bHoldWhenFinished | 
Remarks
Animates automatically. @param FromAlpha - Alpha at which to begin the fade. Range [0..1], where 0 is fully transparent and 1 is fully opaque solid color. @param ToAlpha - Alpha at which to finish the fade. @param Duration - How long the fade should take, in seconds. @param Color - Color to fade to/from. @param bShouldFadeAudio - True to fade audio volume along with the alpha of the solid color. @param bHoldWhenFinished - True for fade to hold at the ToAlpha until explicitly stopped (e.g. with StopCameraFade)
StopAllCameraAnims(Boolean)
Stop playing all CameraAnims on this CameraManager.
Declaration
public void StopAllCameraAnims(bool bImmediate)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Boolean | bImmediate | 
Remarks
@param bImmediate True to stop it right now and ignore blend out, false to let it blend out as indicated.
StopAllCameraShakes(Boolean)
Stops all active camera shakes on this camera.
Declaration
public void StopAllCameraShakes(bool bImmediately)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Boolean | bImmediately | 
StopAllInstancesOfCameraAnim(CameraAnim, Boolean)
Stop playing all instances of the indicated CameraAnim.
Declaration
public void StopAllInstancesOfCameraAnim(CameraAnim Anim, bool bImmediate)Parameters
| Type | Name | Description | 
|---|---|---|
| CameraAnim | Anim | |
| System.Boolean | bImmediate | 
Remarks
@param bImmediate True to stop it right now and ignore blend out, false to let it blend out as indicated.
StopAllInstancesOfCameraShake(SubclassOf<CameraShake>, Boolean)
Stops playing CameraShake of the given class.
Declaration
public void StopAllInstancesOfCameraShake(SubclassOf<CameraShake> Shake, bool bImmediately)Parameters
| Type | Name | Description | 
|---|---|---|
| SubclassOf<CameraShake> | Shake | |
| System.Boolean | bImmediately | 
StopCameraAnimInst(CameraAnimInst, Boolean)
Stops the given CameraAnimInst from playing.
Declaration
public void StopCameraAnimInst(CameraAnimInst AnimInst, bool bImmediate)Parameters
| Type | Name | Description | 
|---|---|---|
| CameraAnimInst | AnimInst | |
| System.Boolean | bImmediate | 
Remarks
The given pointer should be considered invalid after this. @param bImmediate True to stop it right now and ignore blend out, false to let it blend out as indicated.
StopCameraFade()
Stops camera fading.
Declaration
public void StopCameraFade()StopCameraShake(CameraShake, Boolean)
Immediately stops the given shake instance and invalidates it.
Declaration
public void StopCameraShake(CameraShake ShakeInstance, bool bImmediately)Parameters
| Type | Name | Description | 
|---|---|---|
| CameraShake | ShakeInstance | |
| System.Boolean | bImmediately | 
Events
| Improve this Doc View SourceBlueprintUpdateCamera
Blueprint hook to allow blueprints to override existing camera behavior or implement custom cameras.
Declaration
public event PlayerCameraManager.BlueprintUpdateCamera_delegate BlueprintUpdateCameraEvent Type
| Type | Description | 
|---|---|
| PlayerCameraManager.BlueprintUpdateCamera_delegate | 
Remarks
If this function returns true, we will use the given returned values and skip further calculations to determine final camera POV.
OnPhotographyMultiPartCaptureEnd
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.
Declaration
public event PlayerCameraManager.OnPhotographyMultiPartCaptureEnd_delegate OnPhotographyMultiPartCaptureEndEvent Type
| Type | Description | 
|---|---|
| PlayerCameraManager.OnPhotographyMultiPartCaptureEnd_delegate | 
Remarks
Here you may re-enable whatever was turned off within OnPhotographyMultiPartCaptureStart.
OnPhotographyMultiPartCaptureStart
Event triggered upon the start of a multi-part photograph capture (i.
Declaration
public event PlayerCameraManager.OnPhotographyMultiPartCaptureStart_delegate OnPhotographyMultiPartCaptureStartEvent Type
| Type | Description | 
|---|---|
| PlayerCameraManager.OnPhotographyMultiPartCaptureStart_delegate | 
Remarks
e. a stereoscopic or 360-degree shot). This is an ideal time to turn off rendering effects that tile badly (UI, subtitles, vignette, very aggressive bloom, etc; most of these are automatically disabled when r.Photography.AutoPostprocess is 1).
OnPhotographySessionEnd
Event triggered upon leaving Photography mode (after unpausing, if r.
Declaration
public event PlayerCameraManager.OnPhotographySessionEnd_delegate OnPhotographySessionEndEvent Type
| Type | Description | 
|---|---|
| PlayerCameraManager.OnPhotographySessionEnd_delegate | 
Remarks
Photography.AutoPause is 1).
OnPhotographySessionStart
Event triggered upon entering Photography mode (before pausing, if r.
Declaration
public event PlayerCameraManager.OnPhotographySessionStart_delegate OnPhotographySessionStartEvent Type
| Type | Description | 
|---|---|
| PlayerCameraManager.OnPhotographySessionStart_delegate | 
Remarks
Photography.AutoPause is 1).
PhotographyCameraModify
Implementable blueprint hook to allow a PlayerCameraManager subclass to constrain or otherwise modify the camera during free-camera photography.
Declaration
public event PlayerCameraManager.PhotographyCameraModify_delegate PhotographyCameraModifyEvent Type
| Type | Description | 
|---|---|
| PlayerCameraManager.PhotographyCameraModify_delegate | 
Remarks
For example, a blueprint may wish to limit the distance from the camera's original point, or forbid the camera from passing through walls. NewCameraLocation contains the proposed new camera location. PreviousCameraLocation contains the camera location in the previous frame. OriginalCameraLocation contains the camera location before the game was put into photography mode. Return ResultCameraLocation as modified according to your constraints.
Operators
| Improve this Doc View SourceImplicit(IntPtr to PlayerCameraManager)
Convert from IntPtr to UObject
Declaration
public static implicit operator PlayerCameraManager(IntPtr p)Parameters
| Type | Name | Description | 
|---|---|---|
| System.IntPtr | p | 
Returns
| Type | Description | 
|---|---|
| PlayerCameraManager |