Plasma Engine  2.0
Loading...
Searching...
No Matches
AudioAnimationComponent.h
1#pragma once
2
3#include <AudioSystemPlugin/AudioSystemPluginDLL.h>
4
5#include <AudioSystemPlugin/Components/AudioSystemComponent.h>
6
7#include <Core/World/EventMessageHandlerComponent.h>
8
11
13
15class PL_AUDIOSYSTEMPLUGIN_DLL plAudioAnimationEntry : public plReflectedClass
16{
17 PL_ADD_DYNAMIC_REFLECTION(plAudioAnimationEntry, plReflectedClass);
18
19public:
21
25 void SetJointName(const char* szName);
26
28 [[nodiscard]] const char* GetJointName() const;
29
32
36
37private:
38 friend class plAudioAnimationComponent;
39
40 void ActivateTrigger() const;
41 void Initialize(bool bSync);
42 void UnloadTrigger();
43
47 plHashedString m_sJointName;
48
49 plAudioSystemDataID m_uiEntityId;
50 plAudioSystemDataID m_uiEventId;
51 plUInt16 m_uiJointIndex;
52 bool m_bTriggerLoaded;
53
54 plAudioSystemTransform m_LastTransform;
55};
56
58class PL_AUDIOSYSTEMPLUGIN_DLL plAudioAnimationComponent : public plEventMessageHandlerComponent
59{
61
62 // plComponent
63
64public:
65 void Initialize() override;
66 void Deinitialize() override;
67 void SerializeComponent(plWorldWriter& stream) const override;
68 void DeserializeComponent(plWorldReader& stream) override;
69
70 // plAudioAnimationComponent
71
72protected:
73 void Update();
74 void OnAnimationPoseUpdated(plMsgAnimationPoseUpdated& msg);
75 void OnAnimationEvent(plMsgGenericEvent& msg) const;
76
77private:
79};
Component that can be used to activate an audio trigger when animation events got triggered.
Definition AudioAnimationComponent.h:59
A single entry in the audio animation component.
Definition AudioAnimationComponent.h:16
plString m_sEventName
The animation event to listen.
Definition AudioAnimationComponent.h:31
plString m_sTriggerName
The audio trigger to activate when the animation event is triggered.
Definition AudioAnimationComponent.h:35
Base class for audio system component manager which need to update their states (eg....
Definition AudioSystemComponent.h:14
Definition DynamicArray.h:81
Base class for components that want to handle 'event messages'.
Definition EventMessageHandlerComponent.h:14
This class is optimized to take nearly no memory (sizeof(void*)) and to allow very fast checks whethe...
Definition HashedString.h:25
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86
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
Stores the transformation data for an audio entity.
Definition AudioSystemData.h:17
Used by components that skin a mesh to inform children whenever a new pose has been computed.
Definition Declarations.h:68
For use in scripts to signal a custom event that some game event has occurred.
Definition CommonMessages.h:29