MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / CLevelGraph

Method CLevelGraph

ogsr_engine/COMMON_AI/GRAPH/level_graph.cpp:13–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12
13CLevelGraph::CLevelGraph(LPCSTR fName)
14{
15 sh_debug->create("editor\\wire"); // sh_debug->create("debug\\ai_nodes", "$null");
16
17 m_reader = FS.r_open(fName);
18
19 // m_header & data
20 m_header = (CHeader*)m_reader->pointer();
21 ASSERT_XRAI_VERSION_MATCH(header().version(), "Level graph");
22 m_reader->advance(sizeof(CHeader));
23 m_nodes = xr_new<CVertexStorage>(m_reader, header().vertex_count(), static_cast<xrAI_Versions>(header().version()));
24 m_row_length = iFloor((header().box().max.z - header().box().min.z) / header().cell_size() + EPS_L + 1.5f);
25 m_column_length = iFloor((header().box().max.x - header().box().min.x) / header().cell_size() + EPS_L + 1.5f);
26 m_access_mask.assign(header().vertex_count(), true);
27 unpack_xz(vertex_position(header().box().max), m_max_x, m_max_z);
28
29#ifdef DEBUG
30 m_current_level_id = -1;
31 m_current_actual = false;
32 m_current_center = Fvector().set(flt_max, flt_max, flt_max);
33 m_current_radius = Fvector().set(flt_max, flt_max, flt_max);
34#endif
35}
36
37CLevelGraph::~CLevelGraph()
38{

Callers

nothing calls this directly

Calls 10

vertex_positionFunction · 0.85
r_openMethod · 0.80
pointerMethod · 0.80
cell_sizeMethod · 0.80
createMethod · 0.45
versionMethod · 0.45
advanceMethod · 0.45
vertex_countMethod · 0.45
assignMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected