mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 10:44:08 +00:00
remove singleton for dpWorld (#1427)
Removes the singleton inheritance from dpWorld. Tested that crux prime, nimbus station, avant gardens and nexus tower still use navmeshes and physics and that physics volumes are still collided with.
This commit is contained in:
@@ -1,48 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include "Singleton.h"
|
||||
#include <cstdint>
|
||||
|
||||
//Navmesh includes:
|
||||
#include "Recast.h"
|
||||
#include "DetourNavMesh.h"
|
||||
#include "DetourNavMeshBuilder.h"
|
||||
#include "DetourNavMeshQuery.h"
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "dNavMesh.h"
|
||||
|
||||
class NiPoint3;
|
||||
class dNavMesh;
|
||||
class dpEntity;
|
||||
class dpGrid;
|
||||
|
||||
class dpWorld : public Singleton<dpWorld> {
|
||||
public:
|
||||
void Initialize(unsigned int zoneID, bool generateNewNavMesh = true);
|
||||
namespace dpWorld {
|
||||
void Initialize(uint32_t zoneID, bool generateNewNavMesh = true);
|
||||
void Shutdown();
|
||||
void Reload();
|
||||
|
||||
~dpWorld();
|
||||
|
||||
bool ShouldUseSP(unsigned int zoneID);
|
||||
bool IsLoaded() const { return m_NavMesh->GetdtNavMesh() != nullptr; }
|
||||
bool ShouldUseSP(uint32_t zoneID);
|
||||
bool IsLoaded();
|
||||
|
||||
void StepWorld(float deltaTime);
|
||||
|
||||
void AddEntity(dpEntity* entity);
|
||||
void RemoveEntity(dpEntity* entity);
|
||||
|
||||
dNavMesh* GetNavMesh() { return m_NavMesh; }
|
||||
|
||||
private:
|
||||
dpGrid* m_Grid;
|
||||
bool phys_spatial_partitioning = true;
|
||||
int phys_sp_tilesize = 205;
|
||||
int phys_sp_tilecount = 12;
|
||||
|
||||
std::vector<dpEntity*> m_StaticEntities;
|
||||
std::vector<dpEntity*> m_DynamicEntites;
|
||||
|
||||
dNavMesh* m_NavMesh = nullptr;
|
||||
uint32_t m_ZoneID = 0;
|
||||
dNavMesh* GetNavMesh();
|
||||
};
|
||||
|
Reference in New Issue
Block a user