File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
crates/bevy_debug_draw/src Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -134,13 +134,11 @@ impl DebugDraw {
134
134
let rotation = Quat :: from_rotation_arc ( Vec3 :: Z , normal) ;
135
135
self . positions
136
136
. 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;
138
139
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;
144
142
145
143
[ start. to_array ( ) , end. to_array ( ) ]
146
144
} ) ) ;
@@ -276,7 +274,7 @@ pub(crate) fn update(
276
274
}
277
275
}
278
276
279
- /// Move the DebugDrawMesh marker Component to the render context.
277
+ /// Move the DebugDrawMesh marker Component and the DebugDrawConfig Resource to the render context.
280
278
pub ( crate ) fn extract (
281
279
mut commands : Commands ,
282
280
query : Extract < Query < Entity , With < DebugDrawMesh > > > ,
You can’t perform that action at this time.
0 commit comments