UCameraShakeBase

A CameraShake is an asset that defines how to shake the camera in a particular way.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Camera/CameraShakeBase.h

Include

#include "Camera/CameraShakeBase.h"

Syntax

class UCameraShakeBase : public UObject

Remarks

A CameraShake is an asset that defines how to shake the camera in a particular way. CameraShakes can be authored as either oscillating shakes, animated shakes, or both.

An oscillating shake will sinusoidally vibrate various camera parameters over time. Each location and rotation axis can be oscillated independently with different parameters to create complex and random-feeling shakes. These are easier to author and tweak, but can still feel mechanical and are limited to vibration-style shakes, such as earthquakes.

Animated shakes play keyframed camera animations. These can take more effort to author, but enable more natural-feeling results and things like directional shakes. For instance, you can have an explosion to the camera's right push it primarily to the left.

Variables

Name Description

Public variable

bool

 

bSingleInstance

If true to only allow a single instance of this shake class to play at any given time.

Public variable

float

 

ShakeScale

The overall scale to apply to the shake. Only valid when the shake is active.

Constructors

Name Description

Public function

UCameraShakeBase

(
    const FObjectInitializer & ObjectIn...
)

Functions

Name Description

Protected function Const

void

 

ApplyPlaySpace

(
    const FCameraShakeUpdateParams & Pa...,
    FCameraShakeUpdateResult & InOutRes...
)

Protected function Const

void

 

ApplyScale

(
    float Scale,
    FCameraShakeUpdateResult & InOutRes...
)

Protected function Const

void

 

ApplyScale

(
    const FCameraShakeUpdateParams & Pa...,
    FCameraShakeUpdateResult & InOutRes...
)

Protected function Const

APlayerCamer ...

 

GetCameraManager()

Gets the current camera manager. Will be null if the shake isn't active.

Public function Static

bool

 

GetCameraShakeBlendTimes

(
    TSubclassOf < UCameraShakeBase > Cam...,
    float& OutBlendIn,
    float& OutBlendOut
)

Gets the default blend in/out durations for camera shakes of the given class.

Public function Const

void

 

GetCameraShakeBlendTimes

(
    float& OutBlendIn,
    float& OutBlendOut
)

Gets the duration of this camera shake's blend in and out.

Public function Const

FCameraShake ...

 

GetCameraShakeDuration()

Gets the duration of this camera shake in seconds.

Public function Static

bool

 

GetCameraShakeDuration

(
    TSubclassOf < UCameraShakeBase > Cam...,
    FCameraShakeDuration & OutDuration
)

Gets the default duration for camera shakes of the given class.

Protected function Const

ECameraShake ...

 

GetPlaySpace()

Returns the current play space. The value is irrelevant if the shake isn't active.

Public function Const

void

 

GetShakeInfo

(
    FCameraShakeInfo & OutInfo
)

Gets some infromation about this specific camera shake

Protected function Const

const FMatri ...

 

GetUserPlaySpaceMatrix()

Returns the current play space matrix.

Public function Const

bool

 

IsFinished()

Returns whether this camera shake is finished

Protected function

void

 

SetUserPlaySpaceMatrix

(
    const FMatrix & InMatrix
)

Sets the current play space matrix.

Public function

void

 

StartShake

(
    APlayerCameraManager * Camera,
    float Scale,
    ECameraShakePlaySpace InPlaySpace,
    FRotator UserPlaySpaceRot
)

Starts this camera shake with the given parameters

Public function

void

 

StopShake

(
    bool bImmediately
)

Stops this camera shake

Public function

void

 

TeardownShake()

Tears down this camera shake before destruction or recycling

Public function

void

 

UpdateAndApplyCameraShake

(
    float DeltaTime,
    float Alpha,
    FMinimalViewInfo & InOutPOV
)

Updates this camera shake and applies its effect to the given view

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback