19 #ifndef HEADER_GRAPH_HPP 20 #define HEADER_GRAPH_HPP 22 #include "utils/no_copy.hpp" 23 #include "utils/vec3.hpp" 25 #include <dimension2d.h> 33 namespace scene {
class ISceneNode;
class IMesh;
class IMeshBuffer; }
34 namespace video {
class ITexture;
struct S3DVertex;
class SColor; }
55 static Graph* m_graph;
57 std::vector<Quad*> m_all_nodes;
62 void createQuad(
const Vec3 &p0,
const Vec3 &p1,
const Vec3 &p2,
63 const Vec3 &p3,
unsigned int node_index,
64 bool invisible,
bool ai_ignore,
bool is_arena,
68 void loadBoundingBoxNodes();
94 void createMesh(
bool show_invisible=
true,
95 bool enable_transparency=
false,
96 const video::SColor *track_color=NULL,
97 bool invert_x_z =
false,
bool flatten =
false);
99 void createMeshSP(
bool show_invisible=
true,
100 bool enable_transparency=
false,
101 const video::SColor *track_color=NULL,
102 bool invert_x_z =
false);
104 void cleanupDebugMesh();
106 virtual bool hasLapLine()
const = 0;
108 virtual void differentNodeColor(
int n, video::SColor* c)
const = 0;
111 static const int UNKNOWN_SECTOR;
113 static const float MIN_HEIGHT_TESTING;
114 static const float MAX_HEIGHT_TESTING;
119 static Graph*
get() {
return m_graph; }
124 assert(m_graph == NULL);
144 void createDebugMesh();
146 RenderTarget* makeMiniMap(
const core::dimension2du &dimension,
147 const std::string &name,
148 const video::SColor &fill_color,
151 void mapPoint2MiniMap(
const Vec3 &xyz,
Vec3 *out)
const;
153 Quad* getQuad(
unsigned int i)
const 155 assert(i < m_all_nodes.size());
156 return m_all_nodes[i];
159 unsigned int getNumNodes()
const {
return (
unsigned int)m_all_nodes.size(); }
161 void findRoadSector(
const Vec3& XYZ,
int *sector,
162 std::vector<int> *all_sectors = NULL,
163 bool ignore_vertical =
false)
const;
165 int findOutOfRoadSector(
const Vec3& xyz,
166 const int curr_sector = UNKNOWN_SECTOR,
167 std::vector<int> *all_sectors = NULL,
168 bool ignore_vertical =
false)
const;
170 const Vec3& getBBMin()
const {
return m_bb_min; }
172 const Vec3& getBBMax()
const {
return m_bb_max; }
174 const int* getBBNodes()
const {
return m_bb_nodes; }
A wrapper around bullets btVector3 to include conventient conversion functions (e.g.
Definition: vec3.hpp:34
scene::ISceneNode * m_node
The node of the graph mesh.
Definition: graph.hpp:79
This class stores a graph of quads.
Definition: graph.hpp:52
float m_scaling
Scaling for mini map.
Definition: graph.hpp:88
Definition: three_d_animation.hpp:32
Vec3 m_bb_min
The 2d bounding box, used for hashing.
Definition: graph.hpp:72
Utility class, you can inherit from this class to disallow the assignment operator and copy construct...
Definition: no_copy.hpp:25
static void setGraph(Graph *graph)
Set the graph (either drive or arena graph for now).
Definition: graph.hpp:122
scene::IMeshBuffer * m_mesh_buffer
The actual mesh buffer storing the graph.
Definition: graph.hpp:85
Definition: render_target.hpp:28
static void destroy()
Cleans up the graph.
Definition: graph.hpp:131
std::unique_ptr< RenderTarget > m_render_target
The render target used for drawing the minimap.
Definition: graph.hpp:91
scene::IMesh * m_mesh
The mesh of the graph mesh.
Definition: graph.hpp:82