many changes :P

This commit is contained in:
k-a-z-u
2016-01-21 20:01:20 +01:00
parent a7dc0cabbb
commit 12084fe147
29 changed files with 2900 additions and 144 deletions

View File

@@ -4,6 +4,9 @@
#include "GridNodeBBox.h"
#include "GridPoint.h"
template<int, typename> class Grid;
/**
* INTERNAL DATASTRUCTURE
* this data-structure is internally used by the Grid
@@ -17,17 +20,26 @@ class GridNode {
/** INTERNAL: array-index */
int _idx = -1;
/** INTERNAL: store neighbors (via index) */
/** INTERNAL: number of neighbors */
int _numNeighbors = 0;
/** INTERNAL: number of neighbors */
int _neighbors[10] = {};
/** INTERNAL: store neighbors (via index) */
int _neighbors[12] = {};
public:
GridNode() {;}
/** get the node's index within its grid */
int getIdx() const {return _idx;}
/** get the number of neighbors for this node */
int getNumNeighbors() const {return _numNeighbors;}
/** get the n-th neighbor for this node */
template <int gridSize_cm, typename T> inline T& getNeighbor(const int nth, const Grid<gridSize_cm, T>& grid) const {
return grid.getNeighbor(_idx, nth);
}
};