Skip to content

Commit c6b7fca

Browse files
committed
hmm
1 parent fc101ed commit c6b7fca

File tree

1 file changed

+5
-7
lines changed
  • crates/bevy_debug_draw/src

1 file changed

+5
-7
lines changed

crates/bevy_debug_draw/src/lib.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,11 @@ impl DebugDraw {
134134
let rotation = Quat::from_rotation_arc(Vec3::Z, normal);
135135
self.positions
136136
.extend((0..self.circle_segments).into_iter().flat_map(|i| {
137-
let angle = i as f32 * TAU / self.circle_segments as f32;
137+
let mut angle = i as f32 * TAU / self.circle_segments as f32;
138+
let start = rotation * (Vec2::from(angle.sin_cos()) * radius).extend(0.) + position;
138139

139-
let (y, x) = angle.sin_cos();
140-
let start = rotation * Vec3::new(x, y, 0.) * radius + position;
141-
142-
let (y, x) = (angle + TAU / self.circle_segments as f32).sin_cos();
143-
let end = rotation * Vec3::new(x, y, 0.) * radius + position;
140+
angle += TAU / self.circle_segments as f32;
141+
let end = rotation * (Vec2::from(angle.sin_cos()) * radius).extend(0.) + position;
144142

145143
[start.to_array(), end.to_array()]
146144
}));
@@ -276,7 +274,7 @@ pub(crate) fn update(
276274
}
277275
}
278276

279-
/// Move the DebugDrawMesh marker Component to the render context.
277+
/// Move the DebugDrawMesh marker Component and the DebugDrawConfig Resource to the render context.
280278
pub(crate) fn extract(
281279
mut commands: Commands,
282280
query: Extract<Query<Entity, With<DebugDrawMesh>>>,

0 commit comments

Comments
 (0)