Plasma Engine  2.0
Loading...
Searching...
No Matches
JoltStaticActorComponent.h
1#pragma once
2
3#include <JoltPlugin/Actors/JoltActorComponent.h>
4#include <JoltPlugin/Resources/JoltMeshResource.h>
5
7
9
16class PL_JOLTPLUGIN_DLL plJoltStaticActorComponent : public plJoltActorComponent
17{
19
21 // plComponent
22
23public:
24 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
25 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
26
27protected:
28 virtual void OnDeactivated() override;
29 virtual void OnSimulationStarted() override;
30
32 // plJoltActorComponent
33protected:
34 virtual void CreateShapes(plDynamicArray<plJoltSubShape>& out_Shapes, const plTransform& rootTransform, float fDensity, const plJoltMaterial* pMaterial) override;
35
37 // plJoltStaticActorComponent
38
39public:
42
44 void PullSurfacesFromGraphicsMesh(plDynamicArray<const plJoltMaterial*>& ref_materials);
45
46 void SetMeshFile(const char* szFile); // [ property ]
47 const char* GetMeshFile() const; // [ property ]
48
49 void SetMesh(const plJoltMeshResourceHandle& hMesh);
50 PL_ALWAYS_INLINE const plJoltMeshResourceHandle& GetMesh() const { return m_hCollisionMesh; }
51
52 void SetSurfaceFile(const char* szFile); // [ property ]
53 const char* GetSurfaceFile() const; // [ property ]
54
55 bool m_bIncludeInNavmesh = true; // [ property ]
56 bool m_bPullSurfacesFromGraphicsMesh = false; // [ property ]
57 plSurfaceResourceHandle m_hSurface; // [ property ]
58
59protected:
60 void OnMsgExtractGeometry(plMsgExtractGeometry& msg) const;
61 const plJoltMaterial* GetJoltMaterial() const;
62
63 plJoltMeshResourceHandle m_hCollisionMesh;
64
65 // array to keep surfaces alive, in case they are pulled from the materials of the render mesh
67};
Definition ComponentManager.h:88
Definition DynamicArray.h:81
Base class for all Jolt actors.
Definition JoltActorComponent.h:23
virtual void SerializeComponent(plWorldWriter &inout_stream) const override
Override this to save the current state of the component to the given stream.
Definition JoltActorComponent.cpp:47
virtual void OnDeactivated() override
This method is called when the component gets deactivated.
Definition JoltActorComponent.cpp:79
virtual void OnSimulationStarted() override
This method is called once for active components, at the start of the next world update,...
Definition JoltActorComponent.cpp:66
virtual void DeserializeComponent(plWorldReader &inout_stream) override
Override this to load the current state of the component from the given stream.
Definition JoltActorComponent.cpp:56
Definition JoltMaterial.h:7
Turns an object into an immovable obstacle in the physics simulation.
Definition JoltStaticActorComponent.h:17
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
Sent by plWorldGeoExtractionUtil to gather geometry information about objects in a world.
Definition WorldGeoExtractionUtil.h:56