Plasma Engine  2.0
Loading...
Searching...
No Matches
AnimationControllerComponent.h
1#pragma once
2
3#include <GameEngine/GameEngineDLL.h>
4
5#include <Core/World/Component.h>
6#include <Core/World/ComponentManager.h>
7#include <GameEngine/Animation/Skeletal/AnimatedMeshComponent.h>
8#include <RendererCore/AnimationSystem/AnimGraph/AnimController.h>
9#include <RendererCore/AnimationSystem/AnimGraph/AnimGraph.h>
10
13
15
23class PL_GAMEENGINE_DLL plAnimationControllerComponent : public plComponent
24{
26
28 // plComponent
29
30public:
31 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
32 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
33
34protected:
35 virtual void OnSimulationStarted() override;
36
38 // plAnimationControllerComponent
39
40public:
43
45 void SetAnimGraphFile(const char* szFile); // [ property ]
46 const char* GetAnimGraphFile() const; // [ property ]
47
50
51protected:
52 void Update();
53
54 plEnum<plRootMotionMode> m_RootMotionMode;
55
56 plAnimGraphResourceHandle m_hAnimGraph;
57 plAnimController m_AnimController;
58 plAnimPoseGenerator m_PoseGenerator;
59
60 plTime m_ElapsedTimeSinceUpdate = plTime::MakeZero();
61};
Definition AnimController.h:52
Definition AnimPoseGenerator.h:194
Evaluates an plAnimGraphResource and provides the result through the plMsgAnimationPoseUpdated.
Definition AnimationControllerComponent.h:24
plEnum< plAnimationInvisibleUpdateRate > m_InvisibleUpdateRate
How often to update the animation while the animated mesh is invisible.
Definition AnimationControllerComponent.h:49
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 OnSimulationStarted()
This method is called once for active components, at the start of the next world update,...
Definition Component.cpp:144
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
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
PL_ALWAYS_INLINE static constexpr plTime MakeZero()
Creates an instance of plTime that was initialized with zero.
Definition Time.h:42