git-svn-id: svn://db.shs.com.ru/libs@73 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user