Advertisement
Guest User

Untitled

a guest
Mar 5th, 2015
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. float smoothstep(float edge0, float edge1, float x)
  2. {
  3. // Scale, bias and saturate x to 0..1 range
  4. x = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
  5. // Evaluate polynomial
  6. return x*x*(3 - 2 * x);
  7. }
  8.  
  9. #include <math.h>
  10. #include <cmath>
  11. #include <algorithm>
  12.  
  13. float linearIntepolate(float currentLocation, float Goal, float time){
  14.  
  15. return (1 - time) * currentLocation + time * Goal;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement