matrix4::transformBox consists of the following code:
Code: Select all
//! Transforms a axis aligned bounding box
inline void matrix4::transformBox( core::aabbox3d<f32> &box) const
{
transformVect(box.MinEdge);
transformVect(box.MaxEdge);
box.repair();
}
Code: Select all
//! Transforms a axis aligned bounding box
inline void matrix4::transformBox( core::aabbox3d<f32> &box) const
{
vector3df min, max, vec;
int i;
min = box.MinEdge;
max = box.MaxEdge;
transformVect(box.MinEdge);
transformVect(box.MaxEdge);
box.repair();
for(i = 0; i < 6; i++)
{
vec.X = ((i == 0 || i == 1 || i == 2) ? min : max).X;
vec.Y = ((i == 0 || i == 3 || i == 5) ? min : max).Y;
vec.Z = ((i == 1 || i == 4 || i == 5) ? min : max).Z;
transformVect(vec);
box.addInternalPoint(vec);
}
}