common: VECTOR2I-based RotatePoint()
This commit is contained in:
parent
d2c9a5d81a
commit
dc7b743782
|
@ -380,6 +380,17 @@ void RotatePoint( wxPoint* point, const wxPoint& centre, double angle )
|
|||
point->y = oy + centre.y;
|
||||
}
|
||||
|
||||
void RotatePoint( VECTOR2I& point, const VECTOR2I& centre, double angle )
|
||||
{
|
||||
wxPoint c( centre.x, centre.y );
|
||||
wxPoint p( point.x, point.y );
|
||||
|
||||
RotatePoint(&p, c, angle);
|
||||
|
||||
point.x = p.x;
|
||||
point.y = p.y;
|
||||
}
|
||||
|
||||
|
||||
void RotatePoint( double* pX, double* pY, double cx, double cy, double angle )
|
||||
{
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include <math.h>
|
||||
#include <wx/gdicmn.h> // For wxPoint
|
||||
#include <math/vector2d.h>
|
||||
|
||||
/**
|
||||
* Function IsPointOnSegment
|
||||
|
@ -78,6 +79,13 @@ inline void RotatePoint( wxPoint* point, double angle )
|
|||
RotatePoint( &point->x, &point->y, angle );
|
||||
}
|
||||
|
||||
inline void RotatePoint( VECTOR2I& point, double angle )
|
||||
{
|
||||
RotatePoint( &point.x, &point.y, angle );
|
||||
}
|
||||
|
||||
void RotatePoint( VECTOR2I& point, const VECTOR2I& centre, double angle );
|
||||
|
||||
/*
|
||||
* Calculates the new coord point point
|
||||
* for a center rotation center and angle in (1 / 10 degree)
|
||||
|
|
Loading…
Reference in New Issue