49 m_allow_diagonals(false) {
58 for (int32_t x = curpos.
x - 1; x <= curpos.
x + 1; x++) {
59 for (int32_t y = curpos.
y - 1; y <= curpos.
y + 1; y++) {
62 coordinates.push_back(pt);
80 double o = (pt2.
x - pt1.
x) * (pt.
y - pt1.
y) - (pt.
x - pt1.
x) * (pt2.
y - pt1.
y);
93 bool result = (o1 == o2) && (o2 == o3);
94 FL_DBG(
_log,
LMsg(
"ptInTriangle, pt=") << pt <<
" pt1=" << pt1 <<
" pt2=" << pt2 <<
" pt3=" << pt3 <<
" in=" << result);
virtual ~CellGrid()
Destructor.
Helper class to create log strings out from separate parts Usage: LMsg("some text") << variable << "...
Base class for all fife classes Used e.g.
static Logger _log(LM_AUDIO)
DoubleMatrix m_inverse_matrix
Matrix & applyScale(T x, T y, T z)
Apply scale into this matrix.
Matrix inverse() const
Adjoint method inverse, constant time inversion implementation.
Matrix & loadRotate(T angle, T x, T y, T z)
Make this a rotation matrix.
int32_t orientation(const ExactModelCoordinate &pt, const ExactModelCoordinate &pt1, const ExactModelCoordinate &pt2)
DoublePoint intPt2doublePt(Point pt)
Convert from 2D int32_t point to 2D double point.
void getAccessibleCoordinates(const ModelCoordinate &curpos, std::vector< ModelCoordinate > &coordinates)
Gets the coordinates that are accesible from given point only cells adjacent to given cell are consid...
ExactModelCoordinate toMapCoordinates(const ModelCoordinate &layer_coords)
Transforms given point from layer coordinates to map coordinates.
bool ptInTriangle(const ExactModelCoordinate &pt, const ExactModelCoordinate &pt1, const ExactModelCoordinate &pt2, const ExactModelCoordinate &pt3)
Matrix & applyTranslate(T x, T y, T z)
Apply translation into this matrix.
virtual bool isAccessible(const ModelCoordinate &curpos, const ModelCoordinate &target)=0
Tells if given target point is accessible from curpos only cells adjacent to curpos are considered in...
#define FL_DBG(logger, msg)