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

Method scale_uniformly

splashsurf_lib/src/aabb.rs:236–242  ·  view source on GitHub ↗

Multiplies a uniform, local scaling to the AABB (i.e. multiplying its extents as if it was centered at the origin)

(&mut self, scaling: R)

Source from the content-addressed store, hash-verified

234
235 /// Multiplies a uniform, local scaling to the AABB (i.e. multiplying its extents as if it was centered at the origin)
236 pub fn scale_uniformly(&mut self, scaling: R) {
237 let center = self.centroid();
238 self.translate(&(center * R::one().neg()));
239 self.min *= scaling;
240 self.max *= scaling;
241 self.translate(&center);
242 }
243
244 /// Enlarges this AABB to the smallest AABB enclosing both itself and another AABB
245 pub fn join(&mut self, other: &Self) {

Callers 3

test_compare_cube_2366Function · 0.80

Calls 2

centroidMethod · 0.80
translateMethod · 0.80

Tested by 3

test_compare_cube_2366Function · 0.64