pub fn stippled_arrow(
        &mut self,
        a: Vec2<f32>, b: Vec2<f32>,
        width: f32, stipple_length: f32, stipple_spacing: f32, 
        arrow_size: f32,
        color: Color
    ) {
        self.push_state_cmd(StateCmd::TextureChange(SamplerId::Solid));

        let width = width / 2.0;
        let arrow_size = arrow_size / 2.0;
        let tangent = (b - a).normalize();
        let normal = tangent.left();
        let uv = Vec2::ZERO;

        // Line
        self.stippled_line(a, b - tangent*arrow_size, width, stipple_length, stipple_spacing, color);
        // Arrow head
        self.add_vertices(&[
            Vert { pos: b - tangent*arrow_size - normal*(0.3 * arrow_size), uv, color },
            Vert { pos: b - tangent*arrow_size + normal*(0.3 * arrow_size), uv, color },
            Vert { pos: b, uv, color },
        ]);
    }
/// Generates vertices for a line with a arrowhead at `b`.
Generates vertices for a line with a arrowhead at `b`.
Generates vertices for a line with a arrowhead at ` b ` .
pub fn stippled_arrow(
        &mut self,
        a: Vec2<f32>, b: Vec2<f32>,
        width: f32, stipple_length: f32, stipple_spacing: f32, 
        arrow_size: f32,
        color: Color
    ) {
        self.push_state_cmd(StateCmd::TextureChange(SamplerId::Solid));
        let width = width / 2.0;
        let arrow_size = arrow_size / 2.0;
        let tangent = (b - a).normalize();
        let normal = tangent.left();
        let uv = Vec2::ZERO;
        // Line
        self.stippled_line(a, b - tangent*arrow_size, width, stipple_length, stipple_spacing, color);
        // Arrow head
        self.add_vertices(&[
            Vert { pos: b - tangent*arrow_size - normal*(0.3 * arrow_size), uv, color },
            Vert { pos: b - tangent*arrow_size + normal*(0.3 * arrow_size), uv, color },
            Vert { pos: b, uv, color },
        ]);
    }
pub fn stippled_arrow ( & mut self , a : Vec2 < f32 > , b : Vec2 < f32 > , width : f32 , stipple_length : f32 , stipple_spacing : f32 , arrow_size : f32 , color : Color ) { self . push_state_cmd ( StateCmd :: TextureChange ( SamplerId :: Solid ) ) ; let width = width / 2.0 ; let arrow_size = arrow_size / 2.0 ; let tangent = ( b - a ) . normalize ( ) ; let normal = tangent . left ( ) ; let uv = Vec2 :: ZERO ; // Line self . stippled_line ( a , b - tangent * arrow_size , width , stipple_length , stipple_spacing , color ) ; // Arrow head self . add_vertices ( & [ Vert { pos : b - tangent * arrow_size - normal * ( 0.3 * arrow_size ) , uv , color } , Vert { pos : b - tangent * arrow_size + normal * ( 0.3 * arrow_size ) , uv , color } , Vert { pos : b , uv , color } , ] ) ; }
Generates vertices for a line with a arrowhead at `b`.
Generates vertices for a line with a arrowhead at ` b ` .
&mut self
a
Vec2<f32>
b
Vec2<f32>
width
f32
stipple_length
f32
stipple_spacing
f32
arrow_size
f32
color
Color
&mut self
a
Vec2<f32>
b
Vec2<f32>
width
f32
stipple_length
f32
stipple_spacing
f32
arrow_size
f32
color
Color