Tony-LunarG | b0b195d | 2015-05-13 15:01:06 -0600 | [diff] [blame] | 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
| 2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) |
| 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
| 4 | // Created : 2005-12-21 |
| 5 | // Updated : 2011-06-07 |
| 6 | // Licence : This source is under MIT License |
| 7 | // File : glm/gtx/normal.inl |
| 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
| 9 | |
| 10 | namespace glm |
| 11 | { |
| 12 | template <typename T, precision P> |
| 13 | GLM_FUNC_QUALIFIER detail::tvec3<T, P> triangleNormal |
| 14 | ( |
| 15 | detail::tvec3<T, P> const & p1, |
| 16 | detail::tvec3<T, P> const & p2, |
| 17 | detail::tvec3<T, P> const & p3 |
| 18 | ) |
| 19 | { |
| 20 | return normalize(cross(p1 - p2, p1 - p3)); |
| 21 | } |
| 22 | }//namespace glm |