Plasma Engine  2.0
Loading...
Searching...
No Matches
SimpleWindComponent.h
1#pragma once
2
3#include <Core/Interfaces/WindWorldModule.h>
4#include <Core/World/Component.h>
5#include <Core/World/World.h>
6#include <GameEngine/GameEngineDLL.h>
7
9
21class PL_GAMEENGINE_DLL plSimpleWindComponent : public plComponent
22{
24
26 // plComponent
27
28public:
29 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
30 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
31
32protected:
33 virtual void Initialize() override;
34 virtual void OnActivated() override;
35 virtual void OnDeactivated() override;
36
38 // plSimpleWindComponent
39
40public:
43
46
49
52 plAngle m_Deviation; // [ property ]
53
54protected:
55 void Update();
56 void ComputeNextState();
57
58 float m_fLastStrength = 0;
59 float m_fNextStrength = 0;
60 plVec3 m_vLastDirection;
61 plVec3 m_vNextDirection;
62 plTime m_LastChange;
63 plTime m_NextChange;
64};
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
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 OnDeactivated()
This method is called when the component gets deactivated.
Definition Component.cpp:142
virtual void DeserializeComponent(plWorldReader &inout_stream)
Override this to load the current state of the component from the given stream.
Definition Component.cpp:58
virtual void Initialize()
Can be overridden for basic initialization that depends on a valid hierarchy and position.
Definition Component.cpp:131
virtual void OnActivated()
This method is called when the component gets activated.
Definition Component.cpp:140
Simple component manager implementation that calls an update method on all components every frame.
Definition ComponentManager.h:142
Calculates one global wind force using a very basic formula.
Definition SimpleWindComponent.h:22
plEnum< plWindStrength > m_MinWindStrength
The minimum speed that the wind should always blow with.
Definition SimpleWindComponent.h:45
plAngle m_Deviation
Definition SimpleWindComponent.h:52
plEnum< plWindStrength > m_MaxWindStrength
The maximum speed that the wind should blow with.
Definition SimpleWindComponent.h:48
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
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12