inline void DrawBoundingBox (UCanvas* Canvas, APawn* Target)
{
FVector X,Y,Z,D,E,top,bottom;;
float width, Left, Right, Top, Bot;
GetAxes(MyCameraRotation,X,Y,Z);
D.X = Target->Location.X - MyCameraLocation.X;
D.Y = Target->Location.Y - MyCameraLocation.Y;
D.Z = Target->Location.Z - MyCameraLocation.Z;
if(Dot(D,X) <= cos(90 * 3.14159265 / 180))
return;
FBoxSphereBounds Player = Target->Mesh->Bounds;
top = Target->Location;
top = WorldToScreen(Canvas,top);
bottom = Player.BoxExtent;
bottom = WorldToScreen(Canvas,bottom);
width = ((top.Y - bottom.Y) / 3);
Left = top.X + width;
Right = top.X - width;
Top = top.Y;
Bot = bottom.Y;
Canvas->Draw2DLine(Left, Top, Left, Bot, Green);
Canvas->Draw2DLine(Left, Bot, Right, Bot, Green);
Canvas->Draw2DLine(Right, Bot, Right, Top, Green);
Canvas->Draw2DLine(Right, Top, Left, Top, Green);
}