티스토리 뷰

    public Vector3 GetArcPoint(Vector3 startPos, Vector3 targetPos)
    {
        Vector3 directionVector = targetPos - startPos;
        Vector3 perpendicularDirection = new Vector3(directionVector.y, -directionVector.x).normalized * (directionVector.magnitude * 0.3f);
        if ((perpendicularDirection.y < 0))
        {
            perpendicularDirection *= -1;
        }
        return startPos + (directionVector * 0.5f) + perpendicularDirection;
    }

 

 

 

댓글
최근에 올라온 글
Total
Today
Yesterday
TAG
more
«   2025/01   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31