1 #ifndef LVR2_RAYCASTING_INTERSECTION_HPP 2 #define LVR2_RAYCASTING_INTERSECTION_HPP 102 template<
typename ...Tp>
106 static constexpr std::size_t N =
sizeof...(Tp);
110 template <
typename T,
typename Tuple>
113 template <
typename T>
116 template <
typename T,
typename U,
typename... Ts>
120 template <
typename T,
typename... Ts>
121 struct has_type<T, std::tuple<T, Ts...>> : std::true_type {};
137 static constexpr
bool has() {
158 template<
typename ...T>
162 os <<
"Raycaster Intersection: \n";
164 if constexpr(IntT::template has<lvr2::intelem::Point>())
166 os <<
"-- point: " << intersection.point.transpose() <<
"\n";
169 if constexpr(IntT::template has<lvr2::intelem::Distance>())
171 os <<
"-- dist: " << intersection.dist <<
"\n";
174 if constexpr(IntT::template has<lvr2::intelem::Normal>())
176 os <<
"-- normal: " << intersection.normal.transpose() <<
"\n";
179 if constexpr(IntT::template has<lvr2::intelem::Face>())
181 os <<
"-- face: " << intersection.face_id <<
"\n";
184 if constexpr(IntT::template has<lvr2::intelem::Barycentrics>())
186 os <<
"-- barycentrics: " << intersection.b_uv.transpose() <<
"\n";
189 if constexpr(IntT::template has<lvr2::intelem::Mesh>())
191 os <<
"-- mesh: " << intersection.mesh_id <<
"\n";
197 #endif // LVR2_RAYCASTING_INTERSECTION_HPP std::ostream & operator<<(std::ostream &os, const BaseVector< T > &v)
Barycentric coordinates of the intersection point.
Raycaster should compute the normal of the intersected face flipped towards the ray.
CRTP Container for User defined intersection elements.
Intersection distance(float)
Intersection point (x,y,z)
Eigen::Vector3f Vector3f
Eigen 3D vector, single precision.
std::tuple< Tp... > elems
static constexpr bool has()
Check if Intersection container has a specific intelem (lvr2::intelem).
Eigen::Vector2f Vector2f
Eigen 2D vector, single precision.
Receive the intersected Mesh. TODO.
Intersection face as uint id.