From 5b783e84e9993023893a23b1250f54f0d4bb266f Mon Sep 17 00:00:00 2001 From: Arthur Ice Date: Wed, 26 Nov 2014 21:25:09 -0800 Subject: [PATCH] added automatic conversion of Map::Vertex into xyz_location --- zone/map.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/zone/map.h b/zone/map.h index 224e30c73..64a289a41 100644 --- a/zone/map.h +++ b/zone/map.h @@ -22,6 +22,7 @@ #ifndef ZONE_MAP_H #define ZONE_MAP_H +#include "position.h" #include #include @@ -36,10 +37,14 @@ public: Vertex() : x(0.0f), y(0.0f), z(0.0f) { } Vertex(float _x, float _y, float _z) : x(_x), y(_y), z(_z) { } ~Vertex() { } - bool operator==(const Vertex &v) const + bool operator==(const Vertex &v) const { return((v.x == x) && (v.y == y) && (v.z == z)); } + operator xyz_location() const + { + return xyz_location(x,y,z); + } float x; float y; @@ -49,7 +54,7 @@ public: Map(); ~Map(); - + float FindBestZ(Vertex &start, Vertex *result) const; bool LineIntersectsZone(Vertex start, Vertex end, float step, Vertex *result) const; bool LineIntersectsZoneNoZLeaps(Vertex start, Vertex end, float step_mag, Vertex *result) const; @@ -62,7 +67,7 @@ private: void TranslateVertex(Vertex &v, float tx, float ty, float tz); bool LoadV1(FILE *f); bool LoadV2(FILE *f); - + struct impl; impl *imp; };