Lagrange
Loading...
Searching...
No Matches
HitBaseN< N > Struct Template Reference

Shared base struct for multi-ray and multi-point hits. More...

#include <lagrange/raycasting/RayCaster.h>

Inheritance diagram for HitBaseN< N >:
ClosestPointHitN< 4 > ClosestPointHitN< 8 > ClosestPointHitN< 16 > RayHitN< 4 > RayHitN< 8 > RayHitN< 16 > ClosestPointHitN< N > RayHitN< N >

Public Member Functions

bool is_valid (size_t i) const
 

Public Attributes

uint32_t valid_mask = 0
 Bitmask indicating which rays in the packet hit something (1 bit per ray).
 
Eigen::Vector< uint32_t, N > mesh_indices
 Index of the mesh that was hit.
 
Eigen::Vector< uint32_t, N > instance_indices
 Index of the instance that was hit (relative to the source mesh).
 
Eigen::Vector< uint32_t, N > facet_indices
 Index of the facet that was hit.
 
Eigen::Matrix< float, 2, N > barycentric_coords = Eigen::Matrix<float, 2, N>::Zero()
 Barycentric coordinates of the hit points within the hit facets.
 
Eigen::Matrix< float, 3, N > positions = Eigen::Matrix<float, 3, N>::Zero()
 World-space position of the hit point.
 

Detailed Description

template<size_t N>
struct lagrange::raycasting::HitBaseN< N >

Shared base struct for multi-ray and multi-point hits.

Template Parameters
NNumber of rays/points in the packet (e.g., 4, 8, or 16).

Member Data Documentation

◆ mesh_indices

template<size_t N>
Eigen::Vector<uint32_t, N> mesh_indices
Initial value:
=
Eigen::Vector<uint32_t, N>::Constant(invalid<uint32_t>())
constexpr T invalid()
You can use invalid<T>() to get a value that can represent "invalid" values, such as invalid indices ...
Definition invalid.h:40

Index of the mesh that was hit.

◆ instance_indices

template<size_t N>
Eigen::Vector<uint32_t, N> instance_indices
Initial value:
=
Eigen::Vector<uint32_t, N>::Constant(invalid<uint32_t>())

Index of the instance that was hit (relative to the source mesh).

◆ facet_indices

template<size_t N>
Eigen::Vector<uint32_t, N> facet_indices
Initial value:
=
Eigen::Vector<uint32_t, N>::Constant(invalid<uint32_t>())

Index of the facet that was hit.

◆ barycentric_coords

template<size_t N>
Eigen::Matrix<float, 2, N> barycentric_coords = Eigen::Matrix<float, 2, N>::Zero()

Barycentric coordinates of the hit points within the hit facets.

Given a triangle (p1, p2, p3), the barycentric coordinates (u, v) are such that the surface point is represented by p = (1 - u - v) * p1 + u * p2 + v * p3.


The documentation for this struct was generated from the following file: