You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
733 B

4 years ago
  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////
  4. // Created : 2005-12-21
  5. // Updated : 2009-03-06
  6. // Licence : This source is under MIT License
  7. // File : glm/gtx/projection.inl
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. namespace glm
  10. {
  11. template <typename vecType>
  12. GLM_FUNC_QUALIFIER vecType proj
  13. (
  14. vecType const & x,
  15. vecType const & Normal
  16. )
  17. {
  18. return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal;
  19. }
  20. }//namespace glm