Skip to content

Instantly share code, notes, and snippets.

@togi
Created August 13, 2014 17:18
Show Gist options
  • Save togi/2593a6e24ad06d0aa534 to your computer and use it in GitHub Desktop.
Save togi/2593a6e24ad06d0aa534 to your computer and use it in GitHub Desktop.
float calculateDegrees(const glm::vec3 prev, const glm::vec3 curr, const glm::vec3 next) {
const glm::vec3 f_1 = glm::normalize(next - curr);
const glm::vec3 f_2 = glm::normalize(curr - prev);
return glm::angle(f_1, f_2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment