Пример #1
0
        public static void DrawRotatedPath(float aPivotX, float aPivotY, Vector2[] aPoints,
                                           float aAngleDeg, Color aColor, bool aLoop = false)
        {
            Vector2[] vertices = new Vector2[aPoints.Length];
            for (int i = 0; i < vertices.Length; i++)
            {
                vertices[i] = AntMath.RotatePointDeg(aPoints[i].x, aPoints[i].y, aPivotX, aPivotY, aAngleDeg);
            }

            DrawPath(vertices, aColor, aLoop);
        }
Пример #2
0
        public static void DrawArrow(float aX1, float aY1, float aX2, float aY2, Color aColor, float aSize = 0.5f)
        {
            Vector2 p1 = new Vector2(aX1, aY1);
            Vector2 p2 = new Vector2(aX2, aY2);
            Vector2 p3 = AntMath.RotatePointDeg(p2.x + aSize, p2.y, p2.x, p2.y, AntMath.AngleDeg(aX1, aY1, aX2, aY2) - 145f);
            Vector2 p4 = AntMath.RotatePointDeg(p2.x + aSize, p2.y, p2.x, p2.y, AntMath.AngleDeg(aX1, aY1, aX2, aY2) + 145f);

            DrawPath(new Vector2[5] {
                p1, p2, p3, p4, p2
            }, aColor);
        }