// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <simgear/compiler.h>
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/math/polar3d.hxx>
#include <simgear/compiler.h>
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/math/polar3d.hxx>
- _location.left = _center.x - (get_width() / 2) + get_x();
- _location.right = _center.x + (get_width() / 2) + get_x();
- _location.bottom = _center.y - (get_height() / 2) + get_y();
- _location.top = _center.y + (get_height() / 2) + get_y();
+ _left = _center.x - (_w / 2) + _x;
+ _right = _center.x + (_w / 2) + _x;
+ _bottom = _center.y - (_h / 2) + _y;
+ _top = _center.y + (_h / 2) + _y;
- bool p1Inside = (p1[0] >= _location.left && p1[0] <= _location.right
- && p1[1] >= _location.bottom && p1[1] <= _location.top);
+ bool p1Inside = (p1[0] >= _left && p1[0] <= _right
+ && p1[1] >= _bottom && p1[1] <= _top);
- bool p2Inside = (p2[0] >= _location.left && p2[0] <= _location.right
- && p2[1] >= _location.bottom && p2[1] <= _location.top);
+ bool p2Inside = (p2[0] >= _left && p2[0] <= _right
+ && p2[1] >= _bottom && p2[1] <= _top);
- } else if (m[0] > _location.right) {
- m[0] = _location.right;
- m[1] = slope * (_location.right - v[0]) + v[1];
+ } else if (m[0] > _right) {
+ m[0] = _right;
+ m[1] = slope * (_right - v[0]) + v[1];
- bool pointsInvalid = (v[1] > _location.top && m[1] > _location.top) ||
- (v[1] < _location.bottom && m[1] < _location.bottom) ||
- (v[0] > _location.right && m[0] > _location.right) ||
- (v[0] < _location.left && m[0] < _location.left);
+ bool pointsInvalid = (v[1] > _top && m[1] > _top) ||
+ (v[1] < _bottom && m[1] < _bottom) ||
+ (v[0] > _right && m[0] > _right) ||
+ (v[0] < _left && m[0] < _left);
- double y1 = slope * _location.left + b;
- double y2 = slope * _location.right + b;
- double x1 = (_location.bottom - b) / slope;
- double x2 = (_location.top - b) / slope;
+ double y1 = slope * _left + b;
+ double y2 = slope * _right + b;
+ double x1 = (_bottom - b) / slope;
+ double x2 = (_top - b) / slope;
glRotated(theta, 0.0, 0.0, 1.0);
glTranslated(0.0, _arrow_radius, 0.0);
glScaled(_arrow_scale, _arrow_scale, 0.0);
glRotated(theta, 0.0, 0.0, 1.0);
glTranslated(0.0, _arrow_radius, 0.0);
glScaled(_arrow_scale, _arrow_scale, 0.0);