Plasma Engine  2.0
Loading...
Searching...
No Matches
JoltTriggerComponent.h
1#pragma once
2
3#include <Core/Messages/TriggerMessage.h>
4#include <JoltPlugin/Actors/JoltActorComponent.h>
5#include <JoltPlugin/Utilities/JoltUserData.h>
6
8
9class PL_JOLTPLUGIN_DLL plJoltTriggerComponentManager : public plComponentManager<class plJoltTriggerComponent, plBlockStorageType::FreeList>
10{
11public:
14
15private:
16 friend class plJoltWorldModule;
17 friend class plJoltTriggerComponent;
18
19 void UpdateMovingTriggers();
20
21 plSet<plJoltTriggerComponent*> m_MovingTriggers;
22};
23
25
38class PL_JOLTPLUGIN_DLL plJoltTriggerComponent : public plJoltActorComponent
39{
41
43 // plComponent
44
45public:
46 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
47 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
48
49protected:
50 virtual void OnSimulationStarted() override;
51 virtual void OnDeactivated() override;
52
53
55 // plJoltTriggerComponent
56public:
59
61 void SetTriggerMessage(const char* szSz) { m_sTriggerMessage.Assign(szSz); } // [ property ]
62 const char* GetTriggerMessage() const { return m_sTriggerMessage.GetData(); } // [ property ]
63
64protected:
65 friend class plJoltWorldModule;
66 friend class plJoltContactListener;
67
68 void PostTriggerMessage(const plGameObjectHandle& hOtherObject, plTriggerState::Enum triggerState) const;
69
70 plHashedString m_sTriggerMessage;
71 plEventMessageSender<plMsgTriggerTriggered> m_TriggerEventSender; // [ event ]
72};
Definition ComponentManager.h:88
A message sender that sends all messages to the next component derived from plEventMessageHandlerComp...
Definition EventMessage.h:39
This class is optimized to take nearly no memory (sizeof(void*)) and to allow very fast checks whethe...
Definition HashedString.h:25
Base class for all Jolt actors.
Definition JoltActorComponent.h:23
Definition JoltContacts.h:66
Turns an object into a trigger that is capable of detecting when other physics objects enter its volu...
Definition JoltTriggerComponent.h:39
void SetTriggerMessage(const char *szSz)
Sets the text that the plMsgTriggerTriggered should contain when the trigger fires.
Definition JoltTriggerComponent.h:61
Definition JoltTriggerComponent.h:10
Definition JoltWorldModule.h:29
Definition Set.h:238
A world encapsulates a scene graph of game objects and various component managers and their component...
Definition World.h:22
virtual void OnSimulationStarted()
This method is called at the start of the next world update when the world is simulated....
Definition WorldModule.h:105
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 handle to a game object.
Definition Declarations.h:76
Enum
Definition TriggerMessage.h:12