1
\$\begingroup\$

I am currently writing a game in c++ using openGL, and I am currently using a kinetic sweep and prune algorithm for the broad phase and then using GJK Raycast + GJK & EPA for the narrow phase. However I have realized that kinetic sweep and prune may not be the best choice because there are many objects in the scene that are just static and cause a lot of swapping when an object moves.

So basically I would like to implement a dynamic AABB tree for the broad phase knowing there will be only a few objects requiring continuous collision detection (but these objects are essential). However for these fast moving objects what is the best way to detect a possible collision with other objects in the broad phase? I am thinking about using an AABB that contains the object trajectory from one frame to another, is this a good idea? Or will this a lot of overhead due to many false positives?

Also I haven't read to much about dynamic AABB trees but I think I understand the idea, the idea is for each object that moved check if it's AABB if overlapping with the tree node, if it is do the same check with it's children and do so until we are at the leaves of the tree.

All help is greatly appreciated

\$\endgroup\$
2
  • \$\begingroup\$ It sounds like you can implement your trajectory bounding box idea and profile whether the performance/false-positive rate is acceptable for your needs, or identify precisely where the bottleneck or problematic errors arise. \$\endgroup\$ – DMGregory Jun 18 '20 at 11:30
  • \$\begingroup\$ Ok, I guess I will try doing so, once I find out if this works out I will post a response, however it might take some time. But I think it might work out, I will probably have only a few fast moving objects. \$\endgroup\$ – ThatGuyAgain Jun 21 '20 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.