From 3f3a6e1f566b70e7279f425fb843e138466a93c8 Mon Sep 17 00:00:00 2001 From: Ben Haller Date: Fri, 1 Dec 2023 16:38:20 -0500 Subject: [PATCH] fix 3D spatial kernel grid value calculation --- core/spatial_kernel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/spatial_kernel.cpp b/core/spatial_kernel.cpp index ac8bd423..4031ef0d 100644 --- a/core/spatial_kernel.cpp +++ b/core/spatial_kernel.cpp @@ -317,7 +317,7 @@ void SpatialKernel::CalculateGridValues(SpatialMap &p_map) double distance = sqrt(dist_a_sq + dist_b_sq + dist_c_sq); double density = (distance > max_distance_) ? 0.0 : DensityForDistance(distance); - values_[a] = density; + values_[a + b * dim[0] + c * dim[0] * dim[1]] = density; } } }