Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
RaycasterVisualisation.hpp
1#pragma once
2#include "resources/Mesh.hpp"
3#include "raycaster/Raycaster.hpp"
4#include "Common.hpp"
5
11public:
15 explicit RaycasterVisualisation(const Raycaster & raycaster);
16
20 void getAllLevels(std::vector<Mesh> & meshes) const;
21
30 Raycaster::Hit getRayLevels(const glm::vec3 & origin, const glm::vec3 & direction, std::vector<Mesh> & meshes, float mini = 0.0001f, float maxi = 1e8f) const;
31
39 void getRayMesh(const glm::vec3 & rayPos, const glm::vec3 & rayDir, const Raycaster::Hit & hit, Mesh & mesh, float defaultLength = 10000.0f) const;
40
41private:
43 struct DisplayNode {
44 size_t node;
45 size_t depth;
46 };
47
52 void createBVHMeshes(const std::vector<DisplayNode> & nodes, std::vector<Mesh> & meshes) const;
53
55};
Represents a geometric mesh composed of vertices, other attributes and triangles.
Definition: Mesh.hpp:15
Allows to cast rays against a polygonal mesh, on the CPU. Relies on an internal acceleration structur...
Definition: Raycaster.hpp:10
Helper that can generate information on a raycaster internal data: BVH visualisation,...
Definition: RaycasterVisualisation.hpp:10
void createBVHMeshes(const std::vector< DisplayNode > &nodes, std::vector< Mesh > &meshes) const
Definition: RaycasterVisualisation.cpp:111
void getAllLevels(std::vector< Mesh > &meshes) const
Definition: RaycasterVisualisation.cpp:9
Raycaster::Hit getRayLevels(const glm::vec3 &origin, const glm::vec3 &direction, std::vector< Mesh > &meshes, float mini=0.0001f, float maxi=1e8f) const
Definition: RaycasterVisualisation.cpp:35
void getRayMesh(const glm::vec3 &rayPos, const glm::vec3 &rayDir, const Raycaster::Hit &hit, Mesh &mesh, float defaultLength=10000.0f) const
Definition: RaycasterVisualisation.cpp:83
const Raycaster & _raycaster
The raycaster to visualise.
Definition: RaycasterVisualisation.hpp:54
Definition: Raycaster.hpp:16
Definition: RaycasterVisualisation.hpp:43
size_t node
The index of the node.
Definition: RaycasterVisualisation.hpp:44
size_t depth
Its depth.
Definition: RaycasterVisualisation.hpp:45