Plasma Engine  2.0
Loading...
Searching...
No Matches
RotorComponent.h
1#pragma once
2
3#include <GameEngine/GameEngineDLL.h>
4
5#include <GameEngine/Animation/TransformComponent.h>
6
8
13class PL_GAMEENGINE_DLL plRotorComponent : public plTransformComponent
14{
16
18 // plComponent
19
20public:
21 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
22 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
23
24protected:
25 virtual void OnSimulationStarted() override;
26
28 // plRotorComponent
29
30public:
33
36 plInt32 m_iDegreeToRotate = 0; // [ property ]
37
39 float m_fAcceleration = 1.0f; // [ property ]
40
42 float m_fDeceleration = 1.0f; // [ property ]
43
45 plEnum<plBasisAxis> m_Axis = plBasisAxis::PositiveZ; // [ property ]
46
48 plAngle m_AxisDeviation; // [ property ]
49
50protected:
51 void Update();
52
53 plVec3 m_vRotationAxis = plVec3(0, 0, 1);
54 plQuat m_qLastRotation = plQuat::MakeIdentity();
55};
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
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
Applies a rotation to the game object that it is attached to.
Definition RotorComponent.h:14
plAngle m_AxisDeviation
How much the rotation axis may randomly deviate to not have all objects rotate the same way.
Definition RotorComponent.h:48
Base class for some components that modify an object's transform.
Definition TransformComponent.h:38
virtual void SerializeComponent(plWorldWriter &inout_stream) const override
Override this to save the current state of the component to the given stream.
Definition TransformComponent.cpp:36
virtual void DeserializeComponent(plWorldReader &inout_stream) override
Override this to load the current state of the component from the given stream.
Definition TransformComponent.cpp:46
virtual void OnSimulationStarted() override
This method is called once for active components, at the start of the next world update,...
Definition TransformComponent.cpp:59
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