36 lines
605 B
C++
36 lines
605 B
C++
#include <core/object.h>
|
|
|
|
class RoadMap: public Object {
|
|
GDCLASS(RoadMap, Object)
|
|
public:
|
|
RoadMap();
|
|
~RoadMap();
|
|
static RoadMap *get_singleton();
|
|
static void create_singleton();
|
|
static void destroy_singleton();
|
|
|
|
protected:
|
|
Vector<int> vertices;
|
|
struct segment {
|
|
int v1, v2;
|
|
uint32_t flags;
|
|
};
|
|
Vector<segment> segments;
|
|
struct intersection {
|
|
#define MAX_NEIGHBORS 4
|
|
int neighbors[MAX_NEIGHBORS];
|
|
int ncount;
|
|
uint32_t flags;
|
|
};
|
|
Vector<intersection> intersections;
|
|
/* cylindric area to define road */
|
|
struct area {
|
|
int x, z;
|
|
int radius;
|
|
int type;
|
|
};
|
|
Vector<area> areas;
|
|
};
|
|
|
|
|