Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. on enter frame:
  2. if a card is animating:
  3. move it further towards its destination;
  4. continue;
  5. else (if it is done animating):
  6. process as usual;
  7. end;
  8. end;
  9.  
  10. (in degrees) rotation = lerp(0, 1440, percent) //spins card 4 times while landing
  11.  
  12. currentPosition = lerp(start, end, percent) == (start + (percent * (end - start)))
  13.  
  14. float3 QuadraticBasis(float t)
  15. {
  16. float invT = 1.0f - t;
  17. return float3(invT * invT, 2.0f * t * invT, t * t);
  18. }
  19. float3 QuadraticBezier(float3 input[3], float percent)
  20. {
  21. float3 basis = QuadraticBasis(percent);
  22. return (input[0] * basis.x + input[1] * basis.y + input[2] * basis.z);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement