Created
January 25, 2019 09:01
-
-
Save attolee/a0dc568d8dc07a3e91341715cdd391d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public static class VectorExtensions | |
{ | |
/// <summary> | |
/// 将坐标点移动四分之一个圆 | |
/// </summary> | |
/// <param name="pivot">原点</param> | |
/// <param name="before">移动前的坐标点</param> | |
/// <returns>移动后的坐标点</returns> | |
public static Vector3 MoveMinusQuarterCircle(Vector3 pivot, Vector3 before) | |
{ | |
var beforeVec = before - pivot; | |
var afterVec = beforeVec; | |
afterVec.x = -beforeVec.z; | |
afterVec.z = beforeVec.x; | |
return afterVec + pivot; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment