MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / ray_quick_skip

Function ray_quick_skip

src/geode/geometry/bounding_box.cpp:68–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67 template < geode::index_t dimension >
68 bool ray_quick_skip( const geode::BoundingBox< dimension >& box,
69 const geode::Ray< dimension >& ray )
70 {
71 const auto box_half_extent = box.diagonal() / 2.;
72 const auto ray_translated_origin = ray.origin() - box.center();
73 for( const auto i : geode::LRange{ dimension } )
74 {
75 if( std::fabs( ray_translated_origin.value( i ) )
76 - box_half_extent.value( i )
77 > geode::GLOBAL_EPSILON
78 && ray_translated_origin.value( i ) * ray.direction().value( i )
79 > geode::GLOBAL_EPSILON )
80 {
81 return true;
82 }
83 }
84 return false;
85 }
86
87 template < geode::index_t dimension >
88 bool segment_quick_skip( const geode::BoundingBox< dimension >& box,

Callers 2

intersectsMethod · 0.85
epsilon_intersectsMethod · 0.85

Calls 4

diagonalMethod · 0.80
centerMethod · 0.80
valueMethod · 0.45
directionMethod · 0.45

Tested by

no test coverage detected