Box3f Quad::bounds() const { Box3f result; result.grow(_base); result.grow(_base + _edge0); result.grow(_base + _edge1); result.grow(_base + _edge0 + _edge1); return result; }
Box3f Cube::bounds() const { Box3f box; for (int i = 0; i < 8; ++i) { box.grow(_pos + _rot*Vec3f( (i & 1 ? _scale.x() : -_scale.x()), (i & 2 ? _scale.y() : -_scale.y()), (i & 4 ? _scale.z() : -_scale.z()) )); } return box; }