gtsam_points
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
gtsam_points::VoxelRaycaster Class Reference

Raycasting-based voxel traversal algorithm. The iterator traverses voxel coordinates intersected by the ray but excludes the end voxel. J. Amanatides and A. Woo, "A Fast Voxel Traversal Algorithm for Ray Tracing", Eurographics, 1987. More...

#include <voxel_raycaster.hpp>

Classes

class  Iterator
 Iterator for traversing voxel coordinates along the ray. More...
 

Public Member Functions

 VoxelRaycaster (const Eigen::Vector4d &start, const Eigen::Vector4d &end, double voxel_size)
 Constructor.
 
Iterator begin () const
 Get the begin iterator. (begin() == start_coord)
 
Iterator end () const
 Get the end iterator. (end() == end_coord)
 
const Eigen::Vector3i & start_voxel () const
 Get the start voxel coordinate.
 
const Eigen::Vector3i & end_voxel () const
 Get the end voxel coordinate.
 

Detailed Description

Raycasting-based voxel traversal algorithm. The iterator traverses voxel coordinates intersected by the ray but excludes the end voxel. J. Amanatides and A. Woo, "A Fast Voxel Traversal Algorithm for Ray Tracing", Eurographics, 1987.

gtsam_points::VoxelRaycaster ray(Eigen::Vector4d(10.0, 20.0, 30.0, 1.0), Eigen::Vector4d(5.0, 10.0, 15.0, 1.0), 1.0); std::vector<Eigen::Vector3i> voxels; for (auto itr = ray.begin(); itr != ray.end(); ++itr) { voxels.emplace_back(*itr); } voxels.emplace_back(ray.end_coord); // Include the end voxel if needed

Constructor & Destructor Documentation

◆ VoxelRaycaster()

gtsam_points::VoxelRaycaster::VoxelRaycaster ( const Eigen::Vector4d &  start,
const Eigen::Vector4d &  end,
double  voxel_size 
)

Constructor.

Parameters
startStart point of the ray (homogeneous coordinates)
endEnd point of the ray (homogeneous coordinates)
voxel_sizeSize of each voxel

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