#include <ComposableCameraCameraBase.h>
Inherits:
ACameraActorSubclassed by:AComposableCameraGeneralThirdPersonCamera
Base camera class.
Public Attributes¶
| Return | Name | Description |
|---|---|---|
FGameplayTag |
CameraTag |
Tag for this camera. Used by modifiers to distinguish different cameras. |
UComposableCameraTransitionBase * |
EnterTransition |
Enter transition. Usually used for returning back to this camera from a transient camera. |
bool |
bDefaultPreserveCameraPose |
Whether to preserve last camera's pose when resuming this camera. |
TArray< UComposableCameraCameraNodeBase * > |
CameraNodes |
Nodes for this camera. They're executed in the order they are placed in this array. Each node reads input pin values, applies its logic, and writes output pin values. Inter-node data flow is handled entirely through the pin-based RuntimeDataBlock system. |
TArray< TObjectPtr< UComposableCameraComputeNodeBase > > |
ComputeNodes |
One-shot compute nodes that run during BeginPlayCamera, after every node (both camera nodes and compute nodes) has had Initialize() run. They are walked in array order and each has ExecuteBeginPlay() called exactly once. |
FOnPreTick |
OnPreTick |
|
FOnPostTick |
OnPostTick |
|
FOnActionPreTick |
OnActionPreTick |
|
FOnActionPostTick |
OnActionPostTick |
|
TArray< UComposableCameraActionBase * > |
PreNodeTickActions |
Node-scoped actions fired around each node's TickNode. The PCM registers actions here when their ExecutionType is PreNodeTick / PostNodeTick (see AComposableCameraPlayerCameraManager::AddCameraAction / BindCameraActionsForNewCamera). Matching is by exact class (Node->GetClass() == Action->TargetNodeClass), same rule as the Modifier system. |
TArray< UComposableCameraActionBase * > |
PostNodeTickActions |
|
FComposableCameraPose |
CameraPose |
|
FComposableCameraPose |
LastFrameCameraPose |
|
bool |
bIsTransient |
|
float |
LifeTime |
|
float |
RemainingLifeTime |
|
uint64 |
LastTickedFrameCounter |
Per-frame tick memoization. |
TArray< FComposableCameraExecEntry > |
FullExecChain |
Full execution chain for the per-frame camera tick, including both camera-node steps and internal-variable Set operations. Copied from UComposableCameraTypeAsset::FullExecChain during OnTypeAssetCameraConstructed. |
TArray< FComposableCameraExecEntry > |
ComputeFullExecChain |
Full execution chain for the BeginPlay compute pass, including both compute-node steps and internal-variable Set operations. Copied from UComposableCameraTypeAsset::ComputeFullExecChain during OnTypeAssetCameraConstructed. |
int32 |
TypeAssetNodeTemplateCount |
The number of entries in TypeAsset::NodeTemplates at construction time. Used as the base offset for compute-node pin keys in the RuntimeDataBlock (compute node i has pin key NodeIndex = TypeAssetNodeTemplateCount + i). |
TUniquePtr< FComposableCameraRuntimeDataBlock > |
OwnedRuntimeDataBlock |
Owned RuntimeDataBlock for type-asset-based cameras. Allocated during activation from a UComposableCameraTypeAsset. Nodes hold raw pointers into this block — they never outlive the camera. |
TWeakObjectPtr< UComposableCameraTypeAsset > |
SourceTypeAsset |
The type asset that was used to construct this camera. Stored so that ReactivateCurrentCamera (triggered by modifier changes) can fully reconstruct the camera from the same source asset instead of producing an empty shell. |
FComposableCameraParameterBlock |
SourceParameterBlock |
The parameter block that was applied when this camera was activated from a type asset. Stored alongside SourceTypeAsset so reactivation preserves the original caller-provided parameter values. |
CameraTag¶
FGameplayTag CameraTag {}
Tag for this camera. Used by modifiers to distinguish different cameras.
EnterTransition¶
UComposableCameraTransitionBase * EnterTransition
Enter transition. Usually used for returning back to this camera from a transient camera.
bDefaultPreserveCameraPose¶
bool bDefaultPreserveCameraPose { true }
Whether to preserve last camera's pose when resuming this camera.
CameraNodes¶
TArray< UComposableCameraCameraNodeBase * > CameraNodes
Nodes for this camera. They're executed in the order they are placed in this array. Each node reads input pin values, applies its logic, and writes output pin values. Inter-node data flow is handled entirely through the pin-based RuntimeDataBlock system.
@NOTE: This property is exposed as EditAnywhere, only for debug purposes at runtime. You should NEVER modify this for instances.
ComputeNodes¶
TArray< TObjectPtr< UComposableCameraComputeNodeBase > > ComputeNodes
One-shot compute nodes that run during BeginPlayCamera, after every node (both camera nodes and compute nodes) has had Initialize() run. They are walked in array order and each has ExecuteBeginPlay() called exactly once.
Compute nodes are NOT per-frame-ticked. They exist to perform C++ math / data shaping at activation time and publish the result via internal variables or output pins. Downstream camera nodes then read those values in their own Initialize or TickNode bodies.
Populated during type-asset activation: AComposableCameraPlayerCameraManager::OnTypeAssetCameraConstructed duplicates every non-null entry of UComposableCameraTypeAsset::ComputeNodeTemplates into this array, then reorders by the type asset's ComputeExecutionOrder (built from the editor's BeginPlay compute chain rooted at UComposableCameraBeginPlayStartGraphNode — see EditorDesignDoc §8 "Dual exec chains: camera chain vs BeginPlay compute chain").
@NOTE: Like CameraNodes, this is EditAnywhere only for debug inspection. Do not mutate at runtime.
OnPreTick¶
FOnPreTick OnPreTick
OnPostTick¶
FOnPostTick OnPostTick
OnActionPreTick¶
FOnActionPreTick OnActionPreTick
OnActionPostTick¶
FOnActionPostTick OnActionPostTick
PreNodeTickActions¶
TArray< UComposableCameraActionBase * > PreNodeTickActions
Node-scoped actions fired around each node's TickNode. The PCM registers actions here when their ExecutionType is PreNodeTick / PostNodeTick (see AComposableCameraPlayerCameraManager::AddCameraAction / BindCameraActionsForNewCamera). Matching is by exact class (Node->GetClass() == Action->TargetNodeClass), same rule as the Modifier system.
These are NOT UPROPERTY — ownership lives on the PCM's CameraActions UPROPERTY TSet, which is the GC root. This camera-local view is just a hot-path iteration cache; the PCM clears it via UnregisterNodeAction when an action expires, and EndPlay clears it defensively.
PostNodeTickActions¶
TArray< UComposableCameraActionBase * > PostNodeTickActions
CameraPose¶
FComposableCameraPose CameraPose
LastFrameCameraPose¶
FComposableCameraPose LastFrameCameraPose
bIsTransient¶
bool bIsTransient { false }
LifeTime¶
float LifeTime { 0.f }
RemainingLifeTime¶
float RemainingLifeTime { 0.f }
LastTickedFrameCounter¶
uint64 LastTickedFrameCounter { 0 }
Per-frame tick memoization.
When the evaluation DAG (produced by snapshot-based RefLeaves) reaches the same camera via multiple paths in a single frame — e.g. the pop transition's target subtree AND the RefLeaf→B → push-source RefLeaf both bottom out at the same original A leaf — a second TickCamera would double-advance the camera's per-node state (damping, interpolator bStartFrame, spline progress, noise seeds, etc.). TickCamera compares GFrameCounter against this value: if it matches, the cached CameraPose is returned verbatim and the node chain is NOT walked again.
0 is a valid sentinel: GFrameCounter starts above 0 in any real engine session, so a freshly-constructed camera (counter = 0) will always take the full-tick path on its first evaluation. Not a UPROPERTY — purely transient evaluation-time scratch.
FullExecChain¶
TArray< FComposableCameraExecEntry > FullExecChain
Full execution chain for the per-frame camera tick, including both camera-node steps and internal-variable Set operations. Copied from UComposableCameraTypeAsset::FullExecChain during OnTypeAssetCameraConstructed.
CameraNodeIndex in each entry references the author-order index in CameraNodes (which is parallel to TypeAsset::NodeTemplates).
ComputeFullExecChain¶
TArray< FComposableCameraExecEntry > ComputeFullExecChain
Full execution chain for the BeginPlay compute pass, including both compute-node steps and internal-variable Set operations. Copied from UComposableCameraTypeAsset::ComputeFullExecChain during OnTypeAssetCameraConstructed.
CameraNodeIndex in each entry references the author-order index in ComputeNodes (which is parallel to TypeAsset::ComputeNodeTemplates when ComputeFullExecChain is non-empty — in that case OnTypeAssetCameraConstructed skips the legacy reorder to preserve index correspondence).
TypeAssetNodeTemplateCount¶
int32 TypeAssetNodeTemplateCount = 0
The number of entries in TypeAsset::NodeTemplates at construction time. Used as the base offset for compute-node pin keys in the RuntimeDataBlock (compute node i has pin key NodeIndex = TypeAssetNodeTemplateCount + i).
Stored explicitly because CameraNodes.Num() can differ from NodeTemplates.Num() if OnTypeAssetCameraConstructed skips null templates during duplication.
OwnedRuntimeDataBlock¶
TUniquePtr< FComposableCameraRuntimeDataBlock > OwnedRuntimeDataBlock
Owned RuntimeDataBlock for type-asset-based cameras. Allocated during activation from a UComposableCameraTypeAsset. Nodes hold raw pointers into this block — they never outlive the camera.
SourceTypeAsset¶
TWeakObjectPtr< UComposableCameraTypeAsset > SourceTypeAsset
The type asset that was used to construct this camera. Stored so that ReactivateCurrentCamera (triggered by modifier changes) can fully reconstruct the camera from the same source asset instead of producing an empty shell.
SourceParameterBlock¶
FComposableCameraParameterBlock SourceParameterBlock
The parameter block that was applied when this camera was activated from a type asset. Stored alongside SourceTypeAsset so reactivation preserves the original caller-provided parameter values.
Empty for type-asset cameras activated without any parameter overrides.
Public Methods¶
| Return | Name | Description |
|---|---|---|
AComposableCameraCameraBase |
||
void |
BeginPlay virtual |
|
void |
EndPlay virtual |
|
void |
Initialize |
|
void |
InitializeNodes |
Per-node initialization loop. Walks CameraNodes and ComputeNodes, calls Node->Initialize on each, and wires OnPreTick/OnPostTick delegates for CameraNodes only. Compute nodes are initialized but NOT wired to the per-frame tick multicasts — they only run once, from BeginPlayCamera. |
void |
ApplyModifiers |
|
void |
BeginPlayCamera |
Runs the BeginPlay compute chain: walks ComputeNodes in order and calls ExecuteBeginPlay on each. Called exactly once per activation from AActor::BeginPlay, after per-node Initialize has run for every node. |
FComposableCameraPose |
TickCamera |
|
void |
RegisterNodeAction |
|
void |
UnregisterNodeAction |
|
UComposableCameraCameraNodeBase * |
GetNodeByClass |
|
AComposableCameraPlayerCameraManager * |
GetOwningPlayerCameraManager inline |
|
FComposableCameraPose |
GetCameraPose const inline |
|
FComposableCameraPose |
GetLastFrameCameraPose const inline |
|
bool |
IsTransient const inline |
|
void |
DrawCameraDebug const |
Draw world-space debug primitives for this camera. |
void |
DrawCameraDebug2D const |
2D counterpart to DrawCameraDebug. Walks CameraNodes and invokes each node's DrawNodeDebug2D override. Called by the viewport debug service's "Game"-channel hook (HUD pass) — fires during PIE possessed play, not during F8 eject. Each node gates its own output on its per-node CVar, same pattern as the 3D path. |
float |
GetLifeTime const inline |
|
float |
GetRemainingLifeTime const inline |
|
bool |
IsFinished const inline |
AComposableCameraCameraBase¶
AComposableCameraCameraBase(const FObjectInitializer & ObjectInitializer)
BeginPlay¶
virtual
virtual void BeginPlay()
EndPlay¶
virtual
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason)
Initialize¶
void Initialize(AComposableCameraPlayerCameraManager * Manager)
InitializeNodes¶
void InitializeNodes()
Per-node initialization loop. Walks CameraNodes and ComputeNodes, calls Node->Initialize on each, and wires OnPreTick/OnPostTick delegates for CameraNodes only. Compute nodes are initialized but NOT wired to the per-frame tick multicasts — they only run once, from BeginPlayCamera.
Called twice during type-asset activation: first from Initialize() (where CameraNodes is still empty — a no-op), then again from OnTypeAssetCameraConstructed once templates have been duplicated and the RuntimeDataBlock wired, so every node's Initialize() runs exactly once.
ApplyModifiers¶
void ApplyModifiers(const T_NodeModifier & Modifiers)
BeginPlayCamera¶
void BeginPlayCamera()
Runs the BeginPlay compute chain: walks ComputeNodes in order and calls ExecuteBeginPlay on each. Called exactly once per activation from AActor::BeginPlay, after per-node Initialize has run for every node.
Compute nodes that need the outgoing camera pose read it from OwningPlayerCameraManager->GetCurrentCameraPose() — which is why this function no longer takes a pose parameter.
TickCamera¶
FComposableCameraPose TickCamera(float DeltaTime)
RegisterNodeAction¶
void RegisterNodeAction(UComposableCameraActionBase * Action)
UnregisterNodeAction¶
void UnregisterNodeAction(UComposableCameraActionBase * Action)
GetNodeByClass¶
UComposableCameraCameraNodeBase * GetNodeByClass(TSubclassOf< UComposableCameraCameraNodeBase > NodeClass)
GetOwningPlayerCameraManager¶
inline
inline AComposableCameraPlayerCameraManager * GetOwningPlayerCameraManager()
GetCameraPose¶
const inline
inline FComposableCameraPose GetCameraPose() const
GetLastFrameCameraPose¶
const inline
inline FComposableCameraPose GetLastFrameCameraPose() const
IsTransient¶
const inline
inline bool IsTransient() const
DrawCameraDebug¶
const
void DrawCameraDebug(class UWorld * World, bool bDrawFrustum) const
Draw world-space debug primitives for this camera.
Invoked from the viewport debug ticker when CCS.Debug.Viewport is enabled. Two independently gated pieces:
-
Frustum pyramid at the camera's current pose — drawn only when
bDrawFrustumis true. The ticker passes true only while the player is NOT viewing through the camera (F8 eject / SIE /CCS.Debug.Viewport.AlwaysShow), because otherwise the pyramid just occludes the near plane. -
A walk over
CameraNodescalling each node'sDrawNodeDebug. Always invoked — each node's override checks its own per-node CVar (CCS.Debug.Viewport.<NodeName>) and early-outs when zero. Per-node gizmos are therefore visible in BOTH possessed play and ejected state, because they rarely occlude the viewpoint.
Reads CameraPose (the leaf-local evaluated pose), not the PCM's blended pose — for the running camera in a steady state these are the same; during a transition, this shows the pose this camera is contributing, not the blended result.
Compiled out in shipping builds.
DrawCameraDebug2D¶
const
void DrawCameraDebug2D(class UCanvas * Canvas, class APlayerController * PC) const
2D counterpart to DrawCameraDebug. Walks CameraNodes and invokes each node's DrawNodeDebug2D override. Called by the viewport debug service's "Game"-channel hook (HUD pass) — fires during PIE possessed play, not during F8 eject. Each node gates its own output on its per-node CVar, same pattern as the 3D path.
GetLifeTime¶
const inline
inline float GetLifeTime() const
GetRemainingLifeTime¶
const inline
inline float GetRemainingLifeTime() const
IsFinished¶
const inline
inline bool IsFinished() const
Protected Attributes¶
| Return | Name | Description |
|---|---|---|
TObjectPtr< AComposableCameraPlayerCameraManager > |
CameraManager |
CameraManager¶
TObjectPtr< AComposableCameraPlayerCameraManager > CameraManager