libigl v2.5.0
Loading...
Searching...
No Matches
ray_mesh_intersect.h
Go to the documentation of this file.
1// This file is part of libigl, a simple c++ geometry processing library.
2//
3// Copyright (C) 2016 Alec Jacobson <alecjacobson@gmail.com>
4//
5// This Source Code Form is subject to the terms of the Mozilla Public License
6// v. 2.0. If a copy of the MPL was not distributed with this file, You can
7// obtain one at http://mozilla.org/MPL/2.0/.
8#ifndef IGL_RAY_MESH_INTERSECT_H
9#define IGL_RAY_MESH_INTERSECT_H
10#include "igl_inline.h"
11#include "Hit.h"
12#include <Eigen/Core>
13#include <vector>
14namespace igl
15{
27 template <
28 typename Derivedsource,
29 typename Deriveddir,
30 typename DerivedV,
31 typename DerivedF>
33 const Eigen::MatrixBase<Derivedsource> & source,
34 const Eigen::MatrixBase<Deriveddir> & dir,
35 const Eigen::MatrixBase<DerivedV> & V,
36 const Eigen::MatrixBase<DerivedF> & F,
37 std::vector<igl::Hit> & hits);
40 template <
41 typename Derivedsource,
42 typename Deriveddir,
43 typename DerivedV,
44 typename DerivedF>
46 const Eigen::MatrixBase<Derivedsource> & source,
47 const Eigen::MatrixBase<Deriveddir> & dir,
48 const Eigen::MatrixBase<DerivedV> & V,
49 const Eigen::MatrixBase<DerivedF> & F,
50 igl::Hit & hit);
51
52 // Explicit function to check one triangle (given by index f) of the mesh.
53 // This function is used by ray_mesh_intersect to check each triangle.
54 // Outputs:
55 // hit hit with the given triangle, set only if it exists
56 // Returns true if there was a hit
57 template <
58 typename Derivedsource,
59 typename Deriveddir,
60 typename DerivedV,
61 typename DerivedF>
63 const Eigen::MatrixBase<Derivedsource> & source,
64 const Eigen::MatrixBase<Deriveddir> & dir,
65 const Eigen::MatrixBase<DerivedV> & V,
66 const Eigen::MatrixBase<DerivedF> & F,
67 const int f,
68 igl::Hit& hit);
69}
70#ifndef IGL_STATIC_LIBRARY
71# include "ray_mesh_intersect.cpp"
72#endif
73#endif
#define IGL_INLINE
Definition igl_inline.h:15
Definition AABB.h:17
bool ray_mesh_intersect(const Eigen::MatrixBase< Derivedsource > &source, const Eigen::MatrixBase< Deriveddir > &dir, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, std::vector< igl::Hit > &hits)
Shoot a ray against a mesh (V,F) and collect all hits.
bool ray_triangle_intersect(const Eigen::MatrixBase< Derivedsource > &source, const Eigen::MatrixBase< Deriveddir > &dir, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, const int f, igl::Hit &hit)
Reimplementation of the embree::Hit struct from embree1.0.
Definition Hit.h:18