34QSSGBounds3 QSSGBounds3::basisExtent(
const QVector3D ¢er,
const QMatrix3x3 &basis,
const QVector3D &extent)
37 QVector3D c0 = QVector3D(basis(0, 0), basis(1, 0), basis(2, 0)) * extent.x();
38 QVector3D c1 = QVector3D(basis(0, 1), basis(1, 1), basis(2, 1)) * extent.y();
39 QVector3D c2 = QVector3D(basis(0, 2), basis(1, 2), basis(2, 2)) * extent.z();
44 w.setX(qAbs(c0.x()) + qAbs(c1.x()) + qAbs(c2.x()));
45 w.setY(qAbs(c0.y()) + qAbs(c1.y()) + qAbs(c2.y()));
46 w.setZ(qAbs(c0.z()) + qAbs(c1.z()) + qAbs(c2.z()));
48 return QSSGBounds3(center - w, center + w);
68QVector3D QSSGBounds3::getSupport(
const QVector3D &direction)
const
70 const QVector3D halfExtents = extents();
71 return QVector3D(direction.x() > 0 ? halfExtents.x() : -halfExtents.x(),
72 direction.y() > 0 ? halfExtents.y() : -halfExtents.y(),
73 direction.z() > 0 ? halfExtents.z() : -halfExtents.z()) + center();