Advertisement
Eonirr

Untitled

Feb 19th, 2024
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. Vector3 GetBezierPosition(float t)
  2. {
  3. Vector3 p0 = transformBegin.position;
  4. Vector3 p1 = p0+transformBegin.forward;
  5. Vector3 p3 = transformEnd.position;
  6. Vector3 p2 = p3-transformEnd.back;
  7.  
  8. return Mathf.Pow(1f-t,3f)*p0+3f*Mathf.Pow(1f-t,2f)*t*p1+3f*(1f-t)*Mathf.Pow(t,2f)*p2+Mathf.Pow(t,3f)*p3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement