MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / enclosing_cube

Method enclosing_cube

splashsurf_lib/src/aabb.rs:263–273  ·  view source on GitHub ↗

Returns the smallest cubical AABB with the same center that encloses this AABB

(&self)

Source from the content-addressed store, hash-verified

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(&center);
272 cube
273 }
274}
275
276#[test]

Callers

nothing calls this directly

Calls 3

centroidMethod · 0.80
max_extentMethod · 0.80
translateMethod · 0.80

Tested by

no test coverage detected