32QSSGBounds3 QSSGBounds3::basisExtent(
const QVector3D ¢er,
const QMatrix3x3 &basis,
const QVector3D &extent)
35 QVector3D c0 = QVector3D(basis(0, 0), basis(1, 0), basis(2, 0)) * extent.x();
36 QVector3D c1 = QVector3D(basis(0, 1), basis(1, 1), basis(2, 1)) * extent.y();
37 QVector3D c2 = QVector3D(basis(0, 2), basis(1, 2), basis(2, 2)) * extent.z();
42 w.setX(qAbs(c0.x()) + qAbs(c1.x()) + qAbs(c2.x()));
43 w.setY(qAbs(c0.y()) + qAbs(c1.y()) + qAbs(c2.y()));
44 w.setZ(qAbs(c0.z()) + qAbs(c1.z()) + qAbs(c2.z()));
46 return QSSGBounds3(center - w, center + w);
66QVector3D QSSGBounds3::getSupport(
const QVector3D &direction)
const
68 const QVector3D halfExtents = extents();
69 return QVector3D(direction.x() > 0 ? halfExtents.x() : -halfExtents.x(),
70 direction.y() > 0 ? halfExtents.y() : -halfExtents.y(),
71 direction.z() > 0 ? halfExtents.z() : -halfExtents.z()) + center();