9
3

normal.inl 271 B

123456789101112131415
  1. /// @ref gtx_normal
  2. namespace glm
  3. {
  4. template<typename T, qualifier Q>
  5. GLM_FUNC_QUALIFIER vec<3, T, Q> triangleNormal
  6. (
  7. vec<3, T, Q> const& p1,
  8. vec<3, T, Q> const& p2,
  9. vec<3, T, Q> const& p3
  10. )
  11. {
  12. return normalize(cross(p1 - p2, p1 - p3));
  13. }
  14. }//namespace glm