Skip to content

Commit

Permalink
Fix compilation and initialization issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Haumont committed May 22, 2024
1 parent d625c61 commit 4cf9a55
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
4 changes: 2 additions & 2 deletions visilib/math_plane_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ namespace visilib

if (MathArithmetic<S>::getAbs(r) > epsilon)
{
return MathPlane3d(myNormal, -myNormal.dot(v0));
return MathPlane3_<S>(myNormal, -myNormal.dot(v0));
}
V_ASSERT(0);
return MathPlane3d::Zero();
return MathPlane3_<S>::Zero();
}

static bool computeTrianglePlane(MathPlane3_<S> & aPlane, MathVector3_<S> * aTriangeVertices, S epsilon)
Expand Down
13 changes: 13 additions & 0 deletions visilib/math_plucker_6.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@ namespace visilib
V_ASSERT(MathArithmetic<S>::isFinite(getLocation()));
}

/**@brief Construct a plucker point from a 3D line defined by two points*/
MathPlucker6(const MathVector3f& aBegin, const MathVector3f& anEnd)
{
MathVector3_<S> myBegin = convert<MathVector3_<S>>(aBegin);
MathVector3_<S> myEnd = convert<MathVector3_<S>>(anEnd);

mDirection = myEnd - myBegin;
mLocation = MathVector3_<S>::cross(myBegin, myEnd);

V_ASSERT(MathArithmetic<S>::isFinite(getDirection()));
V_ASSERT(MathArithmetic<S>::isFinite(getLocation()));
}

/**@brief Subtract another point in Plucker space*/
MathPlucker6<S>& operator -= (const MathPlucker6<S>& v)
{
Expand Down
5 changes: 4 additions & 1 deletion visilib/math_vector_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ namespace visilib
x *= inv;
y *= inv;
}

else
{
x=y=0.0;
}
return d;
}
MathVector2_ getNormalized() const
Expand Down
5 changes: 4 additions & 1 deletion visilib/math_vector_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ namespace visilib
y *= inv;
z *= inv;
}

else
{
x = y = z = 0;
}
return d;
}

Expand Down
7 changes: 5 additions & 2 deletions visilib/plucker_polytope_splitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,12 @@ namespace visilib
myI2 = temp;
}

const std::vector<size_t>& facetsI1 = aPolyhedron->getFacetsDescription(myI1);
const std::vector<size_t>& facetsI2 = aPolyhedron->getFacetsDescription(myI2);

std::vector<size_t> myFacets;
MathCombinatorial::initFacets(aPolyhedron->getFacetsDescription(myI1),
aPolyhedron->getFacetsDescription(myI2),
MathCombinatorial::initFacets(facetsI1,
facetsI2,
aPlaneID,
myFacets);

Expand Down

0 comments on commit 4cf9a55

Please sign in to comment.