Lagrange
Loading...
Searching...
No Matches
HitBase Struct Reference

Shared base struct for ray and closest point hits. More...

#include <lagrange/raycasting/RayCaster.h>

Inheritance diagram for HitBase:
ClosestPointHit RayHit

Public Attributes

uint32_t mesh_index = invalid<uint32_t>()
 Index of the mesh that was hit.
 
uint32_t instance_index = invalid<uint32_t>()
 Index of the instance that was hit (relative to the source mesh).
 
uint32_t facet_index = invalid<uint32_t>()
 Index of the facet that was hit.
 
Eigen::Vector2f barycentric_coord = Eigen::Vector2f::Zero()
 Barycentric coordinates of the hit point within the hit facet.
 
Eigen::Vector3f position = Eigen::Vector3f::Zero()
 World-space position of the hit point.
 

Detailed Description

Shared base struct for ray and closest point hits.

Member Data Documentation

◆ barycentric_coord

Eigen::Vector2f barycentric_coord = Eigen::Vector2f::Zero()

Barycentric coordinates of the hit point within the hit facet.

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: