diff --git a/doc/glm.tex b/doc/glm.tex index 8f20ff25..09acb8f3 100644 --- a/doc/glm.tex +++ b/doc/glm.tex @@ -1302,36 +1302,22 @@ Such behavior follows the precedent set by C and C++'s standard library, in that \begin{cppcode} #include // vec3 normalize cross +#include // fastNormalize -glm::vec3 computeNormal -( - glm::vec3 const & a, - glm::vec3 const & b, - glm::vec3 const & c -) +using glm::vec3; + +vec3 triNormal(vec3 const & a, vec3 const & b, vec3 const & c) { return glm::normalize(glm::cross(c - a, b - a)); } -\end{cppcode} -\begin{cppcode} // A faster (but less accurate) alternative: -#include // vec3 cross -#include // fastNormalize - -glm::vec3 computeNormal -( - glm::vec3 const & a, - glm::vec3 const & b, - glm::vec3 const & c -) +vec3 fastTriNormal(vec3 const & a, vec3 const & b, vec3 const & c) { return glm::fastNormalize(glm::cross(c - a, b - a)); } \end{cppcode} - - \subsection{Matrix Transformations} \begin{cppcode}