MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / rayMultiMeshAnyIntersect_

Function rayMultiMeshAnyIntersect_

source/MRMesh/MRMeshIntersect.cpp:231–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229
230template<typename T>
231MultiMeshIntersectionResult rayMultiMeshAnyIntersect_( const std::vector<Line3Mesh<T>> & lineMeshes,
232 T rayStart /*= 0.0f*/, T rayEnd /*= FLT_MAX */ )
233{
234 MultiMeshIntersectionResult res;
235 for ( const auto & lm : lineMeshes )
236 {
237 assert( lm.mesh );
238 auto prec = lm.prec;
239 IntersectionPrecomputes<T> myPrec;
240 if ( !prec )
241 {
242 myPrec = { lm.line.d };
243 prec = &myPrec;
244 }
245 if ( auto r = meshRayIntersect_( { *lm.mesh, lm.region }, lm.line, rayStart, rayEnd, *prec, false, {} ) )
246 {
247 res = MultiMeshIntersectionResult{ r };
248 break;
249 }
250 }
251 return res;
252}
253
254MultiMeshIntersectionResult rayMultiMeshAnyIntersect( const std::vector<Line3fMesh> & lineMeshes,
255 float rayStart, float rayEnd )

Callers 1

rayMultiMeshAnyIntersectFunction · 0.85

Calls 1

meshRayIntersect_Function · 0.85

Tested by

no test coverage detected