extend.inl 901 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /// @ref gtx_extend
  2. namespace glm
  3. {
  4. template<typename genType>
  5. GLM_FUNC_QUALIFIER genType extend
  6. (
  7. genType const& Origin,
  8. genType const& Source,
  9. genType const& Distance
  10. )
  11. {
  12. return Origin + (Source - Origin) * Distance;
  13. }
  14. template<typename T, qualifier Q>
  15. GLM_FUNC_QUALIFIER vec<2, T, Q> extend
  16. (
  17. vec<2, T, Q> const& Origin,
  18. vec<2, T, Q> const& Source,
  19. T const& Distance
  20. )
  21. {
  22. return Origin + (Source - Origin) * Distance;
  23. }
  24. template<typename T, qualifier Q>
  25. GLM_FUNC_QUALIFIER vec<3, T, Q> extend
  26. (
  27. vec<3, T, Q> const& Origin,
  28. vec<3, T, Q> const& Source,
  29. T const& Distance
  30. )
  31. {
  32. return Origin + (Source - Origin) * Distance;
  33. }
  34. template<typename T, qualifier Q>
  35. GLM_FUNC_QUALIFIER vec<4, T, Q> extend
  36. (
  37. vec<4, T, Q> const& Origin,
  38. vec<4, T, Q> const& Source,
  39. T const& Distance
  40. )
  41. {
  42. return Origin + (Source - Origin) * Distance;
  43. }
  44. }//namespace glm