Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/simulation2/helpers/HierarchicalPathfinder.h
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
#ifdef TEST | #ifdef TEST | ||||
class TestCmpPathfinder; | class TestCmpPathfinder; | ||||
class TestHierarchicalPathfinder; | class TestHierarchicalPathfinder; | ||||
#endif | #endif | ||||
class HierarchicalOverlay; | class HierarchicalOverlay; | ||||
class SceneCollector; | |||||
class HierarchicalPathfinder | class HierarchicalPathfinder | ||||
{ | { | ||||
#ifdef TEST | #ifdef TEST | ||||
friend class TestCmpPathfinder; | friend class TestCmpPathfinder; | ||||
friend class TestHierarchicalPathfinder; | friend class TestHierarchicalPathfinder; | ||||
#endif | #endif | ||||
public: | public: | ||||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | pass_class_t GetPassabilityClass(const std::string& name) const | ||||
auto it = m_PassClassMasks.find(name); | auto it = m_PassClassMasks.find(name); | ||||
if (it != m_PassClassMasks.end()) | if (it != m_PassClassMasks.end()) | ||||
return it->second; | return it->second; | ||||
LOGERROR("Invalid passability class name '%s'", name.c_str()); | LOGERROR("Invalid passability class name '%s'", name.c_str()); | ||||
return 0; | return 0; | ||||
} | } | ||||
void RenderSubmit(SceneCollector& collector); | |||||
private: | private: | ||||
static const u8 CHUNK_SIZE = 96; // number of navcells per side | static const u8 CHUNK_SIZE = 96; // number of navcells per side | ||||
// TODO: figure out best number. Probably 64 < n < 128 | // TODO: figure out best number. Probably 64 < n < 128 | ||||
struct Chunk | struct Chunk | ||||
{ | { | ||||
u8 m_ChunkI, m_ChunkJ; // chunk ID | u8 m_ChunkI, m_ChunkJ; // chunk ID | ||||
std::vector<u16> m_RegionsID; // IDs of local regions, 0 (impassable) excluded | std::vector<u16> m_RegionsID; // IDs of local regions, 0 (impassable) excluded | ||||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator