diff --git a/sources/reactphysics3d/mathematics/Quaternion.cpp b/sources/reactphysics3d/mathematics/Quaternion.cpp index 54238f70..d87603fa 100755 --- a/sources/reactphysics3d/mathematics/Quaternion.cpp +++ b/sources/reactphysics3d/mathematics/Quaternion.cpp @@ -18,7 +18,8 @@ ***************************************************************************/ // Libraries -#include "mathematics.h" +#include "Quaternion.h" +#include "Vector3D.h" #include // Namespace diff --git a/sources/reactphysics3d/mathematics/Vector3D.h b/sources/reactphysics3d/mathematics/Vector3D.h index 9a7acc7c..c617ff89 100644 --- a/sources/reactphysics3d/mathematics/Vector3D.h +++ b/sources/reactphysics3d/mathematics/Vector3D.h @@ -22,6 +22,7 @@ // Libraries #include +#include #include "exceptions.h" #include "mathematics_functions.h" @@ -130,7 +131,7 @@ inline Vector3D Vector3D::crossProduct(const Vector3D& vector) const { // Return true if two vectors are parallel inline bool Vector3D::isParallelWith(const Vector3D& vector) const { - return (approxEqual(this->scalarProduct(vector), length() * vector.length())); + return (approxEqual(abs(this->scalarProduct(vector)), length() * vector.length())); } // Overloaded operator for multiplication between a number and a Vector3D (inline) diff --git a/sources/reactphysics3d/mathematics/mathematics.h b/sources/reactphysics3d/mathematics/mathematics.h index 886c22af..118fd57b 100644 --- a/sources/reactphysics3d/mathematics/mathematics.h +++ b/sources/reactphysics3d/mathematics/mathematics.h @@ -25,14 +25,13 @@ // Libraries #include "Matrix.h" #include "Matrix3x3.h" -#include "Polygon3D.h" #include "Quaternion.h" -#include "Segment3D.h" #include "Vector.h" #include "Vector3D.h" #include "constants.h" #include "exceptions.h" #include "mathematics_functions.h" +#include #include #include #include @@ -172,6 +171,7 @@ inline std::vector movePoints(const std::vector clipSegmentWithRectangleInPlane(con return outputSegment; } - // TODO : Test this method // This method uses the Sutherland-Hodgman clipping algorithm to clip a subject polygon (given by the ordered 3D vertices in "subjectPolygon") using // a rectangle polygon (given by the ordered 3D vertices in "clipRectangle"). The subject polygon and the clip rectangle are in 3D but we assumed that @@ -367,5 +366,6 @@ inline std::vector clipPolygonWithRectangleInPlane(con } } // End of the ReactPhysics3D namespace + #endif