Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on enter frame:
- if a card is animating:
- move it further towards its destination;
- continue;
- else (if it is done animating):
- process as usual;
- end;
- end;
- (in degrees) rotation = lerp(0, 1440, percent) //spins card 4 times while landing
- currentPosition = lerp(start, end, percent) == (start + (percent * (end - start)))
- float3 QuadraticBasis(float t)
- {
- float invT = 1.0f - t;
- return float3(invT * invT, 2.0f * t * invT, t * t);
- }
- float3 QuadraticBezier(float3 input[3], float percent)
- {
- float3 basis = QuadraticBasis(percent);
- return (input[0] * basis.x + input[1] * basis.y + input[2] * basis.z);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement