Trait rapier2d::pipeline::DebugRenderBackend
source · pub trait DebugRenderBackend {
// Required method
fn draw_line(
&mut self,
object: DebugRenderObject<'_>,
a: Point<f32>,
b: Point<f32>,
color: [f32; 4],
);
// Provided methods
fn filter_object(&self, _object: DebugRenderObject<'_>) -> bool { ... }
fn draw_polyline(
&mut self,
object: DebugRenderObject<'_>,
vertices: &[Point<f32>],
indices: &[[u32; 2]],
transform: &Isometry<f32>,
scale: &Vector<f32>,
color: [f32; 4],
) { ... }
fn draw_line_strip(
&mut self,
object: DebugRenderObject<'_>,
vertices: &[Point<f32>],
transform: &Isometry<f32>,
scale: &Vector<f32>,
color: [f32; 4],
closed: bool,
) { ... }
}
Expand description
Trait implemented by graphics backends responsible for rendering the physics scene.
The only thing that is required from the graphics backend is to be able to render
a colored line. Note that the color is only a suggestion and is computed from the
DebugRenderStyle
. The backend is free to apply its own style, for example based on
the object
being rendered.
Required Methods§
Provided Methods§
sourcefn filter_object(&self, _object: DebugRenderObject<'_>) -> bool
fn filter_object(&self, _object: DebugRenderObject<'_>) -> bool
Predicate to filter-out some objects from the debug-rendering.