diff --git a/Src/Containers/FOctree.hpp b/Src/Containers/FOctree.hpp index ca3a9278b630a8bc94d1090e5ae9870efdcf3bcb..a700afae5b1f0c8131c00ea328ede69f53d8278a 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); }