Skip to content
Snippets Groups Projects

Fix use of uninitialized invSpacing value in volume raytracing

Merged Kenneth Moreland requested to merge kmorel/vtk-m:volume-raytracing-crash into master
1 file
+ 7
2
Compare changes
  • Side-by-side
  • Inline
@@ -681,9 +681,14 @@ class SamplerCellAssocRect : public vtkm::worklet::WorkletMapField
{
for(vtkm::Int32 dim = 0; dim < 3; ++dim)
{
if(rayDir[dim] == 0.f) continue;
vtkm::FloatDefault searchDir = (rayDir[dim] > 0.f) ? vtkm::FloatDefault(1.0) : vtkm::FloatDefault(-1.0);
bool notFound = true;
if(rayDir[dim] == 0.f)
{
// If the ray direction is zero, then the ray does not move from
// cell to cell, and is therefore already found.
notFound = false;
}
vtkm::FloatDefault searchDir = (rayDir[dim] > 0.f) ? vtkm::FloatDefault(1.0) : vtkm::FloatDefault(-1.0);
while(notFound)
{
vtkm::Id nextPoint = cell[dim] + static_cast<vtkm::Id>(searchDir);
Loading