From 052f0557d4361e56f9aa9c6e43a463119fcacfbf Mon Sep 17 00:00:00 2001 From: bramas <berenger.bramas@inria.fr> Date: Tue, 21 Jan 2014 09:29:27 +0100 Subject: [PATCH] manage particules on the border correctly --- Src/Containers/FOctree.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Src/Containers/FOctree.hpp b/Src/Containers/FOctree.hpp index ca3a9278b..a700afae5 100755 --- a/Src/Containers/FOctree.hpp +++ b/Src/Containers/FOctree.hpp @@ -94,8 +94,10 @@ class FOctree : public FNoCopyable { * @return the box num at the leaf level that contains inRelativePosition */ int getTreeCoordinate(const FReal inRelativePosition) const { - FAssertLF( (inRelativePosition >= 0 && inRelativePosition < this->boxWidth), "inRelativePosition : ",inRelativePosition ); - FAssertLF( inRelativePosition >= 0 && inRelativePosition < this->boxWidth, "Particle out of box" ); + FAssertLF( (inRelativePosition >= 0 && inRelativePosition <= this->boxWidth), "inRelativePosition : ",inRelativePosition ); + if(inRelativePosition == this->boxWidth){ + return FMath::pow2(height-1)-1; + } const FReal indexFReal = inRelativePosition / this->boxWidthAtLevel[this->leafIndex]; return static_cast<int>(indexFReal); } -- GitLab