Skip to content

Commit

Permalink
use euclidean distance for vertex sorting,
Browse files Browse the repository at this point in the history
fixes regression with entities
  • Loading branch information
douira committed Dec 10, 2023
1 parent 1a447b8 commit d2c3167
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ private SortByDistance(Vector3f origin) {

@Override
protected float getKey(Vector3f position) {
float distance = Math.abs(position.x - this.origin.x);
distance += Math.abs(position.y - this.origin.y);
distance += Math.abs(position.z - this.origin.z);
return distance;
// requires euclidean distance, manhattan distance doesn't work
return this.origin.distanceSquared(position);
}
}

Expand Down

0 comments on commit d2c3167

Please sign in to comment.