Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions source/MRMesh/MRMeshIntersect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ void multiRayMeshIntersect(
result.intersectingRays->resize( sz, false );
}
constexpr float cQuietNan = std::numeric_limits<float>::quiet_NaN();
if ( result.rayParams )
if ( result.rayDistances )
{
result.rayParams->clear();
result.rayParams->resize( sz, cQuietNan );
result.rayDistances->clear();
result.rayDistances->resize( sz, cQuietNan );
}
if ( result.isectFaces )
{
Expand All @@ -196,6 +196,8 @@ void multiRayMeshIntersect(
return;
if ( result.intersectingRays )
result.intersectingRays->set( i );
if ( result.rayDistances )
( *result.rayDistances )[i] = res.distanceAlongLine;
if ( result.isectFaces )
(*result.isectFaces)[i] = res.proj.face;
if ( result.isectBary )
Expand Down
2 changes: 1 addition & 1 deletion source/MRMesh/MRMeshIntersect.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct MultiRayMeshIntersectResult
{
// outputs (each one if optional) for every ray:
BitSet * intersectingRays = nullptr; ///< true if the ray has intersection with mesh part, false otherwise
std::vector<float> * rayParams = nullptr; ///< distance along each ray till the intersection point or NaN if no intersection
std::vector<float> * rayDistances = nullptr; ///< distance along each ray till the intersection point or NaN if no intersection
std::vector<FaceId> * isectFaces = nullptr; ///< intersected triangles from mesh
std::vector<TriPointf> * isectBary = nullptr;///< barycentric coordinates of the intersection point within intersected triangle or NaNs if no intersection
std::vector<Vector3f> * isectPts = nullptr; ///< intersection points or NaNs if no intersection
Expand Down
Loading