mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Adress feedback
- Rewrite 2 * PI to TAU - Some comment formatting
This commit is contained in:
parent
d86c9f2678
commit
44962958d8
@ -866,7 +866,6 @@ impl<'a> PhysicsData<'a> {
|
||||
// Oddities can occur on the intersection between multiple
|
||||
// colliders, but it's not like any game physics system
|
||||
// resolves these sort of things well anyway.
|
||||
//
|
||||
// At the very least, we don't do things that result in glitchy
|
||||
// velocities or entirely broken position snapping.
|
||||
let mut tgt_pos = pos.0 + pos_delta;
|
||||
|
@ -23,7 +23,7 @@ pub enum DebugShape {
|
||||
|
||||
impl DebugShape {
|
||||
pub fn mesh(&self) -> Mesh<DebugVertex> {
|
||||
use core::f32::consts::PI;
|
||||
use core::f32::consts::{PI, TAU};
|
||||
let mut mesh = Mesh::new();
|
||||
let tri = |x: Vec3<f32>, y: Vec3<f32>, z: Vec3<f32>| {
|
||||
Tri::<DebugVertex>::new(x.into(), y.into(), z.into())
|
||||
@ -42,8 +42,7 @@ impl DebugShape {
|
||||
for i in 0..SUBDIVISIONS {
|
||||
// dot on circle edge
|
||||
let to = |n: u8| {
|
||||
const FULL: f32 = 2.0 * PI;
|
||||
let angle = FULL * f32::from(n) / f32::from(SUBDIVISIONS);
|
||||
let angle = TAU * f32::from(n) / f32::from(SUBDIVISIONS);
|
||||
|
||||
Vec3::new(radius * angle.cos(), radius * angle.sin(), 0.0)
|
||||
};
|
||||
@ -80,8 +79,7 @@ impl DebugShape {
|
||||
for i in from..to {
|
||||
// dot on circle edge
|
||||
let to = |n: u8| {
|
||||
const FULL: f32 = 2.0 * PI;
|
||||
let angle = offset + FULL * f32::from(n) / f32::from(TOTAL);
|
||||
let angle = offset + TAU * f32::from(n) / f32::from(TOTAL);
|
||||
let (x, y) = (radius * angle.cos(), radius * angle.sin());
|
||||
let to_edge = Vec3::new(x, y, 0.0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user