#ifndef MESH_STATE_H #define MESH_STATE_H #include #include #include namespace MeshBased { struct MyState { NM::NavMeshLocation pos; Heading heading; /** ctor */ MyState() : pos(), heading(0) { ; } /** ctor */ MyState(NM::NavMeshLocation loc, Heading h) : pos(loc), heading(h) { ; } MyState& operator += (const MyState& o) { pos.pos += o.pos.pos; return *this; } MyState& operator /= (const float val) { pos.pos /= val; return *this; } MyState operator * (const float val) const { MyState copy = *this; copy.pos.pos = copy.pos.pos * val; return copy; } float getX(){ return pos.pos.x; } float getY() { return pos.pos.y; } float getZ() { return pos.pos.z; } void setPosition(Point3 other){ pos.pos = other; } float getBinValue(const int dim) const { switch (dim) { case 0: return this->pos.pos.x; case 1: return this->pos.pos.y; case 2: return this->pos.pos.z; case 3: return this->heading.getRAD(); } throw "cant find this value within the bin"; } }; } #endif // MESH_STATE_H