Skip to content

Instantly share code, notes, and snippets.

@yone80
Created May 26, 2016 08:26
Show Gist options
  • Save yone80/c91f78cb8fcb721ca0d10bd7e268abd2 to your computer and use it in GitHub Desktop.
Save yone80/c91f78cb8fcb721ca0d10bd7e268abd2 to your computer and use it in GitHub Desktop.
vector origin = chv('t');
vector dir = normalize( chv('dir') );
vector v = @P - origin;
float dist = dot(v, dir);
float range = ch('range');
f@falloff = fit(dist, range, 0, 0, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment