Lagrange
Loading...
Searching...
No Matches
OccludedInstanceSampler< Scalar, Index > Class Template Reference

Stateful algorithm for finding occluded instances in a scene. More...

#include <lagrange/raycasting/remove_occluded_instances.h>

Classes

struct  Impl
 

Public Member Functions

 OccludedInstanceSampler (const scene::SimpleScene< Scalar, Index, 3 > &scene, function_ref< bool(Index mesh_index, Index instance_index)> is_occluder=[](Index, Index) { return true;})
 Build the ray caster and per-instance precomputation.
 
 OccludedInstanceSampler (OccludedInstanceSampler &&) noexcept
 
OccludedInstanceSampleroperator= (OccludedInstanceSampler &&) noexcept
 
void run_batch (uint64_t num_rays)
 Run a batch distributing num_rays across instances not yet marked visible.
 
bool is_visible (Index global_index) const
 Whether the instance has been marked visible so far.
 
uint64_t num_rays_cast (Index global_index) const
 Rays cast so far for the instance.
 
Index num_instances () const
 Total number of instances.
 

Detailed Description

template<typename Scalar, typename Index>
class lagrange::raycasting::OccludedInstanceSampler< Scalar, Index >

Stateful algorithm for finding occluded instances in a scene.

Each call to run_batch distributes rays over instances not yet marked visible, progressively improving the result.

Note
Only 3D scenes are supported.
Template Parameters
ScalarMesh scalar type.
IndexMesh index type.

Constructor & Destructor Documentation

◆ OccludedInstanceSampler()

template<typename Scalar, typename Index>
OccludedInstanceSampler ( const scene::SimpleScene< Scalar, Index, 3 > & scene,
function_ref< bool(Index mesh_index, Index instance_index)> is_occluder = [](Index, Index) { return true;} )
explicit

Build the ray caster and per-instance precomputation.

Parameters
[in]sceneScene to process.
[in]is_occluderReturns whether (mesh_index, instance_index) should block rays. Non-occluder instances are still tested for visibility but do not contribute to the ray-caster scene.

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