// render a particle and its tail
render a particle and its tail
render a particle and its tail
fn render(&self) {
        let line_length_multiplier = 8.0;
        let indicator_line_x = self.position.x + self.velocity.x * line_length_multiplier;
        let indicator_line_y = self.position.y + self.velocity.y * line_length_multiplier;
        let vel_magnitude = pythag_dist(0., 0., self.velocity.x, self.velocity.y);
        let line_color = color::hsl_to_rgb(1.8 - vel_magnitude / 6.,1.,0.5);
        draw_line(self.position.x, self.position.y, indicator_line_x, indicator_line_y, 0.5, line_color);
        // draw_line(self.position.x, self.position.y,self.position.x + 1., self.position.y + 1., 5., WHITE);
        //TODO: lil arrows lines!
        //draw_line(indicatorLineX, indicatorLineY, 0., 0., 0.5, BLACK);
        //draw_circle(self.position.x, self.position.y, 1.0, BLACK);
        // where color = BLUE, GREEN, YELLOW, ... https://docs.rs/macroquad/0.3.8/macroquad/color/index.html
        // println!("particle: ({}, {}) v: ({}, {})", particle.position.x, particle.position.y, particle.velocity.x, particle.velocity.y );
    }
fn render ( & self ) { let line_length_multiplier = 8.0 ; let indicator_line_x = self . position . x + self . velocity . x * line_length_multiplier ; let indicator_line_y = self . position . y + self . velocity . y * line_length_multiplier ; let vel_magnitude = pythag_dist ( 0. , 0. , self . velocity . x , self . velocity . y ) ; let line_color = color :: hsl_to_rgb ( 1.8 - vel_magnitude / 6. , 1. , 0.5 ) ; draw_line ( self . position . x , self . position . y , indicator_line_x , indicator_line_y , 0.5 , line_color ) ; // draw_line(self.position.x, self.position.y,self.position.x + 1., self.position.y + 1., 5., WHITE); //TODO: lil arrows lines! //draw_line(indicatorLineX, indicatorLineY, 0., 0., 0.5, BLACK); //draw_circle(self.position.x, self.position.y, 1.0, BLACK); // where color = BLUE, GREEN, YELLOW, ... https://docs.rs/macroquad/0.3.8/macroquad/color/index.html // println!("particle: ({}, {}) v: ({}, {})", particle.position.x, particle.position.y, particle.velocity.x, particle.velocity.y ); }
render a particle and its tail
render a particle and its tail
&self