63 if ((x<=1) && (y<=1)) {
75 if (curpos == target) {
77 }
else if (
ABS(target.
x-curpos.
x)^
ABS(target.
y-curpos.
y)) {
84 return static_cast<double>(
ABS(target.
x - curpos.
x) +
ABS(target.
y - curpos.
y));
88 static std::string type(
"square");
93 static std::string squareGrid(
"Square Grid");
114 double x =
static_cast<double>(cell.
x);
115 double y =
static_cast<double>(cell.
y);
123 std::vector<ModelCoordinate> coords;
124 std::vector<ModelCoordinate>::const_iterator it = orig.begin();
126 for (; it != orig.end(); ++it) {
130 coords.push_back(mc);
133 for (; it != orig.end(); ++it) {
137 coords.push_back(mc);
double getAdjacentCost(const ModelCoordinate &curpos, const ModelCoordinate &target)
Returns distance const from curpos to target point only cells adjacent to curpos are considered in th...
void setZShift(const double zshift)
Set the cellgrid z shift.
void getVertices(std::vector< ExactModelCoordinate > &vtx, const ModelCoordinate &cell)
Fills given point vector with vertices from selected cell.
static Logger _log(LM_AUDIO)
DoubleMatrix m_inverse_matrix
void setXShift(const double &xshift)
Set the cellgrid x shift.
void setYScale(const double scale)
Set the cellgrid y-scaling.
void setXScale(const double scale)
Set the cellgrid x-scaling.
void setYShift(const double yshift)
Set the cellgrid y shift.
const std::string & getName() const
Name of the cellgrid (DEPRECATED? -jwt)
CellGrid * clone()
Returns clone of this cellgrid.
ModelCoordinate toLayerCoordinates(const ExactModelCoordinate &map_coord)
Transforms given point from map coordinates to layer coordinates.
bool isAccessible(const ModelCoordinate &curpos, const ModelCoordinate &target)
Tells if given target point is accessible from curpos only cells adjacent to curpos are considered in...
ExactModelCoordinate toExactLayerCoordinates(const ExactModelCoordinate &map_coord)
Transforms given point from map coordinates to layer coordinates.
void setAllowDiagonals(const bool allow_diagonals)
Set whether diagonal cell access is allowed.
const std::string & getType() const
Type of cellgrid.
DoublePoint3D ExactModelCoordinate
double getHeuristicCost(const ModelCoordinate &curpos, const ModelCoordinate &target)
Returns distance const from curpos to target point.
void setRotation(const double rotation)
Set the cellgrid rotation.
std::vector< ModelCoordinate > toMultiCoordinates(const ModelCoordinate &position, const std::vector< ModelCoordinate > &orig, bool reverse)
Returns point vector with coordinates for a multi object.
ExactModelCoordinate toMapCoordinates(const ExactModelCoordinate &layer_coords)
Transforms given point from layer coordinates to map coordinates.