Пример #1
0
/*!
SLGroup::buildAABB() loops over all child nodes and merges their AABB
to the axis aligned bounding box of the group.
*/
SLAABBox& SLGroup::buildAABB()
{  SLNode* current = _first;
   
   // empty the groups AABB    
   _aabb.minWS(SLVec3f( FLT_MAX, FLT_MAX, FLT_MAX));
   _aabb.maxWS(SLVec3f(-FLT_MAX,-FLT_MAX,-FLT_MAX));

   while (current)
   {  _aabb.merge(current->buildAABB());
      current = current->next();
   }
   
   _aabb.fromWStoOS(_aabb.minWS(), _aabb.maxWS(), _wmI);
   return _aabb;
}