pub fn circle(&mut self, pos: Vec2<f32>, radius: f32, color: Color) {
        self.push_state_cmd(StateCmd::TextureChange(SamplerId::Solid)); 
        let uv = Vec2::ZERO;

        for i in 0..(SIN_COS.len() - 1) {
            let a = SIN_COS[i];
            let b = SIN_COS[i + 1];

            self.add_vertices(&[
                Vert { pos: pos, uv, color },
                Vert { pos: pos + Vec2::new(a.x, a.y)*radius, uv, color },
                Vert { pos: pos + Vec2::new(b.x, b.y)*radius, uv, color },

                Vert { pos: pos, uv, color },
                Vert { pos: pos + Vec2::new(-a.x, a.y)*radius, uv, color },
                Vert { pos: pos + Vec2::new(-b.x, b.y)*radius, uv, color },

                Vert { pos: pos, uv, color },
                Vert { pos: pos + Vec2::new(a.x, -a.y)*radius, uv, color },
                Vert { pos: pos + Vec2::new(b.x, -b.y)*radius, uv, color },

                Vert { pos: pos, uv, color },
                Vert { pos: pos + Vec2::new(-a.x, -a.y)*radius, uv, color },
                Vert { pos: pos + Vec2::new(-b.x, -b.y)*radius, uv, color },
            ]);
        }
    }
/// Generates the vertices for a circle with the given radius centered at the given position
Generates the vertices for a circle with the given radius centered at the given position
Generates the vertices for a circle with the given radius centered at the given position
pub fn circle(&mut self, pos: Vec2<f32>, radius: f32, color: Color) {
        self.push_state_cmd(StateCmd::TextureChange(SamplerId::Solid)); 
        let uv = Vec2::ZERO;
        for i in 0..(SIN_COS.len() - 1) {
            let a = SIN_COS[i];
            let b = SIN_COS[i + 1];
            self.add_vertices(&[
                Vert { pos: pos, uv, color },
                Vert { pos: pos + Vec2::new(a.x, a.y)*radius, uv, color },
                Vert { pos: pos + Vec2::new(b.x, b.y)*radius, uv, color },
                Vert { pos: pos, uv, color },
                Vert { pos: pos + Vec2::new(-a.x, a.y)*radius, uv, color },
                Vert { pos: pos + Vec2::new(-b.x, b.y)*radius, uv, color },
                Vert { pos: pos, uv, color },
                Vert { pos: pos + Vec2::new(a.x, -a.y)*radius, uv, color },
                Vert { pos: pos + Vec2::new(b.x, -b.y)*radius, uv, color },
                Vert { pos: pos, uv, color },
                Vert { pos: pos + Vec2::new(-a.x, -a.y)*radius, uv, color },
                Vert { pos: pos + Vec2::new(-b.x, -b.y)*radius, uv, color },
            ]);
        }
    }
pub fn circle ( & mut self , pos : Vec2 < f32 > , radius : f32 , color : Color ) { self . push_state_cmd ( StateCmd :: TextureChange ( SamplerId :: Solid ) ) ; let uv = Vec2 :: ZERO ; for i in 0 .. ( SIN_COS . len ( ) - 1 ) { let a = SIN_COS [ i ] ; let b = SIN_COS [ i + 1 ] ; self . add_vertices ( & [ Vert { pos : pos , uv , color } , Vert { pos : pos + Vec2 :: new ( a . x , a . y ) * radius , uv , color } , Vert { pos : pos + Vec2 :: new ( b . x , b . y ) * radius , uv , color } , Vert { pos : pos , uv , color } , Vert { pos : pos + Vec2 :: new ( - a . x , a . y ) * radius , uv , color } , Vert { pos : pos + Vec2 :: new ( - b . x , b . y ) * radius , uv , color } , Vert { pos : pos , uv , color } , Vert { pos : pos + Vec2 :: new ( a . x , - a . y ) * radius , uv , color } , Vert { pos : pos + Vec2 :: new ( b . x , - b . y ) * radius , uv , color } , Vert { pos : pos , uv , color } , Vert { pos : pos + Vec2 :: new ( - a . x , - a . y ) * radius , uv , color } , Vert { pos : pos + Vec2 :: new ( - b . x , - b . y ) * radius , uv , color } , ] ) ; } }
Generates the vertices for a circle with the given radius centered at the given position
Generates the vertices for a circle with the given radius centered at the given position
&mut self
pos
Vec2<f32>
radius
f32
color
Color
&mut self
pos
Vec2<f32>
radius
f32
color
Color