Advertisement

[AABB] two methods who works

Started by July 09, 2013 02:36 AM
0 comments, last by RobTheBloke 11 years, 7 months ago

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

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)

This topic is closed to new replies.

Advertisement