3 // line::line(Coord start_x, Coord start_y, Coord end_x, Coord end_y)
11 // projection_x = fabs ( - end_x + start_x );
12 // projection_y = fabs ( - end_y + start_y );
14 // length = sqrt ( pow ( projection_x, 2 ) +
15 // pow ( projection_y, 2 )
18 // rotation = atan(projection_y / projection_x) - fast_math::pi/2;
31 line::line(Coord start_x
, Coord start_y
, Angle rot
, Length len
) : displayed_obj() {
38 projection_x
= length
* cos (rotation
);
39 projection_y
= length
* sin (rotation
);
53 static double toDegrees
= fast_math::pi2
/ 360;
54 // static GLfloat depth = -5.5f;
58 glColor3f(1.0,1.0,1.0);
60 glTranslatef(s_x
, s_y
, 0);
61 glRotated(rotation
/ toDegrees
, 0.0f
, 0.0f
, 1.0f
);
64 glVertex2f( 0, length
);
75 void line::calculate()
77 /// @todo implement me