Sign in to follow this  
Alundra

[AABB] two methods who works

Recommended Posts

Hi,

an AABB can be defined using two methods.

The first method is to define an AABB as a min and a max.

Using this methode, extents is the vector 0.5f * ( max - min ), center is 0.5 * ( min + max ).

The second method is to define directly an AAAB as a center and extents.

Both method works but what method do you prefer and why ?

I seen a lot of people who use the min/max method.

XNA use the second (center+extents) and says :

The bounding volume structures are setup for near minimum size because there
are likely to be many of them, and memory bandwidth and space will be at a
premium relative to CPU cycles on Xbox 360.

Thanks

 

 

Share this post


Link to post
Share on other sites

Whichever method best fits the problem in hand. If you are always querying min/max points, use that method. If you always query center + extents, use that instead. Converting from one to the other is super cheap, so there isn't really a problem either way (it's never going to cause a significant performance hotspot)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this