void BvHierarchyAlgorithm::addTopLevelProxy(Proxy* proxy) { std::list<Proxy*> queue; queue.push_back(proxy); while (!queue.empty()) { Proxy* p = queue.front(); queue.pop_front(); for (std::list<Proxy*>::const_iterator it = p->getChildProxies().begin(); it != p->getChildProxies().end(); ++it) { queue.push_back(*it); } if (!p->getShape()) { continue; } if (p->getShape()->getShapeType() != Shape::SHAPE_TYPE_MESH) { throw Exception("Deformable proxy has non-mesh shape - this is not allowed!"); } initMesh(p, static_cast<Mesh*>(p->getShape())); } }