initialize variables

This commit is contained in:
Arne Morten Kvarving 2023-06-01 09:37:22 +02:00
parent 19f103db9b
commit 5ab4c3dfa0
2 changed files with 3 additions and 7 deletions

View File

@ -283,7 +283,7 @@ bool Ray::boxIntersect(const BoundingBox& box, Vec3d* intersectionPoint) const
// Find candidate planes; this loop can be avoided if rays cast all from the eye(assume perpsective view)
bool inside = true;
char quadrant[3];
char quadrant[3]{};
double candidatePlane[3] = {0.0, 0.0, 0.0};
Vec3d min = box.min();
@ -320,17 +320,13 @@ bool Ray::boxIntersect(const BoundingBox& box, Vec3d* intersectionPoint) const
}
// Calculate T distances to candidate planes
double maxT[3];
double maxT[3]{-1.0f, -1.0f, -1.0f};
for (i = 0; i < 3; i++)
{
if (quadrant[i] != MIDDLE && m_direction[i] !=0.0f)
{
maxT[i] = (candidatePlane[i] - m_origin[i]) / m_direction[i];
}
else
{
maxT[i] = -1.0f;
}
}
// Get largest of the maxT's for final choice of intersection

View File

@ -1084,7 +1084,7 @@ int HexGridIntersectionTools::planeHexIntersectionMC( const cvf::Plane& plane
}
cvf::Vec3d edgeIntersections[12];
double normDistAlongEdge[12];
double normDistAlongEdge[12]{};
// Compute vertex coordinates on the edges where we have intersections
if ( cubeIdxToCutEdgeBitfield[cubeIndex] & 1 )