Skip to content

Commit fc101ed

Browse files
committed
missing docs
1 parent 29b26f7 commit fc101ed

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

crates/bevy_debug_draw/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,12 @@ impl DebugDraw {
206206
self.ray(start.extend(0.), vector.extend(0.), color);
207207
}
208208

209+
// Draw a circle.
209210
pub fn circle_2d(&mut self, position: Vec2, radius: f32, color: Color) {
210211
self.circle(position.extend(0.), Vec3::Z, radius, color);
211212
}
212213

213-
/// Draw a rectangle at `position`.
214+
/// Draw a rectangle.
214215
pub fn rect_2d(&mut self, position: Vec2, rotation: f32, size: Vec2, color: Color) {
215216
self.rect(
216217
position.extend(0.),
@@ -220,11 +221,13 @@ impl DebugDraw {
220221
);
221222
}
222223

224+
/// Clear everything drawn up to this point, this frame.
223225
pub fn clear(&mut self) {
224226
self.positions.clear();
225227
self.colors.clear();
226228
}
227229

230+
/// Take the positions and colors data from `self` and overwrite the `mesh`'s vertex positions and colors.
228231
pub fn update_mesh(&mut self, mesh: &mut Mesh) {
229232
mesh.insert_attribute(
230233
Mesh::ATTRIBUTE_POSITION,

crates/bevy_debug_draw/src/pipeline_2d.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,11 @@ pub(crate) struct DebugLinePipeline {
2323
mesh_pipeline: Mesh2dPipeline,
2424
shader: Handle<Shader>,
2525
}
26+
2627
impl FromWorld for DebugLinePipeline {
2728
fn from_world(render_world: &mut World) -> Self {
2829
DebugLinePipeline {
29-
mesh_pipeline: render_world
30-
.get_resource::<Mesh2dPipeline>()
31-
.unwrap()
32-
.clone(),
30+
mesh_pipeline: render_world.resource::<Mesh2dPipeline>().clone(),
3331
shader: SHADER_HANDLE.typed(),
3432
}
3533
}

crates/bevy_debug_draw/src/pipeline_3d.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub(crate) struct DebugLinePipeline {
2828
impl FromWorld for DebugLinePipeline {
2929
fn from_world(render_world: &mut World) -> Self {
3030
DebugLinePipeline {
31-
mesh_pipeline: render_world.get_resource::<MeshPipeline>().unwrap().clone(),
31+
mesh_pipeline: render_world.resource::<MeshPipeline>().clone(),
3232
shader: SHADER_HANDLE.typed(),
3333
}
3434
}

0 commit comments

Comments
 (0)