Plasma Engine  2.0
Loading...
Searching...
No Matches
RecastWorldModule.h
1#pragma once
2
3#include <RecastPlugin/RecastPluginDLL.h>
4
5#include <Core/ResourceManager/ResourceHandle.h>
6#include <Core/World/WorldModule.h>
7#include <RecastPlugin/NavMeshBuilder/NavMeshPointsOfInterest.h>
8
9class dtCrowd;
10class dtNavMesh;
11struct plResourceEvent;
12
14
15class PL_RECASTPLUGIN_DLL plRecastWorldModule : public plWorldModule
16{
17 PL_DECLARE_WORLD_MODULE();
18 PL_ADD_DYNAMIC_REFLECTION(plRecastWorldModule, plWorldModule);
19
20public:
23
24 virtual void Initialize() override;
25 virtual void Deinitialize() override;
26
27 void SetNavMeshResource(const plRecastNavMeshResourceHandle& hNavMesh);
28 const plRecastNavMeshResourceHandle& GetNavMeshResource() { return m_hNavMesh; }
29
30 const dtNavMesh* GetDetourNavMesh() const { return m_pDetourNavMesh; }
31 const plNavMeshPointOfInterestGraph* GetNavMeshPointsOfInterestGraph() const { return m_pNavMeshPointsOfInterest.Borrow(); }
32 plNavMeshPointOfInterestGraph* AccessNavMeshPointsOfInterestGraph() const { return m_pNavMeshPointsOfInterest.Borrow(); }
33
34private:
35 void UpdateNavMesh(const UpdateContext& ctxt);
36 void ResourceEventHandler(const plResourceEvent& e);
37
38 const dtNavMesh* m_pDetourNavMesh = nullptr;
40 plUniquePtr<plNavMeshPointOfInterestGraph> m_pNavMeshPointsOfInterest;
41};
Definition NavMeshPointsOfInterest.h:16
Definition RecastWorldModule.h:16
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10
A world encapsulates a scene graph of game objects and various component managers and their component...
Definition World.h:22
Definition WorldModule.h:10
virtual void Initialize()
This method is called after the constructor. A derived type can override this method to do initializa...
Definition WorldModule.h:98
virtual void Deinitialize()
This method is called before the destructor. A derived type can override this method to do deinitiali...
Definition WorldModule.h:101
These events may be sent by a specific plResource or by the plResourceManager.
Definition Declarations.h:22
Definition WorldModule.h:33