Returns the smallest cubical AABB with the same center that encloses this AABB
(&self)
| 261 | |
| 262 | /// Returns the smallest cubical AABB with the same center that encloses this AABB |
| 263 | pub fn enclosing_cube(&self) -> Self { |
| 264 | let center = self.centroid(); |
| 265 | let half_max_extent = self.max_extent() / (R::one() + R::one()); |
| 266 | |
| 267 | let mut cube = Self::new( |
| 268 | SVector::repeat(half_max_extent.neg()), |
| 269 | SVector::repeat(half_max_extent), |
| 270 | ); |
| 271 | cube.translate(¢er); |
| 272 | cube |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | #[test] |
nothing calls this directly
no test coverage detected