Navigation
API > API/Runtime > API/Runtime/Engine
Base class for a camera shake. A camera shake contains a root shake "pattern" which is the object that contains the actual logic driving how the camera is shaken. Keeping the two separate makes it possible to completely change how a shake works without having to create a completely different asset.
| Name | UCameraShakeBase |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Camera/CameraShakeBase.h |
| Include Path | #include "Camera/CameraShakeBase.h" |
Syntax
UCLASS (Abstract, Blueprintable, EditInlineNew, MinimalAPI)
class UCameraShakeBase : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UCameraShakeBase
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UCameraShakeBase
(
const FObjectInitializer& ObjectInitializer |
Create a new instance of a camera shake | Camera/CameraShakeBase.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bSingleInstance | bool | If true to only allow a single instance of this shake class to play at any given time. | Camera/CameraShakeBase.h |
|
| ShakeScale | float | The overall scale to apply to the shake. Only valid when the shake is active. | Camera/CameraShakeBase.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsActive | bool | Whether this shake is active, which is true between StartShake and TeardownShake | Camera/CameraShakeBase.h | |
| CameraManager | TObjectPtr< APlayerCameraManager > | The camera manager owning this camera shake. Only valid when the shake is active. | Camera/CameraShakeBase.h |
|
| PlaySpace | ECameraShakePlaySpace | What space to play the shake in before applying to the camera. Only valid when the shake is active. | Camera/CameraShakeBase.h | |
| RootShakePattern | TObjectPtr< UCameraShakePattern > | The root pattern for this camera shake | Camera/CameraShakeBase.h |
|
| UserPlaySpaceMatrix | FMatrix | Matrix defining a custom play space, used when PlaySpace is UserDefined. | Camera/CameraShakeBase.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ShakePatternType * ChangeRootShakePattern() |
Creates a new pattern of the given type and sets it as the root one on this shake | Camera/CameraShakeBase.h | |
APlayerCameraManager * GetCameraManager() |
Gets the current camera manager. Will be null if the shake isn't active. | Camera/CameraShakeBase.h | |
void GetCameraShakeBlendTimes
(
float& OutBlendIn, |
Gets the duration of this camera shake's blend in and out. | Camera/CameraShakeBase.h | |
| Gets the duration of this camera shake in seconds. | Camera/CameraShakeBase.h | ||
ECameraShakePlaySpace GetPlaySpace() |
Returns the current play space. The value is irrelevant if the shake isn't active. | Camera/CameraShakeBase.h | |
UCameraShakePattern * GetRootShakePattern() |
Gets the root pattern of this camera shake | Camera/CameraShakeBase.h |
|
void GetShakeInfo
(
FCameraShakeInfo& OutInfo |
Gets some infromation about this specific camera shake | Camera/CameraShakeBase.h | |
const FMatrix & GetUserPlaySpaceMatrix () |
Returns the current play space matrix. | Camera/CameraShakeBase.h | |
bool IsActive () |
Returns whether this shake is active. | Camera/CameraShakeBase.h | |
bool IsFinished() |
Returns whether this camera shake is finished | Camera/CameraShakeBase.h | |
void ScrubAndApplyCameraShake
(
float AbsoluteTime, |
Scrubs this camera shake to the given time and applies its effect to the given view | Camera/CameraShakeBase.h | |
void SetRootShakePattern
(
UCameraShakePattern* InPattern |
Sets the root pattern of this camera shake | Camera/CameraShakeBase.h |
|
void SetUserPlaySpaceMatrix
(
const FMatrix& InMatrix |
Sets the current play space matrix. | Camera/CameraShakeBase.h | |
void StartShake
(
APlayerCameraManager* Camera, |
Starts this camera shake with the given parameters | Camera/CameraShakeBase.h | |
void StartShake
(
const FCameraShakeBaseStartParams& Params |
Starts this camera shake with the given parameters | Camera/CameraShakeBase.h | |
void StopShake
(
bool bImmediately |
Stops this camera shake | Camera/CameraShakeBase.h | |
void TeardownShake() |
Tears down this camera shake before destruction or recycling | Camera/CameraShakeBase.h | |
void UpdateAndApplyCameraShake
(
float DeltaTime, |
Updates this camera shake and applies its effect to the given view | Camera/CameraShakeBase.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ApplyPlaySpace
(
const FCameraShakePatternUpdateParams& Params, |
Modifies the current shake offset to be oriented in the current shake's play space (only if the result is "relative") | Camera/CameraShakeBase.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void ApplyLimits
(
const FMinimalViewInfo& InPOV, |
Applies any appropriate system-wide limits | Camera/CameraShakeBase.h | |
static void ApplyPlaySpace
(
ECameraShakePlaySpace PlaySpace, |
Modifies the current shake offset to be oriented in the current shake's play space (only if the result is "relative") | Camera/CameraShakeBase.h | |
static void ApplyResult
(
const FCameraShakeApplyResultParams& ApplyParams, |
Uses the given result parameters to apply the given result to the given input view info | Camera/CameraShakeBase.h | |
static void ApplyScale
(
const FCameraShakePatternUpdateParams& Params, |
Applies all the appropriate auto-scaling to the current shake offset (only if the result is "relative") | Camera/CameraShakeBase.h | |
static void ApplyScale
(
float Scale, |
Applies the given scale to the current shake offset (only if the result is "relative") | Camera/CameraShakeBase.h | |
static bool GetCameraShakeBlendTimes
(
TSubclassOf< UCameraShakeBase > CameraShakeClass, |
Gets the default blend in/out durations for camera shakes of the given class. | Camera/CameraShakeBase.h | |
static bool GetCameraShakeDuration
(
TSubclassOf< UCameraShakeBase > CameraShakeClass, |
Gets the default duration for camera shakes of the given class. | Camera/CameraShakeBase.h |