Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 052f0557 authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files

manage particules on the border correctly

parent 4be10ae4
Branches
Tags
No related merge requests found
...@@ -94,8 +94,10 @@ class FOctree : public FNoCopyable { ...@@ -94,8 +94,10 @@ class FOctree : public FNoCopyable {
* @return the box num at the leaf level that contains inRelativePosition * @return the box num at the leaf level that contains inRelativePosition
*/ */
int getTreeCoordinate(const FReal inRelativePosition) const { int getTreeCoordinate(const FReal inRelativePosition) const {
FAssertLF( (inRelativePosition >= 0 && inRelativePosition < this->boxWidth), "inRelativePosition : ",inRelativePosition ); FAssertLF( (inRelativePosition >= 0 && inRelativePosition <= this->boxWidth), "inRelativePosition : ",inRelativePosition );
FAssertLF( inRelativePosition >= 0 && inRelativePosition < this->boxWidth, "Particle out of box" ); if(inRelativePosition == this->boxWidth){
return FMath::pow2(height-1)-1;
}
const FReal indexFReal = inRelativePosition / this->boxWidthAtLevel[this->leafIndex]; const FReal indexFReal = inRelativePosition / this->boxWidthAtLevel[this->leafIndex];
return static_cast<int>(indexFReal); return static_cast<int>(indexFReal);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment