Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector3 GetBezierPosition(float t)
- {
- Vector3 p0 = transformBegin.position;
- Vector3 p1 = p0+transformBegin.forward;
- Vector3 p3 = transformEnd.position;
- Vector3 p2 = p3-transformEnd.back;
- 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