Plasma Engine  2.0
Loading...
Searching...
No Matches
AreaDamageComponent.h
1#pragma once
2
3#include <Core/World/Component.h>
4#include <Core/World/World.h>
5#include <GameComponentsPlugin/GameComponentsDLL.h>
6
9
10class PL_GAMECOMPONENTS_DLL plAreaDamageComponentManager : public plComponentManager<class plAreaDamageComponent, plBlockStorageType::FreeList>
11{
13
14public:
16
17 virtual void Initialize() override;
18
19private:
20 friend class plAreaDamageComponent;
21 plPhysicsWorldModuleInterface* m_pPhysicsInterface = nullptr;
22};
23
34class PL_GAMECOMPONENTS_DLL plAreaDamageComponent : public plComponent
35{
37
39 // plComponent
40
41public:
42 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
43 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
44
45protected:
46 virtual void OnSimulationStarted() override;
47
48
50 // plAreaDamageComponent
51
52public:
55
56 void ApplyAreaDamage(); // [ scriptable ]
57
58 bool m_bTriggerOnCreation = true; // [ property ]
59 plUInt8 m_uiCollisionLayer = 0; // [ property ]
60 float m_fRadius = 5.0f; // [ property ]
61 float m_fDamage = 10.0f; // [ property ]
62 float m_fImpulse = 100.0f; // [ property ]
63};
Used to apply damage to objects in the vicinity and push physical objects away.
Definition AreaDamageComponent.h:35
Definition AreaDamageComponent.h:11
Base class of all component types.
Definition Component.h:25
Definition ComponentManager.h:88
Definition PhysicsWorldModule.h:109
A world encapsulates a scene graph of game objects and various component managers and their component...
Definition World.h:22
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
Used to report overlap query results.
Definition PhysicsWorldModule.h:49