libigl v2.5.0
Loading...
Searching...
No Matches
ray_box_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) 2015 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_BOX_INTERSECT_H
9#define IGL_RAY_BOX_INTERSECT_H
10#include "igl_inline.h"
11#include <Eigen/Core>
12#include <Eigen/Geometry>
13namespace igl
14{
26 template <
27 typename Derivedsource,
28 typename Deriveddir,
29 typename Scalar>
31 const Eigen::MatrixBase<Derivedsource> & source,
32 const Eigen::MatrixBase<Deriveddir> & dir,
33 const Eigen::AlignedBox<Scalar,3> & box,
34 const Scalar & t0,
35 const Scalar & t1,
36 Scalar & tmin,
37 Scalar & tmax);
40 template <
41 typename Derivedsource,
42 typename Deriveddir,
43 typename Scalar>
45 const Eigen::MatrixBase<Derivedsource> & source,
46 const Eigen::MatrixBase<Deriveddir> & inv_dir,
47 const Eigen::MatrixBase<Deriveddir> & inv_dir_pad,
48 const Eigen::AlignedBox<Scalar,3> & box,
49 const Scalar & t0,
50 const Scalar & t1,
51 Scalar & tmin,
52 Scalar & tmax);
53}
54#ifndef IGL_STATIC_LIBRARY
55# include "ray_box_intersect.cpp"
56#endif
57#endif
#define IGL_INLINE
Definition igl_inline.h:15
Definition AABB.h:17
bool ray_box_intersect(const Eigen::MatrixBase< Derivedsource > &source, const Eigen::MatrixBase< Deriveddir > &dir, const Eigen::AlignedBox< Scalar, 3 > &box, const Scalar &t0, const Scalar &t1, Scalar &tmin, Scalar &tmax)
Determine whether a ray origin+t*dir and box intersect within the ray's parameterized range (t0,...