Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5c9409a

Browse files
committed
add Perp function to get the perpendicular vector of the vector parameter
1 parent 3de08b7 commit 5c9409a

File tree

1 file changed

+5
-0
lines changed
  • Assets/Scenes/CartesianPlayground

1 file changed

+5
-0
lines changed

‎Assets/Scenes/CartesianPlayground/UMath.cs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,9 @@ static public Vector3 Lerp(Vector3 a, Vector3 b, float t)
7373
Vector3 v = b - a;
7474
return a + (v * Mathf.Clamp01(t));
7575
}
76+
77+
static public Vector3 GetPerp(Vector3 v)
78+
{
79+
return new Vector3(-v.y, v.x, v.z);
80+
}
7681
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /