avian2d::debug_render

Trait PhysicsGizmoExt

Source
pub trait PhysicsGizmoExt {
    // Required methods
    fn draw_line(&mut self, a: Vector, b: Vector, color: Color);
    fn draw_line_strip(
        &mut self,
        points: Vec<Vector>,
        position: impl Into<Position>,
        rotation: impl Into<Rotation>,
        closed: bool,
        color: Color,
    );
    fn draw_polyline(
        &mut self,
        vertices: &[Vector],
        indices: &[[u32; 2]],
        position: impl Into<Position>,
        rotation: impl Into<Rotation>,
        color: Color,
    );
    fn draw_arrow(
        &mut self,
        a: Vector,
        b: Vector,
        head_length: Scalar,
        color: Color,
    );
    fn draw_collider(
        &mut self,
        collider: &Collider,
        position: impl Into<Position>,
        rotation: impl Into<Rotation>,
        color: Color,
    );
    fn draw_raycast(
        &mut self,
        origin: Vector,
        direction: Dir2,
        max_distance: Scalar,
        hits: &[RayHitData],
        ray_color: Color,
        point_color: Color,
        normal_color: Color,
        length_unit: Scalar,
    );
    fn draw_shapecast(
        &mut self,
        shape: &Collider,
        origin: Vector,
        shape_rotation: impl Into<Rotation>,
        direction: Dir2,
        max_distance: Scalar,
        hits: &[ShapeHitData],
        ray_color: Color,
        shape_color: Color,
        point_color: Color,
        normal_color: Color,
        length_unit: Scalar,
    );
}
Expand description

An extension trait for Gizmos<PhysicsGizmo>.

Required Methods§

Source

fn draw_line(&mut self, a: Vector, b: Vector, color: Color)

Draws a line from a to b.

Source

fn draw_line_strip( &mut self, points: Vec<Vector>, position: impl Into<Position>, rotation: impl Into<Rotation>, closed: bool, color: Color, )

Draws lines between a list of points.

Source

fn draw_polyline( &mut self, vertices: &[Vector], indices: &[[u32; 2]], position: impl Into<Position>, rotation: impl Into<Rotation>, color: Color, )

Draws a polyline based on the given vertex and index buffers.

Source

fn draw_arrow( &mut self, a: Vector, b: Vector, head_length: Scalar, color: Color, )

Draws an arrow from a to b with an arrowhead that has a length of head_length.

Source

fn draw_collider( &mut self, collider: &Collider, position: impl Into<Position>, rotation: impl Into<Rotation>, color: Color, )

Draws a Collider shape.

Source

fn draw_raycast( &mut self, origin: Vector, direction: Dir2, max_distance: Scalar, hits: &[RayHitData], ray_color: Color, point_color: Color, normal_color: Color, length_unit: Scalar, )

Draws the results of a raycast.

Source

fn draw_shapecast( &mut self, shape: &Collider, origin: Vector, shape_rotation: impl Into<Rotation>, direction: Dir2, max_distance: Scalar, hits: &[ShapeHitData], ray_color: Color, shape_color: Color, point_color: Color, normal_color: Color, length_unit: Scalar, )

Draws the results of a shapecast.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl PhysicsGizmoExt for Gizmos<'_, '_, PhysicsGizmos>

Source§

fn draw_line(&mut self, a: Vector, b: Vector, color: Color)

Draws a line from a to b.

Source§

fn draw_line_strip( &mut self, points: Vec<Vector>, position: impl Into<Position>, rotation: impl Into<Rotation>, closed: bool, color: Color, )

Draws lines between a list of points.

Source§

fn draw_polyline( &mut self, vertices: &[Vector], indices: &[[u32; 2]], position: impl Into<Position>, rotation: impl Into<Rotation>, color: Color, )

Draws a polyline based on the given vertex and index buffers.

Source§

fn draw_arrow( &mut self, a: Vector, b: Vector, head_length: Scalar, color: Color, )

Draws an arrow from a to b with an arrowhead that has a length of head_length and a width of head_width.

Source§

fn draw_collider( &mut self, collider: &Collider, position: impl Into<Position>, rotation: impl Into<Rotation>, color: Color, )

Draws a collider shape with a given position and rotation.

Source§

fn draw_raycast( &mut self, origin: Vector, direction: Dir2, max_distance: Scalar, hits: &[RayHitData], ray_color: Color, point_color: Color, normal_color: Color, length_unit: Scalar, )

Draws the results of a raycast.

Source§

fn draw_shapecast( &mut self, shape: &Collider, origin: Vector, shape_rotation: impl Into<Rotation>, direction: Dir2, max_distance: Scalar, hits: &[ShapeHitData], ray_color: Color, shape_color: Color, point_color: Color, normal_color: Color, length_unit: Scalar, )

Draws the results of a shapecast.

Implementors§