git-svn-id: svn://db.shs.com.ru/libs@73 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2015-12-15 10:35:51 +00:00
parent 0ae2fbfa6f
commit e40db20368
4 changed files with 34 additions and 19 deletions

View File

@@ -137,25 +137,7 @@ void GLObjectBase::addChildren(QList<GLObjectBase * > & list, GLObjectBase * whe
void GLObjectBase::calculateBoundingBox() {
if (points.isEmpty()) return;
GLfloat mix, miy, miz, max, may, maz;
mix = max = points[0].x;
miy = may = points[0].y;
miz = maz = points[0].z;
foreach (const Vector3d & i, points) {
if (mix > i.x) mix = i.x;
if (max < i.x) max = i.x;
if (miy > i.y) miy = i.y;
if (may < i.y) may = i.y;
if (miz > i.z) miz = i.z;
if (maz < i.z) maz = i.z;
}
bound.x = (mix + max) / 2.;
bound.y = (miy + may) / 2.;
bound.z = (miz + maz) / 2.;
bound.length = max - mix;
bound.width = may - miy;
bound.height = maz - miz;
bound = vbo.boundingBox();
}