Skip to content

Instantly share code, notes, and snippets.

@markhc
Created May 15, 2016 23:02
Show Gist options
  • Save markhc/e247f71751ad843d48ce2b84deb30568 to your computer and use it in GitHub Desktop.
Save markhc/e247f71751ad843d48ce2b84deb30568 to your computer and use it in GitHub Desktop.
bool PerformStep(
QAngle src,
QAngle dst,
float maxStep,
SourceSDK::QAngle &res)
{
Vector delta = dst - src;
res = src;
if(delta.Length() > maxStep) {
res += (delta.Normalized() * maxStep);
return false;
} else {
res = dst;
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment