HighMap library (C++)
Loading...
Searching...
No Matches
hmap::BVH2D Class Reference

2D Linear Bounding Volume Hierarchy for line segments. More...

#include <bvh.hpp>

Classes

struct  Node

Public Member Functions

 BVH2D ()=default
 BVH2D (const std::vector< Segment2D > &segments, float padding=0.f)
 Build BVH over line segments with capsule expansion padding.
void build (const std::vector< Segment2D > &segments, float padding=0.f)
 Rebuild BVH with given segments and padding.
void clear () noexcept
 Clear BVH.
bool empty () const noexcept
const AABB2D & root_bbox () const noexcept
void query_box (const AABB2D &query_box, std::vector< uint32_t > &out_seg_indices) const
 Query all segments whose padded bounding boxes overlap with query_box.
void query_point (const glm::vec2 &p, std::vector< uint32_t > &out_seg_indices) const
 Query all segments whose padded bounding boxes contain point p.
const std::vector< Segment2D > & get_segments () const noexcept
const std::vector< Node > & get_nodes () const noexcept

Detailed Description

2D Linear Bounding Volume Hierarchy for line segments.

Constructor & Destructor Documentation

◆ BVH2D() [1/2]

hmap::BVH2D::BVH2D ( )
default

◆ BVH2D() [2/2]

hmap::BVH2D::BVH2D ( const std::vector< Segment2D > & segments,
float padding = 0.f )
explicit

Build BVH over line segments with capsule expansion padding.

Member Function Documentation

◆ build()

void hmap::BVH2D::build ( const std::vector< Segment2D > & segments,
float padding = 0.f )

Rebuild BVH with given segments and padding.

◆ clear()

void hmap::BVH2D::clear ( )
noexcept

Clear BVH.

◆ empty()

bool hmap::BVH2D::empty ( ) const
inlinenoexcept

◆ root_bbox()

const AABB2D & hmap::BVH2D::root_bbox ( ) const
inlinenoexcept

◆ query_box()

void hmap::BVH2D::query_box ( const AABB2D & query_box,
std::vector< uint32_t > & out_seg_indices ) const

Query all segments whose padded bounding boxes overlap with query_box.

◆ query_point()

void hmap::BVH2D::query_point ( const glm::vec2 & p,
std::vector< uint32_t > & out_seg_indices ) const

Query all segments whose padded bounding boxes contain point p.

◆ get_segments()

const std::vector< Segment2D > & hmap::BVH2D::get_segments ( ) const
inlinenoexcept

◆ get_nodes()

const std::vector< Node > & hmap::BVH2D::get_nodes ( ) const
inlinenoexcept

The documentation for this class was generated from the following files:
  • HighMap/include/highmap/geometry/bvh.hpp
  • HighMap/src/geometry/bvh.cpp