Skip to content
Snippets Groups Projects
Commit e9ddfdad authored by Daniel Savchenko's avatar Daniel Savchenko
Browse files

compute BB over mesh instead of SceneGraph

parent 51fc72a6
No related branches found
No related tags found
1 merge request!5compute BB over mesh instead of SceneGraph
......@@ -642,12 +642,18 @@
*/
template < class MeshT >
void MeshObject< MeshT >::boundingBox( ACG::Vec3d& _bbMin , ACG::Vec3d& _bbMax ) {
if ( meshNode_ ) {
_bbMin = ACG::Vec3d(FLT_MAX, FLT_MAX, FLT_MAX);
_bbMax = ACG::Vec3d(-FLT_MAX, -FLT_MAX, -FLT_MAX);
meshNode_->boundingBox(_bbMin,_bbMax);
if ( mesh_ ) {
_bbMin = mesh_->point(mesh_->vertex_handle(0));
_bbMax = mesh_->point(mesh_->vertex_handle(0));
for ( auto v_it : mesh_->vertices()) {
const ACG::Vec3d p = mesh_->point(v_it);
_bbMin.minimize(p);
_bbMax.maximize(p);
}
} else {
std::cerr << "Error: Bounding box computation via Scenegraph not available without gui" << std::endl;
// This is basicly impossible, but just in case
std::cerr << "Error: No Mesh found" << std::endl;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment