Use cbrt() instead of powf(1./3.) (#6481)

# Objective

- Use cube root library function instead of handrolling.

## Solution

- Instead of `powf(1./3.)` use `cbrt()`.
This commit is contained in:
targrub 2022-11-05 14:12:04 +00:00
parent 40ea5b4ef6
commit 96c9c60f80
2 changed files with 2 additions and 2 deletions

View file

@ -349,7 +349,7 @@ pub fn extract_text_uinodes(
.get(&text_glyph.atlas_info.texture_atlas) .get(&text_glyph.atlas_info.texture_atlas)
.unwrap(); .unwrap();
let texture = atlas.texture.clone_weak(); let texture = atlas.texture.clone_weak();
let index = text_glyph.atlas_info.glyph_index as usize; let index = text_glyph.atlas_info.glyph_index;
let rect = atlas.textures[index]; let rect = atlas.textures[index];
let atlas_size = Some(atlas.size); let atlas_size = Some(atlas.size);

View file

@ -73,7 +73,7 @@ fn generate_bodies(
rng.gen_range(-1.0..1.0), rng.gen_range(-1.0..1.0),
) )
.normalize() .normalize()
* rng.gen_range(0.2f32..1.0).powf(1. / 3.) * rng.gen_range(0.2f32..1.0).cbrt()
* 15.; * 15.;
commands.spawn(BodyBundle { commands.spawn(BodyBundle {