Plasma Engine  2.0
Loading...
Searching...
No Matches
CameraShakeComponent.h
1#pragma once
2
3#include <Core/World/ComponentManager.h>
4
6
19class PL_GAMECOMPONENTS_DLL plCameraShakeComponent : public plComponent
20{
22
24 // plComponent
25
26public:
27 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
28 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
29
31 // plCameraShakeComponent
32
34 plAngle m_MinShake; // [ property ]
35
37 plAngle m_MaxShake; // [ property ]
38
39public:
42
43protected:
44 void Update();
45
46 void GenerateKeyframe();
47 float GetStrengthAtPosition() const;
48
49 float m_fLastStrength = 0.0f;
50 plTime m_ReferenceTime;
51 plAngle m_Rotation;
52 plQuat m_qPrevTarget = plQuat::MakeIdentity();
53 plQuat m_qNextTarget = plQuat::MakeIdentity();
54};
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
This component is used to apply a shaking effect to the game object that it is attached to.
Definition CameraShakeComponent.h:20
plAngle m_MinShake
How much shake to apply as the minimum value, even if no shake volume is found or the shake strength ...
Definition CameraShakeComponent.h:34
plAngle m_MaxShake
How much shake to apply at shake strength 1.
Definition CameraShakeComponent.h:37
Base class of all component types.
Definition Component.h:25
virtual void SerializeComponent(plWorldWriter &inout_stream) const
Override this to save the current state of the component to the given stream.
Definition Component.cpp:54
virtual void DeserializeComponent(plWorldReader &inout_stream)
Override this to load the current state of the component from the given stream.
Definition Component.cpp:58
Simple component manager implementation that calls an update method on all components every frame.
Definition ComponentManager.h:142
static const plQuatTemplate< float > MakeIdentity()
Definition Quat_inl.h:29
Reads a world description from a stream. Allows to instantiate that world multiple times in different...
Definition WorldReader.h:47
Stores an entire plWorld in a stream.
Definition WorldWriter.h:13
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12