I would form it like the following...
In entity think
Isnt Entity In radius?
NewOrigin = Origin One + Entity Left/Right Vector
MoveToNewOrigin
Else
RotatePointByAngle
MoveToOrigin
Here is the function RotatePointByAngle
You just need to rephrase the code to pawn language.
PHP Code:
POINT rotate_point(float cx,float cy,float angle,POINT p)
{
float s = sin(angle);
float c = cos(angle);
// translate point back to origin:
p.x -= cx;
p.y -= cy;
// rotate point
float xnew = p.x * c - p.y * s;
float ynew = p.x * s + p.y * c;
// translate point back:
p.x = xnew + cx;
p.y = ynew + cy;
return p;
}
__________________