Hit.h 891 B

12345678910111213141516171819202122232425262728293031
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Alec Jacobson <[email protected]>
  4. // 2014 Christian Schüller <[email protected]>
  5. //
  6. // This Source Code Form is subject to the terms of the Mozilla Public License
  7. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  8. // obtain one at http://mozilla.org/MPL/2.0/.
  9. #ifndef IGL_HIT_H
  10. #define IGL_HIT_H
  11. namespace igl
  12. {
  13. /// Reimplementation of the embree::Hit struct from embree1.0
  14. ///
  15. template <typename Scalar>
  16. struct Hit
  17. {
  18. /// primitive id
  19. int id;
  20. /// geometry id (not used)
  21. int gid;
  22. /// barycentric coordinates so that
  23. /// pos = V.row(F(id,0))*(1-u-v)+V.row(F(id,1))*u+V.row(F(id,2))*v;
  24. Scalar u,v;
  25. /// parametric distance so that
  26. /// pos = origin + t * dir
  27. Scalar t;
  28. };
  29. }
  30. #endif