Fix neighbours issue in off-axis walk code

This commit is contained in:
Joshua Coles 2023-03-14 16:00:31 +00:00
parent 4649658a9b
commit 40cc47e07a

View File

@ -116,28 +116,31 @@ const static size_t NEIGHBOURS = 26;
// this has to be done separately...
void DLASystem::setPosNeighbour(double setpos[], double pos[], int val) {
const static double offsets[NEIGHBOURS][3] = {
// These 6 are first to represent the 6 immediate neighbours of the cell when checking sticking
{1, 0, 0},
{-1, 0, 0},
{0, 1, 0},
{0, -1, 0},
{0, 0, 1},
{0, 0, -1},
// The off-axis neighbours
{-1, -1, -1},
{-1, -1, 0},
{-1, -1, 1},
{-1, 0, -1},
{-1, 0, 0},
{-1, 0, 1},
{-1, 1, -1},
{-1, 1, 0},
{-1, 1, 1},
{0, -1, -1},
{0, -1, 0},
{0, -1, 1},
{0, 0, -1},
{0, 0, 1},
{0, 1, -1},
{0, 1, 0},
{0, 1, 1},
{1, -1, -1},
{1, -1, 0},
{1, -1, 1},
{1, 0, -1},
{1, 0, 0},
{1, 0, 1},
{1, 1, -1},
{1, 1, 0},