mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
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:
parent
40ea5b4ef6
commit
96c9c60f80
2 changed files with 2 additions and 2 deletions
|
@ -349,7 +349,7 @@ pub fn extract_text_uinodes(
|
|||
.get(&text_glyph.atlas_info.texture_atlas)
|
||||
.unwrap();
|
||||
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 atlas_size = Some(atlas.size);
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ fn generate_bodies(
|
|||
rng.gen_range(-1.0..1.0),
|
||||
)
|
||||
.normalize()
|
||||
* rng.gen_range(0.2f32..1.0).powf(1. / 3.)
|
||||
* rng.gen_range(0.2f32..1.0).cbrt()
|
||||
* 15.;
|
||||
|
||||
commands.spawn(BodyBundle {
|
||||
|
|
Loading…
Reference in a new issue