This project is read-only.

Question about Box3f class

May 10, 2013 at 12:18 AM
Edited May 10, 2013 at 6:05 AM
I dont understand the implementation of the Box3f class.

Why arent your storing values:
Vector3f _min;
Vector3f _max;

like this implementation, for example:

I see you have a similar implementation like:

What are the benefits to store it like this? Is it because of having the ability to give the box an orientation / helpful for world space boxes ?

... and i noticed that the data of the CompositeShape class is not accessible. Why? How can i get the data that i added to it?
For example when i want to draw the shapes for visualisation i need the inner data.
May 10, 2013 at 12:00 PM
That representation for the Box3f class is based on that of the Wild Magic engine from Dave Eberly. Long ago when I was starting out I learned many of my geometric algorithms from his books, and I guess the ideas just stuck... One of the benefits of having this representation is that you are working with a point as the center, and then the extents in each of the three directions. This makes the calculation of plane equations very simple, and then intersection tests become very easy based on the distance from the plane.

I can modify the CompositeShape class to make the members accessible - that shouldn't be an issue.
May 10, 2013 at 6:14 PM
Edited May 10, 2013 at 6:15 PM
Thanks for the explanation. It make sense to me.

And thanks for doing the modifications.