correctly compute the bounding sphere

metadata
Wenzel Jakob 2010-11-02 00:46:52 +01:00
parent af27507674
commit a969d525d2
2 changed files with 6 additions and 5 deletions

View File

@ -586,6 +586,7 @@ plugins += env.SharedLibrary('plugins/constant', ['src/luminaires/constant.cpp']
plugins += env.SharedLibrary('plugins/envmap', ['src/luminaires/envmap.cpp'])
plugins += env.SharedLibrary('plugins/spot', ['src/luminaires/spot.cpp'])
plugins += env.SharedLibrary('plugins/point', ['src/luminaires/point.cpp'])
plugins += env.SharedLibrary('plugins/sinusoidal', ['src/luminaires/sinusoidal.cpp'])
plugins += env.SharedLibrary('plugins/collimated', ['src/luminaires/collimated.cpp'])
plugins += env.SharedLibrary('plugins/directional', ['src/luminaires/directional.cpp'])

View File

@ -275,11 +275,11 @@ void Scene::initialize() {
m_aabb = m_kdtree->getAABB();
m_bsphere = m_kdtree->getBSphere();
for (unsigned int i=0; i<m_media.size(); i++) {
const AABB &aabb = m_media[i]->getAABB();
m_aabb.expandBy(aabb);
for (int j=0; j<8; ++j)
m_bsphere.expandBy(aabb.getCorner(j));
if (m_media.size() > 0) {
for (size_t i=0; i<m_media.size(); i++)
m_aabb.expandBy(m_media[i]->getAABB());
m_bsphere = m_aabb.getBSphere();
}
}