Trait jumpy::core::physics::rapier::DebugRenderBackend

pub trait DebugRenderBackend {
    // Required method
    fn draw_line(
        &mut self,
        object: DebugRenderObject<'_>,
        a: OPoint<f32, Const<2>>,
        b: OPoint<f32, Const<2>>,
        color: [f32; 4],
    );

    // Provided methods
    fn filter_object(&self, _object: DebugRenderObject<'_>) -> bool { ... }
    fn draw_polyline(
        &mut self,
        object: DebugRenderObject<'_>,
        vertices: &[OPoint<f32, Const<2>>],
        indices: &[[u32; 2]],
        transform: &Isometry<f32, Unit<Complex<f32>>, 2>,
        scale: &Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>,
        color: [f32; 4],
    ) { ... }
    fn draw_line_strip(
        &mut self,
        object: DebugRenderObject<'_>,
        vertices: &[OPoint<f32, Const<2>>],
        transform: &Isometry<f32, Unit<Complex<f32>>, 2>,
        scale: &Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>,
        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§

fn draw_line( &mut self, object: DebugRenderObject<'_>, a: OPoint<f32, Const<2>>, b: OPoint<f32, Const<2>>, color: [f32; 4], )

Draws a colored line.

Note that this method can be called multiple time for the same object.

Provided Methods§

fn filter_object(&self, _object: DebugRenderObject<'_>) -> bool

Predicate to filter-out some objects from the debug-rendering.

fn draw_polyline( &mut self, object: DebugRenderObject<'_>, vertices: &[OPoint<f32, Const<2>>], indices: &[[u32; 2]], transform: &Isometry<f32, Unit<Complex<f32>>, 2>, scale: &Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, color: [f32; 4], )

Draws a set of line.

fn draw_line_strip( &mut self, object: DebugRenderObject<'_>, vertices: &[OPoint<f32, Const<2>>], transform: &Isometry<f32, Unit<Complex<f32>>, 2>, scale: &Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, color: [f32; 4], closed: bool, )

Draws a chain of line.

Implementors§