aboutsummaryrefslogtreecommitdiff
path: root/src/pipeline/debug_render_pipeline
diff options
context:
space:
mode:
Diffstat (limited to 'src/pipeline/debug_render_pipeline')
-rw-r--r--src/pipeline/debug_render_pipeline/debug_render_backend.rs10
-rw-r--r--src/pipeline/debug_render_pipeline/debug_render_pipeline.rs9
-rw-r--r--src/pipeline/debug_render_pipeline/mod.rs2
-rw-r--r--src/pipeline/debug_render_pipeline/outlines.rs1
4 files changed, 13 insertions, 9 deletions
diff --git a/src/pipeline/debug_render_pipeline/debug_render_backend.rs b/src/pipeline/debug_render_pipeline/debug_render_backend.rs
index cddf204..664bf46 100644
--- a/src/pipeline/debug_render_pipeline/debug_render_backend.rs
+++ b/src/pipeline/debug_render_pipeline/debug_render_backend.rs
@@ -79,12 +79,10 @@ pub trait DebugRenderBackend {
self.draw_line(object, a, b, color);
}
- if closed {
- if vertices.len() > 2 {
- let a = transform * (Scale::from(*scale) * vertices[0]);
- let b = transform * (Scale::from(*scale) * vertices.last().unwrap());
- self.draw_line(object, a, b, color);
- }
+ if closed && vertices.len() > 2 {
+ let a = transform * (Scale::from(*scale) * vertices[0]);
+ let b = transform * (Scale::from(*scale) * vertices.last().unwrap());
+ self.draw_line(object, a, b, color);
}
}
}
diff --git a/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs b/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs
index 927470a..b429c90 100644
--- a/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs
+++ b/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs
@@ -41,12 +41,17 @@ impl Default for DebugRenderMode {
}
}
+#[cfg(feature = "dim2")]
+type InstancesMap = HashMap<TypeId, Vec<Point<Real>>>;
+#[cfg(feature = "dim3")]
+type InstancesMap = HashMap<TypeId, (Vec<Point<Real>>, Vec<[u32; 2]>)>;
+
/// Pipeline responsible for rendering the state of the physics engine for debugging purpose.
pub struct DebugRenderPipeline {
#[cfg(feature = "dim2")]
- instances: HashMap<TypeId, Vec<Point<Real>>>,
+ instances: InstancesMap,
#[cfg(feature = "dim3")]
- instances: HashMap<TypeId, (Vec<Point<Real>>, Vec<[u32; 2]>)>,
+ instances: InstancesMap,
/// The style used to compute the line colors for each element
/// to render.
pub style: DebugRenderStyle,
diff --git a/src/pipeline/debug_render_pipeline/mod.rs b/src/pipeline/debug_render_pipeline/mod.rs
index 104fd9f..7757344 100644
--- a/src/pipeline/debug_render_pipeline/mod.rs
+++ b/src/pipeline/debug_render_pipeline/mod.rs
@@ -5,4 +5,4 @@ pub use self::debug_render_style::{DebugColor, DebugRenderStyle};
mod debug_render_backend;
mod debug_render_pipeline;
mod debug_render_style;
-pub(self) mod outlines;
+mod outlines;
diff --git a/src/pipeline/debug_render_pipeline/outlines.rs b/src/pipeline/debug_render_pipeline/outlines.rs
index 01a441e..cd0b6ed 100644
--- a/src/pipeline/debug_render_pipeline/outlines.rs
+++ b/src/pipeline/debug_render_pipeline/outlines.rs
@@ -17,6 +17,7 @@ pub fn instances(nsubdivs: u32) -> HashMap<TypeId, Vec<Point<Real>>> {
}
#[cfg(feature = "dim3")]
+#[allow(clippy::type_complexity)]
pub fn instances(nsubdivs: u32) -> HashMap<TypeId, (Vec<Point<Real>>, Vec<[u32; 2]>)> {
let mut result = HashMap::new();
result.insert(