Skip to content

Commit

Permalink
Use PI const
Browse files Browse the repository at this point in the history
  • Loading branch information
nside committed Apr 11, 2021
1 parent 7d16da4 commit e5847bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/bevy_render/src/mesh/shape/uvsphere.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::{
mesh::{Indices, Mesh},
pipeline::PrimitiveTopology,
};
use std::f32::consts::PI;

/// A sphere made of sectors and stacks
#[derive(Debug, Clone, Copy)]
Expand All @@ -27,7 +28,7 @@ impl Default for Uvsphere {
impl From<Uvsphere> for Mesh {
fn from(sphere: Uvsphere) -> Self {
// Largely inspired from http://www.songho.ca/opengl/gl_sphere.html
let PI: f32 = f32::acos(-1.);

let sectors = sphere.sectors as f32;
let stacks = sphere.stacks as f32;
let length_inv = 1. / sphere.radius;
Expand Down

0 comments on commit e5847bd

Please sign in to comment.