From d276f08c4c98bc1bc7afb8dd28a07a22f52d8021 Mon Sep 17 00:00:00 2001 From: Gabriel Studer <gabriel.studer@unibas.ch> Date: Fri, 26 Oct 2018 15:21:22 +0200 Subject: [PATCH] simplify index generation in DynamicSpatialOrganizer => speedups thanks Gerardo for pointing that out --- core/src/dynamic_spatial_organizer.hh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/dynamic_spatial_organizer.hh b/core/src/dynamic_spatial_organizer.hh index 59398d79..dada464d 100644 --- a/core/src/dynamic_spatial_organizer.hh +++ b/core/src/dynamic_spatial_organizer.hh @@ -286,9 +286,8 @@ private: mutable WithinList result_buffer_; Index gen_index(const geom::Vec3& pos) const { - Index nrvo(static_cast<int>(std::floor(pos[0]/delta_ + Real(0.5))), - static_cast<int>(std::floor(pos[1]/delta_ + Real(0.5))), - static_cast<int>(std::floor(pos[2]/delta_ + Real(0.5)))); + Index nrvo(std::floor(pos[0]/delta_), std::floor(pos[1]/delta_), + std::floor(pos[2]/delta_)); return nrvo; } }; -- GitLab