From 40cc47e07a2a6161eb1ba3f30357d04c90a9f5e8 Mon Sep 17 00:00:00 2001 From: Joshua Coles Date: Tue, 14 Mar 2023 16:00:31 +0000 Subject: [PATCH] Fix neighbours issue in off-axis walk code --- DLASystem.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/DLASystem.cpp b/DLASystem.cpp index 4549677..6458b5c 100644 --- a/DLASystem.cpp +++ b/DLASystem.cpp @@ -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},