added automatic conversion of Map::Vertex into xyz_location

This commit is contained in:
Arthur Ice 2014-11-26 21:25:09 -08:00
parent 4094d43c49
commit 5b783e84e9

View File

@ -22,6 +22,7 @@
#ifndef ZONE_MAP_H
#define ZONE_MAP_H
#include "position.h"
#include <stdio.h>
#include <string>
@ -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;
};