35 #ifndef NAV_GRID_COORDINATE_CONVERSION_H 36 #define NAV_GRID_COORDINATE_CONVERSION_H 87 mx =
static_cast<int>(floor(dmx));
88 my =
static_cast<int>(floor(dmy));
116 else if (dmx >= info.
width)
123 mx =
static_cast<unsigned int>(dmx);
131 else if (dmy >= info.
height)
138 my =
static_cast<unsigned int>(dmy);
168 #endif // NAV_GRID_COORDINATE_CONVERSION_H
double origin_x
The origin defines the coordinates of minimum corner of cell (0,0) in the grid.
void gridToWorld(const NavGridInfo &info, int mx, int my, double &wx, double &wy)
Convert from grid coordinates to world coordinates of the center of the cell.
bool isWithinGrid(const NavGridInfo &info, double wx, double wy)
Check to see if the world coordinates are within the grid.
void worldToGrid(const NavGridInfo &info, double wx, double wy, double &mx, double &my)
Convert from world coordinates to the precise (double) grid coordinates.
bool worldToGridBounded(const NavGridInfo &info, double wx, double wy, unsigned int &mx, unsigned int &my)
Convert from world coordinates to grid coordinates.