• Advertisement
Sign in to follow this  

Sorting Raycasting All Hits Result

This topic is 1843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys,

 

I'm using Bullet Raytest to get all hits in AllHitsRayResultCallback.

 

How do I sort the results (from the closest hit to the farthest) so If the ray hit a wall first before a vehicle, the wall should be sorted first instead of random sorting?

Share this post


Link to post
Share on other sites
Advertisement

Don't store the result in a Bullet-provided structure. Instead, use one of them as a base class and provide an operator<.

Store those structures in a STL container, then just std::sort it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement