Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
RaycasterVisualisation Class Reference

Helper that can generate information on a raycaster internal data: BVH visualisation, etc. More...

#include <RaycasterVisualisation.hpp>

Classes

struct  DisplayNode
 

Public Member Functions

 RaycasterVisualisation (const Raycaster &raycaster)
 
void getAllLevels (std::vector< Mesh > &meshes) const
 
Raycaster::Hit getRayLevels (const glm::vec3 &origin, const glm::vec3 &direction, std::vector< Mesh > &meshes, float mini=0.0001f, float maxi=1e8f) const
 
void getRayMesh (const glm::vec3 &rayPos, const glm::vec3 &rayDir, const Raycaster::Hit &hit, Mesh &mesh, float defaultLength=10000.0f) const
 

Private Member Functions

void createBVHMeshes (const std::vector< DisplayNode > &nodes, std::vector< Mesh > &meshes) const
 

Private Attributes

const Raycaster_raycaster
 The raycaster to visualise.
 

Detailed Description

Helper that can generate information on a raycaster internal data: BVH visualisation, etc.

Constructor & Destructor Documentation

◆ RaycasterVisualisation()

RaycasterVisualisation::RaycasterVisualisation ( const Raycaster raycaster)
explicit

Constructor.

Parameters
raycasterthe raycaster about which to provide visualisation

Member Function Documentation

◆ createBVHMeshes()

void RaycasterVisualisation::createBVHMeshes ( const std::vector< DisplayNode > &  nodes,
std::vector< Mesh > &  meshes 
) const
private

Generate geometry for a subset of the bounding volume hierarchy as a series of bounding boxes.

Parameters
nodesthe nodes to generate geometry for
mesheswill be filled with the geometry of each depth level

◆ getAllLevels()

void RaycasterVisualisation::getAllLevels ( std::vector< Mesh > &  meshes) const

Generate geometry to visualize each level of the bounding volume hierarchy as a series of bounding boxes.

Parameters
mesheswill be filled with the geometry of each depth level

◆ getRayLevels()

Raycaster::Hit RaycasterVisualisation::getRayLevels ( const glm::vec3 &  origin,
const glm::vec3 &  direction,
std::vector< Mesh > &  meshes,
float  mini = 0.0001f,
float  maxi = 1e8f 
) const

Cast a ray and generate geometry for all intersected nodes at each level of the bounding volume hierarchy as a series of bounding boxes.

Parameters
originray origin
directionray direction (not necessarily normalized)
mesheswill be filled with the geometry of each depth level
minithe minimum distance allowed for the intersection
maxithe maximum distance allowed for the intersection
Returns
a hit object containg the potential hit informations

◆ getRayMesh()

void RaycasterVisualisation::getRayMesh ( const glm::vec3 &  rayPos,
const glm::vec3 &  rayDir,
const Raycaster::Hit hit,
Mesh mesh,
float  defaultLength = 10000.0f 
) const

Generate a mesh representing a ray and the intersected triangle.

Parameters
rayPosthe ray origin
rayDirthe ray direction( will be normalized)
hitthe ray hit
meshwill be filled with the ray and triangle geometry
defaultLengththe length of the ray when no collision happened

The documentation for this class was generated from the following files: