dilevin / computer-graphics-bounding-volume-hierarchy

Computer Graphics Assignment about Bounding Volume Hierarchies
6 stars 5 forks source link

Very long use time for distances #54

Closed ginkxo closed 4 years ago

ginkxo commented 4 years ago

For my distances code, I have the following results:

distance_cloud

As you can see, the actual calculations seem to be correct, and it takes very little time to build the tree. However, the actual time to calculate the point squared distances between queries and the AABB tree are enormously long.

Has anyone come across a similar issue? I am wondering if this might primarily be due to how I use the priority queue? I can't think of any other reason why this might be happening, since my tree is relatively balanced, and there is no recursion happening. The only loop I have is a while loop checking whether or not the queue is empty. However I use a custom comparator to work on the pairs.

ginkxo commented 4 years ago

turns out the problem was how PriorityQueue was set with an extra unnecessary comparator